diff options
Diffstat (limited to 'src/examples/digest_auth_example.c')
-rw-r--r-- | src/examples/digest_auth_example.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/examples/digest_auth_example.c b/src/examples/digest_auth_example.c index 44faefeb..ea3da19a 100644 --- a/src/examples/digest_auth_example.c +++ b/src/examples/digest_auth_example.c | |||
@@ -48,6 +48,7 @@ ahc_echo (void *cls, | |||
48 | const char *realm = "test@example.com"; | 48 | const char *realm = "test@example.com"; |
49 | int res; | 49 | int res; |
50 | enum MHD_Result ret; | 50 | enum MHD_Result ret; |
51 | static int already_called_marker; | ||
51 | (void) cls; /* Unused. Silent compiler warning. */ | 52 | (void) cls; /* Unused. Silent compiler warning. */ |
52 | (void) url; /* Unused. Silent compiler warning. */ | 53 | (void) url; /* Unused. Silent compiler warning. */ |
53 | (void) method; /* Unused. Silent compiler warning. */ | 54 | (void) method; /* Unused. Silent compiler warning. */ |
@@ -56,6 +57,13 @@ ahc_echo (void *cls, | |||
56 | (void) upload_data_size; /* Unused. Silent compiler warning. */ | 57 | (void) upload_data_size; /* Unused. Silent compiler warning. */ |
57 | (void) req_cls; /* Unused. Silent compiler warning. */ | 58 | (void) req_cls; /* Unused. Silent compiler warning. */ |
58 | 59 | ||
60 | if (&already_called_marker != *req_cls) | ||
61 | { /* Called for the first time, request not fully read yet */ | ||
62 | *req_cls = &already_called_marker; | ||
63 | /* Wait for complete request */ | ||
64 | return MHD_YES; | ||
65 | } | ||
66 | |||
59 | username = MHD_digest_auth_get_username (connection); | 67 | username = MHD_digest_auth_get_username (connection); |
60 | if (NULL == username) | 68 | if (NULL == username) |
61 | { | 69 | { |