diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-04-10 16:39:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-04-10 16:39:01 +0200 |
commit | 6195e1470daef70a1429c254c7e55a4bce3eb2a3 (patch) | |
tree | a7d510c4b29731b7371fd58bfce673a6c0002a7e | |
parent | 25373abd8812c613108c2280c0b5a2292eaf9d66 (diff) | |
download | twister-6195e1470daef70a1429c254c7e55a4bce3eb2a3.tar.gz twister-6195e1470daef70a1429c254c7e55a4bce3eb2a3.tar.bz2 twister-6195e1470daef70a1429c254c7e55a4bce3eb2a3.zip |
fix to match latest MHD API
-rw-r--r-- | src/twister/taler-twister-service.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c index 33a043e..532efd3 100644 --- a/src/twister/taler-twister-service.c +++ b/src/twister/taler-twister-service.c @@ -36,6 +36,7 @@ #endif #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> +#include <gnunet/gnunet_mhd_compat.h> #include "twister.h" #include <jansson.h> #include <microhttpd.h> @@ -248,7 +249,6 @@ struct HttpRequest }; - /* *********************** Globals **************************** */ /** @@ -542,8 +542,7 @@ curl_download_cb (void *ptr, rest of the upload. This should only really happen with uploads without "Expect: 100 Continue" and Web servers responding with an error (i.e. upload - not allowed) */ - hr->state = REQUEST_STATE_PROXY_DOWNLOAD_STARTED; + not allowed) */hr->state = REQUEST_STATE_PROXY_DOWNLOAD_STARTED; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stopping %u byte upload: we are already downloading...\n", @@ -628,8 +627,7 @@ curl_upload_cb (void *buf, * We got rescheduled because the download callback was asleep. * FIXME: can this block be eliminated and the unpausing being * moved in the last block where we return zero as well? - */ - if ( (0 == hr->io_len) && + */if ( (0 == hr->io_len) && (REQUEST_STATE_PROXY_DOWNLOAD_STARTED == hr->state) ) { if (GNUNET_YES == hr->curl_paused) @@ -697,6 +695,7 @@ build_host_header (const char *url) return header; } + /* ************** main loop of cURL interaction ************* */ @@ -914,7 +913,7 @@ curl_task_download (void *cls) * @param value field value * @return #MHD_YES to continue to iterate */ -static int +static MHD_RESULT con_val_iter (void *cls, enum MHD_ValueKind kind, const char *key, @@ -1042,8 +1041,7 @@ walk_object (const char *path, * ULONG max AND the array has such a index, then this * test won't detect any error. Likewise, the method for * deleting/modifying the response will operate on that - * same random array element. */ - (NULL == json_array_get (element, (unsigned int) strtoul + * same random array element. */(NULL == json_array_get (element, (unsigned int) strtoul (token, NULL, 10))) ) { TALER_LOG_WARNING ("(Last) path token '%s' not found\n", @@ -1242,7 +1240,6 @@ flip_object (struct MHD_Connection *con, } - /** * Delete object within the proxied response. * Always queues a response; only deletes the object if it is @@ -1295,6 +1292,7 @@ delete_object (struct MHD_Connection *con, return GNUNET_OK; } + /** * Decompress data. * @@ -1453,7 +1451,7 @@ create_response_with_chaos_rate (struct HttpRequest *request) * #MHD_NO if the socket must be closed due to a serious * error while handling the request */ -static int +static MHD_RESULT create_response (void *cls, struct MHD_Connection *con, const char *url, @@ -2516,7 +2514,6 @@ run (void *cls, } - /** * Callback called when a client connects to the service. * @@ -2609,6 +2606,7 @@ handle_malform_upload (void *cls, send_acknowledgement (c); } + /** * Control handler for deleting JSON response objects * @@ -2622,6 +2620,7 @@ check_modify_path_dl (void *cls, return GNUNET_OK; } + /** * Control handler for deleting JSON response objects * @@ -2657,6 +2656,7 @@ handle_modify_path_dl (void *cls, send_acknowledgement (c); } + /** * Control handler for deleting JSON response objects * @@ -2670,6 +2670,7 @@ check_modify_path_ul (void *cls, return GNUNET_OK; } + /** * Control handler for deleting JSON request objects; * (means request to the proxied services) @@ -2738,6 +2739,7 @@ handle_flip_path_dl (void *cls, send_acknowledgement (c); } + /** * Control handler for flipping JSON strings into request objects * @@ -2751,6 +2753,7 @@ check_flip_path_ul (void *cls, return GNUNET_OK; } + /** * Control handler for flipping JSON strings into request objects * @@ -2764,6 +2767,7 @@ check_flip_path_dl (void *cls, return GNUNET_OK; } + /** * Control handler for flipping JSON strings into request objects * @@ -2795,6 +2799,7 @@ handle_flip_path_ul (void *cls, send_acknowledgement (c); } + /** * Control handler for deleting JSON fields from response objects * |