From e81cf4ac0bb7a45254cb57df42de73dc4ace9fba Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Mar 2020 22:07:46 +0100 Subject: refactor to latest libgnunetcurl --- src/sync/sync-httpd.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/sync/sync-httpd.c b/src/sync/sync-httpd.c index b6a047a..e7299e8 100644 --- a/src/sync/sync-httpd.c +++ b/src/sync/sync-httpd.c @@ -90,24 +90,6 @@ static struct MHD_Daemon *mhd; struct SYNC_DatabasePlugin *db; -/** - * Return #GNUNET_YES if given a valid correlation ID and - * #GNUNET_NO otherwise. - * - * @returns #GNUNET_YES iff given a valid correlation ID - */ -static int -is_valid_correlation_id (const char *correlation_id) -{ - if (strlen (correlation_id) >= 64) - return GNUNET_NO; - for (size_t i = 0; i < strlen (correlation_id); i++) - if (! (isalnum (correlation_id[i]) || (correlation_id[i] == '-'))) - return GNUNET_NO; - return GNUNET_YES; -} - - /** * A client has requested the given url using the given method * (#MHD_HTTP_METHOD_GET, #MHD_HTTP_METHOD_PUT, @@ -198,7 +180,7 @@ url_handler (void *cls, MHD_HEADER_KIND, "Sync-Correlation-Id"); if ((NULL != correlation_id) && - (GNUNET_YES != is_valid_correlation_id (correlation_id))) + (GNUNET_YES != GNUNET_CURL_is_valid_scope_id (correlation_id))) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "illegal incoming correlation ID\n"); -- cgit v1.2.3