Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ulfius for openSUSE:Factory checked in at 2021-11-02 19:19:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ulfius (Old) and /work/SRC/openSUSE:Factory/.ulfius.new.1890 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ulfius" Tue Nov 2 19:19:01 2021 rev:22 rq:928753 version:2.7.5 Changes: -------- --- /work/SRC/openSUSE:Factory/ulfius/ulfius.changes 2021-09-08 21:37:08.801925705 +0200 +++ /work/SRC/openSUSE:Factory/.ulfius.new.1890/ulfius.changes 2021-11-02 19:19:45.351111174 +0100 @@ -1,0 +2,9 @@ +Wed Oct 27 19:20:38 UTC 2021 - Martin Hauke <mar...@gmx.de> + +- Update to version 2.7.5 + * Fix cookie management in ulfius_send_http_request and + ulfius_send_http_streaming_request + * Add option U_OPT_AUTH_BASIC to ulfius_set_request_properties + * Fix bug in static_compressed_inmemory_website callback example + +------------------------------------------------------------------- Old: ---- ulfius-2.7.4.tar.gz New: ---- ulfius-2.7.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ulfius.spec ++++++ --- /var/tmp/diff_new_pack.EY7aJG/_old 2021-11-02 19:19:45.755111484 +0100 +++ /var/tmp/diff_new_pack.EY7aJG/_new 2021-11-02 19:19:45.759111487 +0100 @@ -20,7 +20,7 @@ %define _lto_cflags %{nil} %define sover 2_7 Name: ulfius -Version: 2.7.4 +Version: 2.7.5 Release: 0 Summary: Web Framework for REST Applications in C License: MIT ++++++ ulfius-2.7.4.tar.gz -> ulfius-2.7.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/CHANGELOG.md new/ulfius-2.7.5/CHANGELOG.md --- old/ulfius-2.7.4/CHANGELOG.md 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/CHANGELOG.md 2021-10-26 23:17:22.000000000 +0200 @@ -1,5 +1,11 @@ # Ulfius Changelog +## 2.7.5 + +- Fix cookie management in `ulfius_send_http_request` and `ulfius_send_http_streaming_request` +- Add option `U_OPT_AUTH_BASIC` to `ulfius_set_request_properties` +- Fix bug in static_compressed_inmemory_website callback example + ## 2.7.4 - Add `void` parameter to functions with no param diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/CMakeLists.txt new/ulfius-2.7.5/CMakeLists.txt --- old/ulfius-2.7.4/CMakeLists.txt 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/CMakeLists.txt 2021-10-26 23:17:22.000000000 +0200 @@ -30,7 +30,7 @@ set(PROJECT_BUGREPORT_PATH "https://github.com/babelouest/ulfius/issues") set(LIBRARY_VERSION_MAJOR "2") set(LIBRARY_VERSION_MINOR "7") -set(LIBRARY_VERSION_PATCH "4") +set(LIBRARY_VERSION_PATCH "5") set(PROJECT_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}") set(PROJECT_VERSION_MAJOR ${LIBRARY_VERSION_MAJOR}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.c new/ulfius-2.7.5/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.c --- old/ulfius-2.7.4/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.c 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.c 2021-10-26 23:17:22.000000000 +0200 @@ -4,7 +4,7 @@ * * Copyright 2020-2021 Nicolas Mora <m...@babelouest.org> * - * Version 20210906 + * Version 20211026 * * The MIT License (MIT) * @@ -166,9 +166,6 @@ file_requested = o_strdup(request->http_url); url_dup_save = file_requested; - while (file_requested[0] == '/') { - file_requested++; - } file_requested += o_strlen(((struct _u_compressed_inmemory_website_config *)user_data)->url_prefix); while (file_requested[0] == '/') { file_requested++; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.h new/ulfius-2.7.5/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.h --- old/ulfius-2.7.4/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.h 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/example_callbacks/static_compressed_inmemory_website/static_compressed_inmemory_website_callback.h 2021-10-26 23:17:22.000000000 +0200 @@ -4,7 +4,7 @@ * * Copyright 2020-2021 Nicolas Mora <m...@babelouest.org> * - * Version 20210906 + * Version 20211026 * * The MIT License (MIT) * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/include/ulfius.h new/ulfius-2.7.5/include/ulfius.h --- old/ulfius-2.7.4/include/ulfius.h 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/include/ulfius.h 2021-10-26 23:17:22.000000000 +0200 @@ -154,28 +154,29 @@ U_OPT_TIMEOUT = 11, ///< connection timeout used by ulfius_send_http_request, default is 0 _or_ Timeout in seconds to close the connection because of inactivity between the client and the server, expected option value type: unsigned long U_OPT_AUTH_BASIC_USER = 12, ///< basic authentication username, expected option value type: const char * U_OPT_AUTH_BASIC_PASSWORD = 13, ///< basic authentication password, expected option value type: const char * - U_OPT_URL_PARAMETER = 14, ///< Add to the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char *, const char * - U_OPT_HEADER_PARAMETER = 15, ///< Add to the map containing the header variables, expected option value type: const char *, const char * - U_OPT_COOKIE_PARAMETER = 16, ///< Add to the map containing the cookie variables, expected option value type: const char *, const char * - U_OPT_POST_BODY_PARAMETER = 17, ///< Add to the map containing the post body variables (if available), expected option value type: const char *, const char * - U_OPT_URL_PARAMETER_REMOVE = 18, ///< Remove from the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char * - U_OPT_HEADER_PARAMETER_REMOVE = 19, ///< Remove from map containing the header variables, expected option value type: const char * - U_OPT_COOKIE_PARAMETER_REMOVE = 20, ///< Remove from map containing the cookie variables, expected option value type: const char * - U_OPT_POST_BODY_PARAMETER_REMOVE = 21, ///< Remove from map containing the post body variables (if available), expected option value type: const char * - U_OPT_BINARY_BODY = 22, ///< Set a raw body to the request or the reponse, expected option value type: const char *, size_t - U_OPT_STRING_BODY = 23, ///< Set a char * body to the request or the reponse, expected option value type: const char * + U_OPT_AUTH_BASIC = 14, ///< basic authentication user, then password, expected option value type: const char *, const char * + U_OPT_URL_PARAMETER = 15, ///< Add to the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char *, const char * + U_OPT_HEADER_PARAMETER = 16, ///< Add to the map containing the header variables, expected option value type: const char *, const char * + U_OPT_COOKIE_PARAMETER = 17, ///< Add to the map containing the cookie variables, expected option value type: const char *, const char * + U_OPT_POST_BODY_PARAMETER = 18, ///< Add to the map containing the post body variables (if available), expected option value type: const char *, const char * + U_OPT_URL_PARAMETER_REMOVE = 19, ///< Remove from the map containing the url variables, both from the route and the ?key=value variables, expected option value type: const char * + U_OPT_HEADER_PARAMETER_REMOVE = 20, ///< Remove from map containing the header variables, expected option value type: const char * + U_OPT_COOKIE_PARAMETER_REMOVE = 21, ///< Remove from map containing the cookie variables, expected option value type: const char * + U_OPT_POST_BODY_PARAMETER_REMOVE = 22, ///< Remove from map containing the post body variables (if available), expected option value type: const char * + U_OPT_BINARY_BODY = 23, ///< Set a raw body to the request or the reponse, expected option value type: const char *, size_t + U_OPT_STRING_BODY = 24, ///< Set a char * body to the request or the reponse, expected option value type: const char * #ifndef U_DISABLE_JANSSON - U_OPT_JSON_BODY = 24, ///< Set a stringified json_t * body to the request or the reponse, expected option value type: json_t * + U_OPT_JSON_BODY = 25, ///< Set a stringified json_t * body to the request or the reponse, expected option value type: json_t * #endif #ifndef U_DISABLE_GNUTLS - U_OPT_CLIENT_CERT_FILE = 25, ///< path to client certificate file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char * - U_OPT_CLIENT_KEY_FILE = 26, ///< path to client key file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char * - U_OPT_CLIENT_KEY_PASSWORD = 27, ///< password to unlock client key file, available only if GnuTLS support is enabled, expected option value type: const char * + U_OPT_CLIENT_CERT_FILE = 26, ///< path to client certificate file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char * + U_OPT_CLIENT_KEY_FILE = 27, ///< path to client key file for sending http requests with certificate authentication, available only if GnuTLS support is enabled, expected option value type: const char * + U_OPT_CLIENT_KEY_PASSWORD = 28, ///< password to unlock client key file, available only if GnuTLS support is enabled, expected option value type: const char * #endif - U_OPT_STATUS = 28, ///< HTTP response status code (200, 404, 500, etc), expected option value type: long - U_OPT_AUTH_REALM = 29, ///< realm to send to the client response on authenticationb failed, expected option value type: const char * - U_OPT_SHARED_DATA = 30, ///< any data shared between callback functions, must be allocated and freed by the callback functions, expected option value type: void * - U_OPT_HTTP_URL_APPEND = 31 ///< append char * value to the current url, expected option value type: const char * + U_OPT_STATUS = 29, ///< HTTP response status code (200, 404, 500, etc), expected option value type: long + U_OPT_AUTH_REALM = 30, ///< realm to send to the client response on authenticationb failed, expected option value type: const char * + U_OPT_SHARED_DATA = 31, ///< any data shared between callback functions, must be allocated and freed by the callback functions, expected option value type: void * + U_OPT_HTTP_URL_APPEND = 32 ///< append char * value to the current url, expected option value type: const char * } u_option; /** diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/src/Makefile new/ulfius-2.7.5/src/Makefile --- old/ulfius-2.7.4/src/Makefile 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/src/Makefile 2021-10-26 23:17:22.000000000 +0200 @@ -43,7 +43,7 @@ OUTPUT=libulfius.so VERSION_MAJOR=2 VERSION_MINOR=7 -VERSION_PATCH=4 +VERSION_PATCH=5 ifndef JANSSONFLAG DISABLE_JANSSON=0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/src/u_request.c new/ulfius-2.7.5/src/u_request.c --- old/ulfius-2.7.4/src/u_request.c 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/src/u_request.c 2021-10-26 23:17:22.000000000 +0200 @@ -621,6 +621,22 @@ request->auth_basic_password = NULL; } break; + case U_OPT_AUTH_BASIC: + str_value = va_arg(vl, const char *); + o_free(request->auth_basic_user); + if (o_strlen(str_value)) { + request->auth_basic_user = o_strdup(str_value); + } else { + request->auth_basic_user = NULL; + } + str_value = va_arg(vl, const char *); + o_free(request->auth_basic_password); + if (o_strlen(str_value)) { + request->auth_basic_password = o_strdup(str_value); + } else { + request->auth_basic_password = NULL; + } + break; case U_OPT_URL_PARAMETER: str_key = va_arg(vl, const char *); str_value = va_arg(vl, const char *); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/src/u_send_request.c new/ulfius-2.7.5/src/u_send_request.c --- old/ulfius-2.7.4/src/u_send_request.c 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/src/u_send_request.c 2021-10-26 23:17:22.000000000 +0200 @@ -195,7 +195,7 @@ CURLcode res; CURL * curl_handle = NULL; struct curl_slist * header_list = NULL, * cookies_list = NULL; - char * key_esc = NULL, * value_esc = NULL, * cookie = NULL, * header = NULL, * fp = "?", * np = "&"; + char * key_esc = NULL, * value_esc = NULL, * cookie = NULL, * cookies = NULL, * header = NULL, * fp = "?", * np = "&"; const char * value = NULL, ** keys = NULL; int i, has_params = 0, ret, exit_loop; struct _u_request * copy_request = NULL; @@ -459,20 +459,21 @@ value = u_map_get(copy_request->map_cookie, keys[i]); if (value != NULL) { cookie = msprintf("%s=%s", keys[i], value); - if (curl_easy_setopt(curl_handle, CURLOPT_COOKIE, cookie) != CURLE_OK) { - y_log_message(Y_LOG_LEVEL_ERROR, "Ulfius - Error setting cookie %s", cookie); - exit_loop = 1; - } - o_free(cookie); } else { cookie = msprintf("%s:", keys[i]); - if (curl_easy_setopt(curl_handle, CURLOPT_COOKIE, cookie) != CURLE_OK) { - y_log_message(Y_LOG_LEVEL_ERROR, "Ulfius - Error setting cookie %s", cookie); - exit_loop = 1; - } - o_free(cookie); } + if (cookies == NULL) { + cookies = o_strdup(cookie); + } else { + cookies = mstrcatf(cookies, ";%s", cookie); + } + o_free(cookie); + } + if (curl_easy_setopt(curl_handle, CURLOPT_COOKIE, cookies) != CURLE_OK) { + y_log_message(Y_LOG_LEVEL_ERROR, "Ulfius - Error setting cookie %s", cookie); + exit_loop = 1; } + o_free(cookies); if (exit_loop) { ret = U_ERROR_LIBCURL; break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ulfius-2.7.4/test/core.c new/ulfius-2.7.5/test/core.c --- old/ulfius-2.7.4/test/core.c 2021-09-06 23:34:10.000000000 +0200 +++ new/ulfius-2.7.5/test/core.c 2021-10-26 23:17:22.000000000 +0200 @@ -472,7 +472,15 @@ ck_assert_str_eq(req.client_key_password, CLIENT_KEY_PASSWORD); #endif + ck_assert_int_eq(ulfius_set_request_properties(&req, U_OPT_AUTH_BASIC, NULL, NULL, U_OPT_NONE), U_OK); + ck_assert_ptr_eq(req.auth_basic_user, NULL); + ck_assert_ptr_eq(req.auth_basic_password, NULL); + ck_assert_int_eq(ulfius_set_request_properties(&req, U_OPT_AUTH_BASIC, AUTH_BASIC_USER, AUTH_BASIC_PASSWORD, U_OPT_NONE), U_OK); + ck_assert_str_eq(req.auth_basic_user, AUTH_BASIC_USER); + ck_assert_str_eq(req.auth_basic_password, AUTH_BASIC_PASSWORD); + ulfius_clean_request(&req); + } END_TEST