[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-twister] 01/03: fix root cause of #5337: curl interp
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-twister] 01/03: fix root cause of #5337: curl interprets early response from MHD as error response (even though it is a 200 OK) and then aborted the upload; so we should wait with the response until the upload is complete |
Date: |
Thu, 20 Sep 2018 20:10:38 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository twister.
commit c27ec06b744f57189e4247410da09257b403ebbc
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Sep 20 20:08:34 2018 +0200
fix root cause of #5337: curl interprets early response from MHD as error
response (even though it is a 200 OK) and then aborted the upload; so we should
wait with the response until the upload is complete
---
src/test/test_twister_webserver.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/src/test/test_twister_webserver.c
b/src/test/test_twister_webserver.c
index bf32fcf..bb434c0 100644
--- a/src/test/test_twister_webserver.c
+++ b/src/test/test_twister_webserver.c
@@ -43,26 +43,33 @@ answer_to_connection
const char *version, const char *upload_data,
size_t *upload_data_size, void **con_cls)
{
- #if 0
+#if 0
const char *page = "<html><body>Hello, browser!</body></html>";
- #endif
-
+#endif
const char *page = "{\"hello\": [{\"this\": \"browser!\"}],"\
"\"when\": \"today\"}";
-
struct MHD_Response *response;
int ret;
+
(void)cls; /* Unused. Silent compiler warning. */
(void)url; /* Unused. Silent compiler warning. */
(void)method; /* Unused. Silent compiler warning. */
(void)version; /* Unused. Silent compiler warning. */
(void)upload_data; /* Unused. Silent compiler warning. */
- (void)upload_data_size; /* Unused. Silent compiler warning. */
- (void)con_cls; /* Unused. Silent compiler warning. */
+ if (NULL == (*con_cls))
+ {
+ *con_cls = "first";
+ return MHD_YES;
+ }
+ if (0 != *upload_data_size)
+ {
+ *upload_data_size = 0;
+ return MHD_YES;
+ }
response = MHD_create_response_from_buffer
(strlen (page),
- (void *) page,
+ (void *) page,
MHD_RESPMEM_PERSISTENT);
ret = MHD_queue_response (connection, MHD_HTTP_OK, response);
MHD_destroy_response (response);
--
To stop receiving notification emails like this one, please contact
address@hidden