Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package re for openSUSE:Factory checked in at 2026-07-23 23:10:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/re (Old) and /work/SRC/openSUSE:Factory/.re.new.2004 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "re" Thu Jul 23 23:10:53 2026 rev:23 rq:1367294 version:4.10.0 Changes: -------- --- /work/SRC/openSUSE:Factory/re/re.changes 2026-06-17 16:29:20.186672548 +0200 +++ /work/SRC/openSUSE:Factory/.re.new.2004/re.changes 2026-07-23 23:14:14.712499308 +0200 @@ -1,0 +2,6 @@ +Wed Jul 22 14:43:36 UTC 2026 - Martin Hauke <[email protected]> + +- Update to version 4.10.0 + * http: uri decode and encode. + +------------------------------------------------------------------- Old: ---- re-4.9.0.tar.gz New: ---- re-4.10.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ re.spec ++++++ --- /var/tmp/diff_new_pack.Sk8TyJ/_old 2026-07-23 23:14:15.236517735 +0200 +++ /var/tmp/diff_new_pack.Sk8TyJ/_new 2026-07-23 23:14:15.240517876 +0200 @@ -17,10 +17,10 @@ # -%global sover 43 +%global sover 44 %global libname lib%{name}%{sover} Name: re -Version: 4.9.0 +Version: 4.10.0 Release: 0 Summary: Library for real-time communications with async I/O support License: BSD-3-Clause ++++++ re-4.9.0.tar.gz -> re-4.10.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/abi.yml new/re-4.10.0/.github/workflows/abi.yml --- old/re-4.9.0/.github/workflows/abi.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/abi.yml 2026-07-22 11:43:10.000000000 +0200 @@ -13,12 +13,12 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 with: ref: 'v4.6.0' path: old - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 with: path: current diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/android.yml new/re-4.10.0/.github/workflows/android.yml --- old/re-4.9.0/.github/workflows/android.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/android.yml 2026-07-22 11:43:10.000000000 +0200 @@ -19,7 +19,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Enable KVM run: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/build.yml new/re-4.10.0/.github/workflows/build.yml --- old/re-4.9.0/.github/workflows/build.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/build.yml 2026-07-22 11:43:10.000000000 +0200 @@ -33,11 +33,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 - - - name: Set Xcode version - if: ${{ runner.os == 'macOS' }} - run: sudo xcode-select -s /Applications/Xcode_16.2.app + - uses: actions/checkout@v7 - name: openssl path macos if: ${{ runner.os == 'macOS' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/clang-analyze.yml new/re-4.10.0/.github/workflows/clang-analyze.yml --- old/re-4.9.0/.github/workflows/clang-analyze.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/clang-analyze.yml 2026-07-22 11:43:10.000000000 +0200 @@ -13,7 +13,7 @@ runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/cmake_win.yml new/re-4.10.0/.github/workflows/cmake_win.yml --- old/re-4.9.0/.github/workflows/cmake_win.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/cmake_win.yml 2026-07-22 11:43:10.000000000 +0200 @@ -51,7 +51,7 @@ } steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Install OpenSSL if: ${{ matrix.config.openssl }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/codeql.yml new/re-4.10.0/.github/workflows/codeql.yml --- old/re-4.9.0/.github/workflows/codeql.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/codeql.yml 2026-07-22 11:43:10.000000000 +0200 @@ -18,7 +18,7 @@ steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v7 - name: Initialize CodeQL uses: github/codeql-action/init@v4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/coverage.yml new/re-4.10.0/.github/workflows/coverage.yml --- old/re-4.9.0/.github/workflows/coverage.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/coverage.yml 2026-07-22 11:43:10.000000000 +0200 @@ -16,7 +16,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/coverity.yml new/re-4.10.0/.github/workflows/coverity.yml --- old/re-4.9.0/.github/workflows/coverity.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/coverity.yml 2026-07-22 11:43:10.000000000 +0200 @@ -13,7 +13,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Prepare run: cmake -B ${{github.workspace}}/build - uses: vapier/coverity-scan-action@v1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/fedora.yml new/re-4.10.0/.github/workflows/fedora.yml --- old/re-4.9.0/.github/workflows/fedora.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/fedora.yml 2026-07-22 11:43:10.000000000 +0200 @@ -23,7 +23,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: install devel tools run: | yum -y install gcc clang cmake make openssl-devel zlib-devel ninja-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/freebsd.yml new/re-4.10.0/.github/workflows/freebsd.yml --- old/re-4.9.0/.github/workflows/freebsd.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/freebsd.yml 2026-07-22 11:43:10.000000000 +0200 @@ -17,7 +17,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Test in FreeBSD id: test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/ios.yml new/re-4.10.0/.github/workflows/ios.yml --- old/re-4.9.0/.github/workflows/ios.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/ios.yml 2026-07-22 11:43:10.000000000 +0200 @@ -13,7 +13,7 @@ runs-on: macos-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: build Xcode run: | diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/lint.yml new/re-4.10.0/.github/workflows/lint.yml --- old/re-4.9.0/.github/workflows/lint.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/lint.yml 2026-07-22 11:43:10.000000000 +0200 @@ -14,7 +14,7 @@ runs-on: ubuntu-latest steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: ccheck run: | wget "https://raw.githubusercontent.com/baresip/baresip/main/test/ccheck.py" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/mingw.yml new/re-4.10.0/.github/workflows/mingw.yml --- old/re-4.9.0/.github/workflows/mingw.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/mingw.yml 2026-07-22 11:43:10.000000000 +0200 @@ -26,7 +26,7 @@ run: | sudo apt-get update && sudo apt-get install -y mingw-w64 ninja-build - - uses: actions/checkout@v5 # needed for pr checkout + - uses: actions/checkout@v7 # needed for pr checkout - uses: sreimers/[email protected] with: @@ -34,7 +34,7 @@ repo: https://github.com/baresip/baresip-win32 secret: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 with: path: baresip-win32/re @@ -67,7 +67,7 @@ needs: MinGW-w64-build steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: actions/download-artifact@v4 - uses: sreimers/[email protected] with: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/musl.yml new/re-4.10.0/.github/workflows/musl.yml --- old/re-4.9.0/.github/workflows/musl.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/musl.yml 2026-07-22 11:43:10.000000000 +0200 @@ -17,7 +17,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: install devel tools run: | apk add musl-dev git cmake gcc g++ make binutils openssl-dev linux-headers zlib-dev ninja diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/run-on-arch.yml new/re-4.10.0/.github/workflows/run-on-arch.yml --- old/re-4.9.0/.github/workflows/run-on-arch.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/run-on-arch.yml 2026-07-22 11:43:10.000000000 +0200 @@ -21,7 +21,7 @@ distro: ubuntu22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: uraimo/run-on-arch-action@v3 name: Build artifact diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/sanitizers.yml new/re-4.10.0/.github/workflows/sanitizers.yml --- old/re-4.9.0/.github/workflows/sanitizers.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/sanitizers.yml 2026-07-22 11:43:10.000000000 +0200 @@ -25,7 +25,7 @@ ASAN_OPTIONS: fast_unwind_on_malloc=0 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/sonar.yml new/re-4.10.0/.github/workflows/sonar.yml --- old/re-4.9.0/.github/workflows/sonar.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/sonar.yml 2026-07-22 11:43:10.000000000 +0200 @@ -14,7 +14,7 @@ SONAR_SERVER_URL: "https://sonarcloud.io" BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - name: Set up JDK 17 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/ssl.yml new/re-4.10.0/.github/workflows/ssl.yml --- old/re-4.9.0/.github/workflows/ssl.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/ssl.yml 2026-07-22 11:43:10.000000000 +0200 @@ -21,7 +21,7 @@ OPENSSL_ROOT_DIR: "assets/${{ matrix.ssl }}" steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/strict-c.yml new/re-4.10.0/.github/workflows/strict-c.yml --- old/re-4.9.0/.github/workflows/strict-c.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/strict-c.yml 2026-07-22 11:43:10.000000000 +0200 @@ -16,7 +16,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/.github/workflows/valgrind.yml new/re-4.10.0/.github/workflows/valgrind.yml --- old/re-4.9.0/.github/workflows/valgrind.yml 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/.github/workflows/valgrind.yml 2026-07-22 11:43:10.000000000 +0200 @@ -16,7 +16,7 @@ CMAKE_GENERATOR: Ninja steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: fix flaky azure mirrors if: ${{ runner.os == 'Linux' }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/CHANGELOG.md new/re-4.10.0/CHANGELOG.md --- old/re-4.9.0/CHANGELOG.md 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/CHANGELOG.md 2026-07-22 11:43:10.000000000 +0200 @@ -5,6 +5,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## v4.10.0 - 2026-07-22 + +### What's Changed +* http: uri decode and encode by @cspiel1 in https://github.com/baresip/re/pull/1582 +* ci: bump actions/checkout v7 by @sreimers in https://github.com/baresip/re/pull/1596 + +**Full Changelog**: https://github.com/baresip/re/compare/v4.9.0...v4.10.0 + + ## v4.9.0 - 2026-06-17 ### What's Changed @@ -20,6 +29,7 @@ **Full Changelog**: https://github.com/baresip/re/compare/v4.8.1...v4.9.0 + ## v4.8.1 - 2026-05-28 Security and Bugfix Release ### What's Changed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/CMakeLists.txt new/re-4.10.0/CMakeLists.txt --- old/re-4.9.0/CMakeLists.txt 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/CMakeLists.txt 2026-07-22 11:43:10.000000000 +0200 @@ -14,13 +14,13 @@ cmake_minimum_required(VERSION 3.18...4.0) project(re - VERSION 4.9.0 + VERSION 4.10.0 LANGUAGES C HOMEPAGE_URL https://github.com/baresip/re DESCRIPTION "Generic library for real-time communications" ) -set(PROJECT_SOVERSION 43) # bump if ABI breaks +set(PROJECT_SOVERSION 44) # bump if ABI breaks # Pre-release identifier, comment out on a release # Increment for breaking changes (dev2, dev3...) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/include/re_http.h new/re-4.10.0/include/re_http.h --- old/re-4.9.0/include/re_http.h 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/include/re_http.h 2026-07-22 11:43:10.000000000 +0200 @@ -92,12 +92,15 @@ struct http_uri { struct pl scheme; - struct pl host; - struct pl port; + struct pl user; /**< Optional username */ + struct pl host; /**< Hostname or IP-address */ + int af; /**< Address family of host IP-address */ + uint16_t port; struct pl path; }; int http_uri_decode(struct http_uri *hu, const struct pl *uri); +int http_uri_encode(struct re_printf *pf, const struct http_uri *hu); /** Http Client configuration */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/mk/Doxyfile new/re-4.10.0/mk/Doxyfile --- old/re-4.9.0/mk/Doxyfile 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/mk/Doxyfile 2026-07-22 11:43:10.000000000 +0200 @@ -4,7 +4,7 @@ # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = libre -PROJECT_NUMBER = 4.9.0 +PROJECT_NUMBER = 4.10.0 OUTPUT_DIRECTORY = ../re-dox CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/src/http/client.c new/re-4.10.0/src/http/client.c --- old/re-4.9.0/src/http/client.c 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/src/http/client.c 2026-07-22 11:43:10.000000000 +0200 @@ -19,6 +19,7 @@ #include <re_tls.h> #include <re_dns.h> #include <re_msg.h> +#include <re_uri.h> #include <re_http.h> #include <re_sys.h> #include "http.h" @@ -727,27 +728,82 @@ int http_uri_decode(struct http_uri *hu, const struct pl *uri) { - int err = 0; - if (!hu) + struct pl hostport = PL_INIT; + struct pl port = PL_INIT; + int err; + + if (!hu || !uri) return EINVAL; memset(hu, 0, sizeof(*hu)); - /* Try IPv6 first */ - err = re_regex(uri->p, uri->l, "[a-z]+://\\[[^\\]]+\\][:]*[0-9]*[^]+", - &hu->scheme, &hu->host, NULL, &hu->port, &hu->path) || - hu->scheme.p != uri->p; + /* Try with auth (user[:password]@hostport) */ + err = re_regex(uri->p, uri->l, + "[a-z]+://[^:@/]+[:]*[^@/]*@[^/]+[^]*", + &hu->scheme, &hu->user, NULL, NULL, + &hostport, &hu->path); if (!err) goto out; - /* Then non-IPv6 host */ - err = re_regex(uri->p, uri->l, "[a-z]+://[^:/]+[:]*[0-9]*[^]+", - &hu->scheme, &hu->host, NULL, &hu->port, &hu->path) || - hu->scheme.p != uri->p; + /* Without auth */ + memset(hu, 0, sizeof(*hu)); + err = re_regex(uri->p, uri->l, "[a-z]+://[^/]+[^]*", + &hu->scheme, &hostport, &hu->path); out: - if (!err && !pl_isset(&hu->path)) - pl_set_str(&hu->path, "/"); + err |= (hu->scheme.p == uri->p ? 0 : EINVAL); + err |= uri_decode_hostport(&hostport, &hu->host, &port); + if (!err) { + if (!pl_isset(&hu->path)) + pl_set_str(&hu->path, "/"); + + struct sa addr; + if (0 == sa_set(&addr, &hu->host, 0)) + hu->af = sa_af(&addr); + else + hu->af = AF_UNSPEC; + + hu->port = (uint16_t)pl_u32(&port); + } + + return err; +} + + +int http_uri_encode(struct re_printf *pf, const struct http_uri *hu) +{ + int err; + + if (!pf || !hu) + return EINVAL; + + if (!pl_isset(&hu->scheme) || !pl_isset(&hu->host)) + return EINVAL; + + err = re_hprintf(pf, "%r://", &hu->scheme); + if (err) + return err; + + if (pl_isset(&hu->user)) { + err = re_hprintf(pf, "%r@", &hu->user); + if (err) + return err; + } + + /* IPv6 address is delimited by '[' and ']' */ + if (hu->af == AF_INET6) + err = re_hprintf(pf, "[%r]", &hu->host); + else + err = re_hprintf(pf, "%r", &hu->host); + + if (err) + return err; + + if (hu->port) + err = re_hprintf(pf, ":%u", hu->port); + + if (pl_isset(&hu->path)) + err |= re_hprintf(pf, "%r", &hu->path); return err; } @@ -800,8 +856,7 @@ req->cli = cli; req->secure = secure; req->port = (addr && sa_port(addr)) ? sa_port(addr) : - (pl_isset(&http_uri.port) ? pl_u32(&http_uri.port) : - defport); + (http_uri.port ? http_uri.port : defport); req->resph = resph; req->datah = datah; req->bodyh = bodyh; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/src/http/request.c new/re-4.10.0/src/http/request.c --- old/re-4.9.0/src/http/request.c 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/src/http/request.c 2026-07-22 11:43:10.000000000 +0200 @@ -636,10 +636,8 @@ return EINVAL; err = http_uri_decode(&hu, uri); - if (err) { - DEBUG_WARNING("http uri %r decode error (%m)\n", uri, err); + if (err) return EINVAL; - } conn->uri = mem_deref(conn->uri); conn->path = mem_deref(conn->path); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/test/http.c new/re-4.10.0/test/http.c --- old/re-4.9.0/test/http.c 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/test/http.c 2026-07-22 11:43:10.000000000 +0200 @@ -960,3 +960,156 @@ return test_http_request_addr_base(true); } #endif + + +int test_http_uri_decode(void) +{ + static const struct { + const char *uri; + const char *scheme; + const char *user; + const char *host; + uint16_t port; + const char *path; + int af; + } testv[] = { + { + "http://host/path", + "http", NULL, "host", 0, "/path", AF_UNSPEC + }, + { + "https://host:8080/path", + "https", NULL, "host", 8080, "/path", AF_UNSPEC + }, + { + "http://user@host/path", + "http", "user", "host", 0, "/path", AF_UNSPEC + }, + { + "http://user@host:8080/path", + "http", "user", "host", 8080, "/path", AF_UNSPEC + }, + { + "http://[::1]/path", + "http", NULL, "::1", 0, "/path", AF_INET6 + }, + { + "http://[::1]:8080/path", + "http", NULL, "::1", 8080, "/path", AF_INET6 + }, + { + "http://user@[::1]:8080/path", + "http", "user", "::1", 8080, "/path", AF_INET6 + }, + { + "http://host", + "http", NULL, "host", 0, "/", AF_UNSPEC + }, + { + "http://127.0.0.1:38073/index.html", + "http", NULL, "127.0.0.1", 38073, "/index.html", + AF_INET + }, + + }; + + struct mbuf mb; + int err = 0; + size_t i; + + mbuf_init(&mb); + + for (i = 0; i < RE_ARRAY_SIZE(testv); i++) { + struct http_uri hu; + struct pl pl; + + /* Decode */ + pl_set_str(&pl, testv[i].uri); + err = http_uri_decode(&hu, &pl); + TEST_ERR(err); + + TEST_STRCMP(testv[i].scheme, strlen(testv[i].scheme), + hu.scheme.p, hu.scheme.l); + + if (testv[i].user) { + TEST_STRCMP(testv[i].user, strlen(testv[i].user), + hu.user.p, hu.user.l); + } + else { + TEST_ASSERT(!pl_isset(&hu.user)); + } + + TEST_STRCMP(testv[i].host, strlen(testv[i].host), + hu.host.p, hu.host.l); + + TEST_EQUALS(testv[i].port, hu.port); + + TEST_STRCMP(testv[i].path, strlen(testv[i].path), + hu.path.p, hu.path.l); + + TEST_EQUALS(testv[i].af, hu.af); + } + +out: + mbuf_reset(&mb); + return err; +} + + +int test_http_uri_encode(void) +{ + static const struct { + struct http_uri hu; + const char *enc; + } testv[] = { + { + {PL("http"), PL_INIT, + PL("host"), AF_UNSPEC, 8080, PL("/path")}, + "http://host:8080/path" + }, + { + {PL("https"), PL("user"), + PL("host"), AF_UNSPEC, 8080, PL("/path")}, + "https://user@host:8080/path" + }, + { + {PL("http"), PL_INIT, + PL("::1"), AF_INET6, 8080, PL("/path")}, + "http://[::1]:8080/path" + }, + { + {PL("http"), PL("user"), + PL("::1"), AF_INET6, 8080, PL("/path")}, + "http://user@[::1]:8080/path" + }, + }; + + struct mbuf mb; + int err = 0; + size_t i; + + mbuf_init(&mb); + + for (i = 0; i < RE_ARRAY_SIZE(testv); i++) { + struct pl pl; + + mb.pos = 0; + mb.end = 0; + err = mbuf_printf(&mb, "%H", http_uri_encode, &testv[i].hu); + if (err) + goto out; + + pl.p = (const char *)mb.buf; + pl.l = mb.end; + err = pl_strcmp(&pl, testv[i].enc); + if (err) { + DEBUG_WARNING("http uri encode: ref=(%s)," + " gen=(%r)\n", testv[i].enc, &pl); + goto out; + } + } + +out: + mbuf_reset(&mb); + return err; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/test/test.c new/re-4.10.0/test/test.c --- old/re-4.9.0/test/test.c 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/test/test.c 2026-07-22 11:43:10.000000000 +0200 @@ -123,6 +123,8 @@ TEST(test_http_large_body), TEST(test_http_loop), TEST(test_http_request_addr), + TEST(test_http_uri_decode), + TEST(test_http_uri_encode), #ifdef USE_TLS TEST(test_https_request_addr), #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/re-4.9.0/test/test.h new/re-4.10.0/test/test.h --- old/re-4.9.0/test/test.h 2026-06-17 08:22:18.000000000 +0200 +++ new/re-4.10.0/test/test.h 2026-07-22 11:43:10.000000000 +0200 @@ -229,6 +229,8 @@ int test_dns_http_integration(void); int test_dns_cache_http_integration(void); int test_http_request_addr(void); +int test_http_uri_decode(void); +int test_http_uri_encode(void); #ifdef USE_TLS int test_https_request_addr(void); #endif
