diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-12-07 12:40:32 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-12-07 12:40:40 +0100 |
commit | 0eefd20ba370509d93fb7b0220e6d1c5739efac5 (patch) | |
tree | 9d3d33e14d8862b061b23a41b4c2bc90616fe636 /src/microhttpd/digestauth.c | |
parent | 22c08b5fd71091e84247f43bd36ce08184736f17 (diff) | |
download | libmicrohttpd-0eefd20ba370509d93fb7b0220e6d1c5739efac5.tar.gz libmicrohttpd-0eefd20ba370509d93fb7b0220e6d1c5739efac5.zip |
add build option to compile MHD without threads
Diffstat (limited to 'src/microhttpd/digestauth.c')
-rw-r--r-- | src/microhttpd/digestauth.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c index 33352bc7..80cba836 100644 --- a/src/microhttpd/digestauth.c +++ b/src/microhttpd/digestauth.c | |||
@@ -448,7 +448,9 @@ check_nonce_nc (struct MHD_Connection *connection, | |||
448 | * then only increase the nonce counter by one. | 448 | * then only increase the nonce counter by one. |
449 | */ | 449 | */ |
450 | nn = &daemon->nnc[off]; | 450 | nn = &daemon->nnc[off]; |
451 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | ||
451 | MHD_mutex_lock_chk_ (&daemon->nnc_lock); | 452 | MHD_mutex_lock_chk_ (&daemon->nnc_lock); |
453 | #endif | ||
452 | if (0 == nc) | 454 | if (0 == nc) |
453 | { | 455 | { |
454 | /* Fresh nonce, reinitialize array */ | 456 | /* Fresh nonce, reinitialize array */ |
@@ -457,7 +459,9 @@ check_nonce_nc (struct MHD_Connection *connection, | |||
457 | noncelen); | 459 | noncelen); |
458 | nn->nc = 0; | 460 | nn->nc = 0; |
459 | nn->nmask = 0; | 461 | nn->nmask = 0; |
462 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | ||
460 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); | 463 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); |
464 | #endif | ||
461 | return MHD_YES; | 465 | return MHD_YES; |
462 | } | 466 | } |
463 | /* Note that we use 64 here, as we do not store the | 467 | /* Note that we use 64 here, as we do not store the |
@@ -469,7 +473,9 @@ check_nonce_nc (struct MHD_Connection *connection, | |||
469 | { | 473 | { |
470 | /* Out-of-order nonce, but within 64-bit bitmask, set bit */ | 474 | /* Out-of-order nonce, but within 64-bit bitmask, set bit */ |
471 | nn->nmask |= (1LLU << (nn->nc - nc - 1)); | 475 | nn->nmask |= (1LLU << (nn->nc - nc - 1)); |
476 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | ||
472 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); | 477 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); |
478 | #endif | ||
473 | return MHD_YES; | 479 | return MHD_YES; |
474 | } | 480 | } |
475 | 481 | ||
@@ -478,7 +484,9 @@ check_nonce_nc (struct MHD_Connection *connection, | |||
478 | nonce)) ) | 484 | nonce)) ) |
479 | { | 485 | { |
480 | /* Nonce does not match, fail */ | 486 | /* Nonce does not match, fail */ |
487 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | ||
481 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); | 488 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); |
489 | #endif | ||
482 | #ifdef HAVE_MESSAGES | 490 | #ifdef HAVE_MESSAGES |
483 | MHD_DLOG (daemon, | 491 | MHD_DLOG (daemon, |
484 | _("Stale nonce received. If this happens a lot, you should probably increase the size of the nonce array.\n")); | 492 | _("Stale nonce received. If this happens a lot, you should probably increase the size of the nonce array.\n")); |
@@ -491,7 +499,9 @@ check_nonce_nc (struct MHD_Connection *connection, | |||
491 | else | 499 | else |
492 | nn->nmask = 0; /* big jump, unset all bits in the mask */ | 500 | nn->nmask = 0; /* big jump, unset all bits in the mask */ |
493 | nn->nc = nc; | 501 | nn->nc = nc; |
502 | #if defined(MHD_USE_POSIX_THREADS) || defined(MHD_USE_W32_THREADS) | ||
494 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); | 503 | MHD_mutex_unlock_chk_ (&daemon->nnc_lock); |
504 | #endif | ||
495 | return MHD_YES; | 505 | return MHD_YES; |
496 | } | 506 | } |
497 | 507 | ||