aboutsummaryrefslogtreecommitdiff
path: root/src/testcurl
diff options
context:
space:
mode:
Diffstat (limited to 'src/testcurl')
-rw-r--r--src/testcurl/test_digestauth.c8
-rw-r--r--src/testcurl/test_digestauth_sha256.c8
-rw-r--r--src/testcurl/test_digestauth_with_arguments.c8
3 files changed, 24 insertions, 0 deletions
diff --git a/src/testcurl/test_digestauth.c b/src/testcurl/test_digestauth.c
index 13c9c826..5dd9d466 100644
--- a/src/testcurl/test_digestauth.c
+++ b/src/testcurl/test_digestauth.c
@@ -94,10 +94,18 @@ ahc_echo (void *cls,
94 const char *realm = "test@example.com"; 94 const char *realm = "test@example.com";
95 enum MHD_Result ret; 95 enum MHD_Result ret;
96 int ret_i; 96 int ret_i;
97 static int already_called_marker;
97 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 98 (void) cls; (void) url; /* Unused. Silent compiler warning. */
98 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 99 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
99 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ 100 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
100 101
102 if (&already_called_marker != *req_cls)
103 { /* Called for the first time, request not fully read yet */
104 *req_cls = &already_called_marker;
105 /* Wait for complete request */
106 return MHD_YES;
107 }
108
101 username = MHD_digest_auth_get_username (connection); 109 username = MHD_digest_auth_get_username (connection);
102 if ( (username == NULL) || 110 if ( (username == NULL) ||
103 (0 != strcmp (username, "testuser")) ) 111 (0 != strcmp (username, "testuser")) )
diff --git a/src/testcurl/test_digestauth_sha256.c b/src/testcurl/test_digestauth_sha256.c
index 7f8ebcd5..fff3a1d7 100644
--- a/src/testcurl/test_digestauth_sha256.c
+++ b/src/testcurl/test_digestauth_sha256.c
@@ -95,10 +95,18 @@ ahc_echo (void *cls,
95 const char *realm = "test@example.com"; 95 const char *realm = "test@example.com";
96 enum MHD_Result ret; 96 enum MHD_Result ret;
97 int ret_i; 97 int ret_i;
98 static int already_called_marker;
98 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 99 (void) cls; (void) url; /* Unused. Silent compiler warning. */
99 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 100 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
100 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ 101 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
101 102
103 if (&already_called_marker != *req_cls)
104 { /* Called for the first time, request not fully read yet */
105 *req_cls = &already_called_marker;
106 /* Wait for complete request */
107 return MHD_YES;
108 }
109
102 username = MHD_digest_auth_get_username (connection); 110 username = MHD_digest_auth_get_username (connection);
103 if ( (username == NULL) || 111 if ( (username == NULL) ||
104 (0 != strcmp (username, "testuser")) ) 112 (0 != strcmp (username, "testuser")) )
diff --git a/src/testcurl/test_digestauth_with_arguments.c b/src/testcurl/test_digestauth_with_arguments.c
index ce4b8970..91f2dd67 100644
--- a/src/testcurl/test_digestauth_with_arguments.c
+++ b/src/testcurl/test_digestauth_with_arguments.c
@@ -88,10 +88,18 @@ ahc_echo (void *cls,
88 const char *realm = "test@example.com"; 88 const char *realm = "test@example.com";
89 enum MHD_Result ret; 89 enum MHD_Result ret;
90 int ret_i; 90 int ret_i;
91 static int already_called_marker;
91 (void) cls; (void) url; /* Unused. Silent compiler warning. */ 92 (void) cls; (void) url; /* Unused. Silent compiler warning. */
92 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */ 93 (void) method; (void) version; (void) upload_data; /* Unused. Silent compiler warning. */
93 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */ 94 (void) upload_data_size; (void) req_cls; /* Unused. Silent compiler warning. */
94 95
96 if (&already_called_marker != *req_cls)
97 { /* Called for the first time, request not fully read yet */
98 *req_cls = &already_called_marker;
99 /* Wait for complete request */
100 return MHD_YES;
101 }
102
95 username = MHD_digest_auth_get_username (connection); 103 username = MHD_digest_auth_get_username (connection);
96 if ( (username == NULL) || 104 if ( (username == NULL) ||
97 (0 != strcmp (username, "testuser")) ) 105 (0 != strcmp (username, "testuser")) )