Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libsoup for openSUSE:Factory checked in at 2022-10-18 12:44:26 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsoup (Old) and /work/SRC/openSUSE:Factory/.libsoup.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libsoup" Tue Oct 18 12:44:26 2022 rev:138 rq:1012086 version:3.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libsoup/libsoup.changes 2022-09-21 14:41:40.389628612 +0200 +++ /work/SRC/openSUSE:Factory/.libsoup.new.2275/libsoup.changes 2022-10-18 12:44:41.973682710 +0200 @@ -1,0 +2,13 @@ +Wed Oct 12 09:29:29 UTC 2022 - Bj??rn Lie <bjorn....@gmail.com> + +- Update to version 3.2.1: + + When built against nghttp2 1.50.0+ be relaxed about header + whitespace. + + Fix possible crash when cancelling an HTTP/2 message. + + Fix regresion where soup_server_message_get_socket() could + return NULL. + + Fix minor memory leak. +- Disable tests on 32-bit while waiting for + https://gitlab.gnome.org/GNOME/libsoup/-/issues/309 + +------------------------------------------------------------------- Old: ---- libsoup-3.2.0.tar.xz New: ---- libsoup-3.2.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsoup.spec ++++++ --- /var/tmp/diff_new_pack.i8HPXO/_old 2022-10-18 12:44:42.497683903 +0200 +++ /var/tmp/diff_new_pack.i8HPXO/_new 2022-10-18 12:44:42.501683912 +0200 @@ -18,7 +18,7 @@ %define api_version 3.0 Name: libsoup -Version: 3.2.0 +Version: 3.2.1 Release: 0 Summary: HTTP client/server library for GNOME License: LGPL-2.1-or-later @@ -138,9 +138,13 @@ mv %{buildroot}%{_datadir}/doc/%{name}-%{api_version} %{buildroot}%{_docdir} %check +# Disable tests on 32-bit while waiting for +# https://gitlab.gnome.org/GNOME/libsoup/-/issues/309 +%ifnarch %ix86 %arm32 ppc # Run the regression tests using GnuTLS NORMAL priority export G_TLS_GNUTLS_PRIORITY=NORMAL %meson_test +%endif %ldconfig_scriptlets 3_0-0 ++++++ libsoup-3.2.0.tar.xz -> libsoup-3.2.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/.gitlab-ci/Dockerfile new/libsoup-3.2.1/.gitlab-ci/Dockerfile --- old/libsoup-3.2.0/.gitlab-ci/Dockerfile 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/.gitlab-ci/Dockerfile 2022-10-11 20:11:57.000000000 +0200 @@ -29,7 +29,7 @@ vala \ valgrind \ which \ - && dnf builddep -y glib2 vala \ + && dnf builddep -y glib2 nghttp2 vala \ && dnf clean all \ && python2.7 -m ensurepip \ && pip2.7 install virtualenv autobahntestsuite \ @@ -71,6 +71,16 @@ && popd \ && rm -rf libsoup +# Update libnghttp2 for do_invalid_header_rfc9113_received_test() +RUN git clone https://github.com/nghttp2/nghttp2.git \ + && pushd nghttp2 \ + && git checkout v1.50.0 \ + && autoreconf --install --symlink \ + && ./configure --prefix=/usr --disable-static --disable-examples \ + && make -j $(nproc) install \ + && popd \ + && rm -rf nghttp2 + ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} RUN useradd -u $HOST_USER_ID -ms /bin/bash user diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/.gitlab-ci/run-docker.sh new/libsoup-3.2.1/.gitlab-ci/run-docker.sh --- old/libsoup-3.2.0/.gitlab-ci/run-docker.sh 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/.gitlab-ci/run-docker.sh 2022-10-11 20:11:57.000000000 +0200 @@ -2,7 +2,7 @@ set -e -TAG="registry.gitlab.gnome.org/gnome/libsoup/master:v16" +TAG="registry.gitlab.gnome.org/gnome/libsoup/master:v17" SUDO_CMD="sudo" if docker -v |& grep -q podman; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/.gitlab-ci.yml new/libsoup-3.2.1/.gitlab-ci.yml --- old/libsoup-3.2.0/.gitlab-ci.yml 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/.gitlab-ci.yml 2022-10-11 20:11:57.000000000 +0200 @@ -1,4 +1,4 @@ -image: registry.gitlab.gnome.org/gnome/libsoup/master:v16 +image: registry.gitlab.gnome.org/gnome/libsoup/master:v17 stages: - build @@ -17,7 +17,7 @@ extends: .build script: - cp .gitlab-ci/lcovrc ~/.lcovrc - - meson _build -Db_coverage=true -Dauto_features=enabled + - meson _build -Db_coverage=true --auto-features=enabled - meson compile -C _build - meson test --no-suite autobahn-quick --no-suite autobahn -C _build --verbose - ninja -C _build coverage-html @@ -36,7 +36,7 @@ fedora-autobahn-quick: extends: .build script: - - meson _build -Dauto-features=enabled -Dautobahn=enabled + - meson _build --auto-features=enabled -Dautobahn=enabled - meson test -C _build --suite autobahn-quick --verbose artifacts: paths: @@ -46,7 +46,7 @@ fedora-scan: extends: .build script: - - meson _build -Dauto_features=enabled + - meson _build --auto-features=enabled - ninja -C _build scan-build - bash -c 'if [[ -n "$(ls -A _build/meson-logs/scanbuild/)" ]]; then echo "Scan build log found, assuming defects exist"; exit 1; fi' artifacts: @@ -63,7 +63,7 @@ SOUP_TEST_NO_IPV6: 1 script: # Introspection doesn't work when linking to libasan, the NTLM tests fail most likely due to unsafe usage of setenv() - - meson _build -Dauto-features=enabled -Db_sanitize=address -Dintrospection=disabled -Dvapi=disabled -Dntlm=disabled + - meson _build --auto-features=enabled -Db_sanitize=address -Dintrospection=disabled -Dvapi=disabled -Dntlm=disabled -Ddocs=disabled - meson test --no-suite autobahn-quick --no-suite autobahn -C _build --verbose --timeout-multiplier=10 artifacts: when: on_failure @@ -76,7 +76,7 @@ # variables: # CC: clang # script: -# - meson _build -Dauto-features=enabled -Dfuzzing=enabled -Dintrospection=disabled -Dvapi=disabled +# - meson _build --auto-features=enabled -Dfuzzing=enabled -Dintrospection=disabled -Dvapi=disabled # - meson test -C _build --suite=fuzzing --timeout-multiplier=10 # artifacts: # when: on_failure diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/NEWS new/libsoup-3.2.1/NEWS --- old/libsoup-3.2.0/NEWS 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/NEWS 2022-10-11 20:11:57.000000000 +0200 @@ -1,3 +1,10 @@ +Changes in libsoup from 3.2.0 to 3.2.1: + +* When built against nghttp2 1.50.0+ be relaxed about header whitespace [Carlos Garcia Campos] +* Fix possible crash when cancelling an HTTP/2 message [Carlos Garcia Campos] +* Fix regresion where soup_server_message_get_socket() could return NULL [Carlos Garcia Campos] +* Fix minor memory leak [Milan Crha] + Changes in libsoup from 3.1.4 to 3.2.0: Changes in libsoup from 3.1.3 to 3.1.4: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/http1/soup-client-message-io-http1.c new/libsoup-3.2.1/libsoup/http1/soup-client-message-io-http1.c --- old/libsoup-3.2.0/libsoup/http1/soup-client-message-io-http1.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/http1/soup-client-message-io-http1.c 2022-10-11 20:11:57.000000000 +0200 @@ -860,9 +860,12 @@ soup_client_message_io_http1_get_priority (client_io)); g_source_attach (io->io_source, g_main_context_get_thread_default ()); } else { - if ((SoupClientMessageIOHTTP1 *)soup_message_get_io_data (msg) == client_io) - soup_message_io_finish (msg, error); - g_error_free (error); + if ((SoupClientMessageIOHTTP1 *)soup_message_get_io_data (msg) == client_io) { + g_assert (!client_io->msg_io->item->error); + client_io->msg_io->item->error = g_steal_pointer (&error); + soup_message_io_finish (msg, client_io->msg_io->item->error); + } + g_clear_error (&error); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/http2/soup-client-message-io-http2.c new/libsoup-3.2.1/libsoup/http2/soup-client-message-io-http2.c --- old/libsoup-3.2.0/libsoup/http2/soup-client-message-io-http2.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/http2/soup-client-message-io-http2.c 2022-10-11 20:11:57.000000000 +0200 @@ -545,6 +545,22 @@ return 0; } +static int +on_invalid_header_callback (nghttp2_session *session, + const nghttp2_frame *frame, + const uint8_t *name, + size_t namelen, + const uint8_t *value, + size_t valuelen, + uint8_t flags, + void *user_data) +{ + SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, frame->hd.stream_id); + + h2_debug (user_data, data, "[HEADERS] Invalid header received: name=[%.*s] value=[%.*s]", namelen, name, valuelen, value); + return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; +} + static GError * memory_stream_need_more_data_callback (SoupBodyInputStreamHttp2 *stream, gboolean blocking, @@ -567,7 +583,7 @@ { SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, hd->stream_id); - h2_debug (user_data, data, "[RECV] [%s] Beginning", soup_http2_frame_type_to_string (hd->type)); + h2_debug (user_data, data, "[RECV] [%s] Beginning: stream_id=%u", soup_http2_frame_type_to_string (hd->type), hd->stream_id); if (!data) return 0; @@ -637,7 +653,7 @@ io->in_callback++; if (frame->hd.stream_id == 0) { - h2_debug (io, NULL, "[RECV] [%s] Received (%u)", soup_http2_frame_type_to_string (frame->hd.type), frame->hd.flags); + h2_debug (io, NULL, "[RECV] [%s] Received: stream_id=%u, flags=%u", soup_http2_frame_type_to_string (frame->hd.type), frame->hd.stream_id, frame->hd.flags); switch (frame->hd.type) { case NGHTTP2_GOAWAY: @@ -660,11 +676,10 @@ } data = nghttp2_session_get_stream_user_data (session, frame->hd.stream_id); - h2_debug (io, data, "[RECV] [%s] Received (%u)", soup_http2_frame_type_to_string (frame->hd.type), frame->hd.flags); + h2_debug (io, data, "[RECV] [%s] Received: stream_id=%u, flags=%u", soup_http2_frame_type_to_string (frame->hd.type), frame->hd.stream_id, frame->hd.flags); if (!data) { - if (!(frame->hd.flags & NGHTTP2_FLAG_END_STREAM) && frame->hd.type != NGHTTP2_RST_STREAM) - g_warn_if_reached (); + /* This can happen in case of cancellation */ io->in_callback--; return 0; } @@ -761,12 +776,14 @@ SoupClientMessageIOHTTP2 *io = user_data; SoupHTTP2MessageData *msgdata = nghttp2_session_get_stream_user_data (session, stream_id); - if (!msgdata) - return NGHTTP2_ERR_CALLBACK_FAILURE; + h2_debug (io, msgdata, "[DATA] Received chunk, stream_id=%u len=%zu, flags=%u, paused=%d", stream_id, len, flags, msgdata ? msgdata->paused : 0); - io->in_callback++; + if (!msgdata) { + /* This can happen in case of cancellation */ + return 0; + } - h2_debug (io, msgdata, "[DATA] Received chunk, len=%zu, flags=%u, paused=%d", len, flags, msgdata->paused); + io->in_callback++; g_assert (msgdata->body_istream != NULL); soup_body_input_stream_http2_add_data (SOUP_BODY_INPUT_STREAM_HTTP2 (msgdata->body_istream), data, len); @@ -830,11 +847,16 @@ switch (frame->hd.type) { case NGHTTP2_HEADERS: - g_assert (data); - h2_debug (io, data, "[SEND] [HEADERS] category=%s finished=%d", - soup_http2_headers_category_to_string (frame->headers.cat), + h2_debug (io, data, "[SEND] [HEADERS] stream_id=%u, category=%s finished=%d", + frame->hd.stream_id, soup_http2_headers_category_to_string (frame->headers.cat), (frame->hd.flags & NGHTTP2_FLAG_END_HEADERS) ? 1 : 0); + if (!data) { + /* This can happen in case of cancellation */ + io->in_callback--; + return 0; + } + if (data->metrics) data->metrics->request_header_bytes_sent += frame->hd.length + FRAME_HEADER_SIZE; @@ -847,12 +869,17 @@ } break; case NGHTTP2_DATA: - g_assert (data); + if (!data) { + /* This can happen in case of cancellation */ + io->in_callback--; + return 0; + } + if (data->state < STATE_WRITE_DATA) advance_state_from (data, STATE_WRITE_HEADERS, STATE_WRITE_DATA); - h2_debug (io, data, "[SEND] [DATA] bytes=%zu, finished=%d", - frame->data.hd.length, frame->hd.flags & NGHTTP2_FLAG_END_STREAM); + h2_debug (io, data, "[SEND] [DATA] stream_id=%u, bytes=%zu, finished=%d", + frame->hd.stream_id, frame->data.hd.length, frame->hd.flags & NGHTTP2_FLAG_END_STREAM); if (data->metrics) { data->metrics->request_body_bytes_sent += frame->hd.length + FRAME_HEADER_SIZE; data->metrics->request_body_size += frame->data.hd.length; @@ -891,7 +918,7 @@ } break; default: - h2_debug (io, data, "[SEND] [%s]", soup_http2_frame_type_to_string (frame->hd.type)); + h2_debug (io, data, "[SEND] [%s] stream_id=%u", soup_http2_frame_type_to_string (frame->hd.type), frame->hd.stream_id); break; } @@ -932,8 +959,8 @@ SoupClientMessageIOHTTP2 *io = user_data; SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, frame->hd.stream_id); - h2_debug (io, data, "[SEND] [%s] Failed: %s", soup_http2_frame_type_to_string (frame->hd.type), - nghttp2_strerror (lib_error_code)); + h2_debug (io, data, "[SEND] [%s] Failed stream %u: %s", soup_http2_frame_type_to_string (frame->hd.type), + frame->hd.stream_id, nghttp2_strerror (lib_error_code)); if (lib_error_code == NGHTTP2_ERR_SESSION_CLOSING) process_pending_closed_messages (io); @@ -949,7 +976,7 @@ { SoupHTTP2MessageData *data = nghttp2_session_get_stream_user_data (session, stream_id); - h2_debug (user_data, data, "[SESSION] Closed: %s", nghttp2_http2_strerror (error_code)); + h2_debug (user_data, data, "[SESSION] Closed stream %u: %s", stream_id, nghttp2_http2_strerror (error_code)); if (!data) return 0; @@ -1392,7 +1419,7 @@ completion = data->state < STATE_READ_DONE ? SOUP_MESSAGE_IO_INTERRUPTED : SOUP_MESSAGE_IO_COMPLETE; - h2_debug (io, data, "Finished: %s", completion == SOUP_MESSAGE_IO_COMPLETE ? "completed" : "interrupted"); + h2_debug (io, data, "Finished stream %u: %s", data->stream_id, completion == SOUP_MESSAGE_IO_COMPLETE ? "completed" : "interrupted"); completion_cb = data->completion_cb; completion_data = data->completion_data; @@ -1821,6 +1848,7 @@ nghttp2_session_callbacks *callbacks; NGCHECK (nghttp2_session_callbacks_new (&callbacks)); nghttp2_session_callbacks_set_on_header_callback (callbacks, on_header_callback); + nghttp2_session_callbacks_set_on_invalid_header_callback (callbacks, on_invalid_header_callback); nghttp2_session_callbacks_set_on_frame_recv_callback (callbacks, on_frame_recv_callback); nghttp2_session_callbacks_set_on_data_chunk_recv_callback (callbacks, on_data_chunk_recv_callback); nghttp2_session_callbacks_set_on_begin_frame_callback (callbacks, on_begin_frame_callback); @@ -1829,7 +1857,17 @@ nghttp2_session_callbacks_set_on_frame_send_callback (callbacks, on_frame_send_callback); nghttp2_session_callbacks_set_on_stream_close_callback (callbacks, on_stream_close_callback); +#ifdef HAVE_NGHTTP2_OPTION_SET_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION + nghttp2_option *option; + + nghttp2_option_new (&option); + nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation (option, 1); + NGCHECK (nghttp2_session_client_new2 (&io->session, callbacks, io, option)); + nghttp2_option_del (option); +#else NGCHECK (nghttp2_session_client_new (&io->session, callbacks, io)); +#endif + nghttp2_session_callbacks_del (callbacks); io->messages = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, (GDestroyNotify)soup_http2_message_data_free); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/server/soup-server-connection.c new/libsoup-3.2.1/libsoup/server/soup-server-connection.c --- old/libsoup-3.2.0/libsoup/server/soup-server-connection.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/server/soup-server-connection.c 2022-10-11 20:11:57.000000000 +0200 @@ -538,25 +538,31 @@ return priv->socket; } -GSocket * -soup_server_connection_steal_socket (SoupServerConnection *conn) +GIOStream * +soup_server_connection_steal (SoupServerConnection *conn) { SoupServerConnectionPrivate *priv; - GSocket *socket; + GIOStream *stream; g_return_val_if_fail (SOUP_IS_SERVER_CONNECTION (conn), NULL); priv = soup_server_connection_get_instance_private (conn); + stream = priv->io_data ? soup_server_message_io_steal (priv->io_data) : NULL; + if (stream) { + g_object_set_data_full (G_OBJECT (stream), "GSocket", + priv->socket, g_object_unref); + } + /* Cache local and remote address */ soup_server_connection_get_local_address (conn); soup_server_connection_get_remote_address (conn); - socket = g_steal_pointer (&priv->socket); + g_clear_pointer (&priv->io_data, soup_server_message_io_destroy); g_clear_object (&priv->conn); g_clear_object (&priv->iostream); - return socket; + return stream; } GIOStream * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/server/soup-server-connection.h new/libsoup-3.2.1/libsoup/server/soup-server-connection.h --- old/libsoup-3.2.0/libsoup/server/soup-server-connection.h 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/server/soup-server-connection.h 2022-10-11 20:11:57.000000000 +0200 @@ -30,7 +30,7 @@ void soup_server_connection_disconnect (SoupServerConnection *conn); gboolean soup_server_connection_is_connected (SoupServerConnection *conn); GSocket *soup_server_connection_get_socket (SoupServerConnection *conn); -GSocket *soup_server_connection_steal_socket (SoupServerConnection *conn); +GIOStream *soup_server_connection_steal (SoupServerConnection *conn); GIOStream *soup_server_connection_get_iostream (SoupServerConnection *conn); GSocketAddress *soup_server_connection_get_local_address (SoupServerConnection *conn); GSocketAddress *soup_server_connection_get_remote_address (SoupServerConnection *conn); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/server/soup-server-message.c new/libsoup-3.2.1/libsoup/server/soup-server-message.c --- old/libsoup-3.2.0/libsoup/server/soup-server-message.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/server/soup-server-message.c 2022-10-11 20:11:57.000000000 +0200 @@ -1103,15 +1103,8 @@ GIOStream *stream; g_object_ref (msg); - stream = msg->io_data ? soup_server_message_io_steal (g_steal_pointer (&msg->io_data)) : NULL; - if (stream) { - g_object_set_data_full (G_OBJECT (stream), "GSocket", - soup_server_connection_steal_socket (msg->conn), - g_object_unref); - } - + stream = soup_server_connection_steal (msg->conn); g_signal_handlers_disconnect_by_data (msg, msg->conn); - connection_disconnected (msg); g_object_unref (msg); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/soup-message.c new/libsoup-3.2.1/libsoup/soup-message.c --- old/libsoup-3.2.0/libsoup/soup-message.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/soup-message.c 2022-10-11 20:11:57.000000000 +0200 @@ -440,11 +440,7 @@ * SoupMessage::got-body: * @msg: the message * - * Emitted after receiving the complete message request body. - * - * See also [method@Message.add_header_handler] and - * [method@Message.add_status_code_handler], which can be used - * to connect to a subset of emissions of this signal. + * Emitted after receiving the complete message response body. **/ signals[GOT_BODY] = g_signal_new ("got-body", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/soup-session.c new/libsoup-3.2.1/libsoup/soup-session.c --- old/libsoup-3.2.0/libsoup/soup-session.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/soup-session.c 2022-10-11 20:11:57.000000000 +0200 @@ -1518,6 +1518,7 @@ conn = soup_message_get_connection (tunnel_item->msg); if (conn) { g_object_unref (conn); + g_clear_object (&tunnel_item->error); tunnel_item->state = SOUP_MESSAGE_RUNNING; soup_session_send_queue_item (session, tunnel_item, (SoupMessageIOCompletionFn)tunnel_message_completed); @@ -1532,8 +1533,8 @@ soup_session_unqueue_item (session, tunnel_item); status = soup_message_get_status (tunnel_item->msg); - if (!SOUP_STATUS_IS_SUCCESSFUL (status) || item->state == SOUP_MESSAGE_RESTARTING) { - tunnel_complete (tunnel_item, status, NULL); + if (!SOUP_STATUS_IS_SUCCESSFUL (status) || tunnel_item->error || item->state == SOUP_MESSAGE_RESTARTING) { + tunnel_complete (tunnel_item, status, g_steal_pointer (&tunnel_item->error)); return; } @@ -1824,7 +1825,9 @@ g_queue_foreach (priv->queue, (GFunc)collect_queue_item, &items); g_mutex_unlock (&priv->queue_mutex); - for (i = g_list_reverse (items); i != NULL; i = g_list_next (i)) { + items = g_list_reverse (items); + + for (i = items; i != NULL; i = g_list_next (i)) { SoupMessageQueueItem *item = (SoupMessageQueueItem *)i->data; soup_session_process_queue_item (item->session, item, TRUE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/libsoup/websocket/soup-websocket-connection.c new/libsoup-3.2.1/libsoup/websocket/soup-websocket-connection.c --- old/libsoup-3.2.0/libsoup/websocket/soup-websocket-connection.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/libsoup/websocket/soup-websocket-connection.c 2022-10-11 20:11:57.000000000 +0200 @@ -719,7 +719,7 @@ code = 0; break; default: - if (code < 3000) { + if (code < 3000 || code >= 5000) { g_debug ("Wrong closing code %d received", code); protocol_error_and_close (self); return; @@ -766,6 +766,18 @@ break; } + /* 1005, 1006 and 1015 are reserved values and MUST NOT be set as a status code in a Close control frame by an endpoint */ + switch (priv->peer_close_code) { + case SOUP_WEBSOCKET_CLOSE_NO_STATUS: + case SOUP_WEBSOCKET_CLOSE_ABNORMAL: + case SOUP_WEBSOCKET_CLOSE_TLS_HANDSHAKE: + g_debug ("received a broken close frame containing reserved status code %u", priv->peer_close_code); + protocol_error_and_close (self); + return; + default: + break; + } + if (len > 2) { data += 2; len -= 2; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/meson.build new/libsoup-3.2.1/meson.build --- old/libsoup-3.2.0/meson.build 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/meson.build 2022-10-11 20:11:57.000000000 +0200 @@ -1,5 +1,5 @@ project('libsoup', 'c', - version: '3.2.0', + version: '3.2.1', meson_version : '>= 0.54', license : 'LGPL-2.0-or-later', default_options : [ @@ -110,7 +110,12 @@ glib_deps = [glib_dep, gmodule_dep, gobject_dep, gio_dep] +cdata = configuration_data() + libnghttp2_dep = dependency('libnghttp2') +if cc.has_function('nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation', prefix : '#include <nghttp2/nghttp2.h>', dependencies : libnghttp2_dep) + cdata.set('HAVE_NGHTTP2_OPTION_SET_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION', '1') +endif sqlite_dep = dependency('sqlite3', required: false) @@ -126,8 +131,6 @@ sqlite_dep = dependency('sqlite3') endif -cdata = configuration_data() - brotlidec_dep = dependency('libbrotlidec', required : get_option('brotli')) if brotlidec_dep.found() cdata.set('WITH_BROTLI', true) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/po/tr.po new/libsoup-3.2.1/po/tr.po --- old/libsoup-3.2.0/po/tr.po 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/po/tr.po 2022-10-11 20:11:57.000000000 +0200 @@ -1,5 +1,5 @@ # Turkish translation for libsoup. -# Copyright (C) 2012-2019 libsoup's COPYRIGHT HOLDER +# Copyright (C) 2012-2022 libsoup's COPYRIGHT HOLDER # This file is distributed under the same license as the libsoup package. # # Ozan ??a??layan <ozan...@gmail.com>, 2013. @@ -13,7 +13,7 @@ msgstr "" "Project-Id-Version: libsoup master\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/libsoup/issues\n" -"POT-Creation-Date: 2021-08-09 09:48+0000\n" +"POT-Creation-Date: 2022-08-13 12:28+0000\n" "PO-Revision-Date: 2021-09-09 22:15+0300\n" "Last-Translator: Emin Tufan ??etin <etce...@gmail.com>\n" "Language-Team: T??rk??e <gnome-t...@gnome.org>\n" @@ -53,25 +53,26 @@ msgid "Cannot truncate SoupBodyInputStream" msgstr "SoupBodyInputStream kesilemiyor" -#: libsoup/http1/soup-client-message-io-http1.c:312 -#: libsoup/http1/soup-client-message-io-http1.c:756 +#: libsoup/http1/soup-client-message-io-http1.c:321 +#: libsoup/http1/soup-client-message-io-http1.c:762 #: libsoup/http2/soup-body-input-stream-http2.c:221 -#: libsoup/server/soup-server-io.c:363 libsoup/server/soup-server-io.c:828 +#: libsoup/server/http1/soup-server-message-io-http1.c:416 +#: libsoup/server/http1/soup-server-message-io-http1.c:889 msgid "Operation would block" msgstr "????lem engellenebilir" -#: libsoup/http1/soup-client-message-io-http1.c:456 +#: libsoup/http1/soup-client-message-io-http1.c:462 msgid "Could not parse HTTP response" msgstr "HTTP yan??t?? ayr????t??r??lamad??" -#: libsoup/http1/soup-client-message-io-http1.c:479 +#: libsoup/http1/soup-client-message-io-http1.c:485 msgid "Unrecognized HTTP response encoding" msgstr "HTTP yan??t?? tan??nmayan bi??imde kodlanm????" -#: libsoup/http1/soup-client-message-io-http1.c:715 -#: libsoup/http1/soup-client-message-io-http1.c:741 -#: libsoup/http2/soup-client-message-io-http2.c:1456 -#: libsoup/http2/soup-client-message-io-http2.c:1480 +#: libsoup/http1/soup-client-message-io-http1.c:721 +#: libsoup/http1/soup-client-message-io-http1.c:747 +#: libsoup/http2/soup-client-message-io-http2.c:1544 +#: libsoup/http2/soup-client-message-io-http2.c:1568 msgid "Operation was cancelled" msgstr "????lem iptal edildi" @@ -79,152 +80,118 @@ msgid "Header too big" msgstr "Ba??l??k ??ok b??y??k" -#: libsoup/server/soup-server.c:1201 -msgid "Can???t create a TLS server without a TLS certificate" -msgstr "TLS sertifikas?? olmadan TLS sunucusu olu??turulamaz" - -#: libsoup/server/soup-server.c:1223 -#, c-format -msgid "Could not listen on address %s, port %d: " -msgstr "%s adresinin %d ba??lant?? noktas?? dinlenemedi: " - -#: libsoup/server/soup-socket.c:121 +#: libsoup/server/soup-listener.c:261 msgid "Could not import existing socket: " msgstr "Var olan yuva i??e aktar??lamad??: " -#: libsoup/server/soup-socket.c:130 +#: libsoup/server/soup-listener.c:267 msgid "Can???t import unconnected socket" msgstr "Ba??l?? olmayan yuva i??e aktar??lam??yor" -#: libsoup/soup-session.c:1166 +#: libsoup/server/soup-server.c:1209 +msgid "Can???t create a TLS server without a TLS certificate" +msgstr "TLS sertifikas?? olmadan TLS sunucusu olu??turulamaz" + +#: libsoup/soup-session.c:1116 msgid "Location header is missing or empty in response headers" msgstr "Konum ba??l?????? eksik veya yan??t ba??l??klar??nda bo??" -#: libsoup/soup-session.c:1180 +#: libsoup/soup-session.c:1130 #, c-format msgid "Invalid URI ???%s??? in Location response header" msgstr "Konum yan??t ba??l??????nda ge??ersiz URI ???%s???" -#: libsoup/soup-session.c:1200 +#: libsoup/soup-session.c:1150 msgid "Too many redirects" msgstr "??ok say??da y??nlendirme" -#: libsoup/soup-session.c:1205 +#: libsoup/soup-session.c:1155 msgid "Message was restarted too many times" msgstr "??leti bir??ok kez yeniden ba??lad??" -#: libsoup/soup-session.c:3317 libsoup/soup-session.c:3466 +#: libsoup/soup-session.c:3011 libsoup/soup-session.c:3159 msgid "Message is already in session queue" msgstr "??leti zaten oturum s??ras??nda" -#: libsoup/soup-session.c:3827 +#: libsoup/soup-session.c:3491 msgid "The server did not accept the WebSocket handshake." msgstr "Sunucu, WebSocket el s??k????mas??n?? kabul etmedi." -#: libsoup/soup-tld.c:142 +#: libsoup/soup-tld.c:129 msgid "No public-suffix list available." msgstr "Uygun halka a????k son ek listesi yok." -#: libsoup/soup-tld.c:152 libsoup/soup-tld.c:168 +#: libsoup/soup-tld.c:139 libsoup/soup-tld.c:155 msgid "Invalid hostname" msgstr "Ge??ersiz makine ad??" -#: libsoup/soup-tld.c:159 +#: libsoup/soup-tld.c:146 msgid "Hostname is an IP address" msgstr "Makine ad?? bir IP adresi" -#: libsoup/soup-tld.c:180 +#: libsoup/soup-tld.c:167 msgid "Hostname has no base domain" msgstr "Ana makinenin temel etki alan?? yok" -#: libsoup/soup-tld.c:188 +#: libsoup/soup-tld.c:175 msgid "Not enough domains" msgstr "Yeterli etki alan?? yok" -#: libsoup/websocket/soup-websocket.c:399 -#: libsoup/websocket/soup-websocket.c:443 -#: libsoup/websocket/soup-websocket.c:459 +#: libsoup/websocket/soup-websocket.c:390 +#: libsoup/websocket/soup-websocket.c:434 +#: libsoup/websocket/soup-websocket.c:450 msgid "Server requested unsupported extension" msgstr "Sunucu, desteklenmeyen eklenti iste??inde bulundu" -#: libsoup/websocket/soup-websocket.c:422 -#: libsoup/websocket/soup-websocket.c:614 +#: libsoup/websocket/soup-websocket.c:413 +#: libsoup/websocket/soup-websocket.c:605 #, c-format msgid "Incorrect WebSocket ???%s??? header" msgstr "Hatal?? WebSocket ???%s??? ba??l??????" -#: libsoup/websocket/soup-websocket.c:423 -#: libsoup/websocket/soup-websocket.c:878 +#: libsoup/websocket/soup-websocket.c:414 +#: libsoup/websocket/soup-websocket.c:869 #, c-format msgid "Server returned incorrect ???%s??? key" msgstr "Sunucu, ge??ersiz ???%s??? anahtar?? d??nd??rd??" -#: libsoup/websocket/soup-websocket.c:486 +#: libsoup/websocket/soup-websocket.c:477 #, c-format msgid "Duplicated parameter in ???%s??? WebSocket extension header" msgstr "???%s??? WebSocket eklenti ba??l??????nda yinelenen parametre" -#: libsoup/websocket/soup-websocket.c:487 +#: libsoup/websocket/soup-websocket.c:478 #, c-format -msgid "Server returned a duplicated parameter in ???%s??? WebSocket extension header" +msgid "" +"Server returned a duplicated parameter in ???%s??? WebSocket extension header" msgstr "Sunucu, ???%s??? WebSocket eklenti ba??l??????nda yinelenen parametre d??nd??rd??" -#: libsoup/websocket/soup-websocket.c:577 -#: libsoup/websocket/soup-websocket.c:587 +#: libsoup/websocket/soup-websocket.c:568 +#: libsoup/websocket/soup-websocket.c:578 msgid "WebSocket handshake expected" msgstr "WebSocket el s??k????mas?? bekleniyor" -#: libsoup/websocket/soup-websocket.c:595 +#: libsoup/websocket/soup-websocket.c:586 msgid "Unsupported WebSocket version" msgstr "Desteklenmeyen WebSocket s??r??m??" -#: libsoup/websocket/soup-websocket.c:604 +#: libsoup/websocket/soup-websocket.c:595 msgid "Invalid WebSocket key" msgstr "Ge??ersiz WebSocket anahtar??" -#: libsoup/websocket/soup-websocket.c:623 +#: libsoup/websocket/soup-websocket.c:614 msgid "Unsupported WebSocket subprotocol" msgstr "Desteklenmeyen WebSocket alt ileti??im kural??" -#: libsoup/websocket/soup-websocket.c:829 +#: libsoup/websocket/soup-websocket.c:820 msgid "Server rejected WebSocket handshake" msgstr "Sunucu, WebSocket el s??k????mas??n?? reddetti" +#: libsoup/websocket/soup-websocket.c:828 #: libsoup/websocket/soup-websocket.c:837 -#: libsoup/websocket/soup-websocket.c:846 msgid "Server ignored WebSocket handshake" msgstr "Sunucu, WebSocket el s??k????mas??n?? yoksayd??" -#: libsoup/websocket/soup-websocket.c:858 +#: libsoup/websocket/soup-websocket.c:849 msgid "Server requested unsupported protocol" msgstr "Sunucu, desteklenmeyen ileti??im kural?? iste??inde bulundu" - -#~ msgid "Could not parse URI ???%s???: %s" -#~ msgstr "URI ???%s??? ayr????t??r??lamad??: %s" - -#~ msgid "Unsupported URI scheme ???%s???" -#~ msgstr "Desteklenmeyen URI ??emas?? ???%s???" - -#~ msgid "Invalid ???%s??? URI: %s" -#~ msgstr "Ge??ersiz ???%s??? URI: %s" - -#~ msgid "Name" -#~ msgstr "Ad" - -#~ msgid "Size" -#~ msgstr "Boyut" - -#~ msgid "Date Modified" -#~ msgstr "De??i??tirilme Tarihi" - -#~ msgid "Could not parse HTTP request" -#~ msgstr "HTTP iste??i ayr????t??r??lamad??" - -#~ msgid "No URI provided" -#~ msgstr "URI verilmedi" - -#~ msgid "Not an HTTP URI" -#~ msgstr "HTTP URI de??il" - -#~ msgid "Can???t import non-socket as SoupSocket" -#~ msgstr "Non-socket, SoupSocket olarak i??e aktar??lam??yor" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/tests/http2-test.c new/libsoup-3.2.1/tests/http2-test.c --- old/libsoup-3.2.0/tests/http2-test.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/tests/http2-test.c 2022-10-11 20:11:57.000000000 +0200 @@ -986,6 +986,32 @@ g_object_unref (msg); } +#ifdef HAVE_NGHTTP2_OPTION_SET_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION +static void +do_invalid_header_rfc9113_received_test (Test *test, gconstpointer data) +{ + gboolean async = GPOINTER_TO_INT (data); + GUri *uri; + SoupMessage *msg; + GBytes *response; + GError *error = NULL; + + uri = g_uri_parse_relative (base_uri, "/invalid-header-rfc9113", SOUP_HTTP_URI_FLAGS, NULL); + msg = soup_message_new_from_uri (SOUP_METHOD_GET, uri); + + if (async) + response = soup_test_session_async_send (test->session, msg, NULL, &error); + else + response = soup_session_send_and_read (test->session, msg, NULL, &error); + + g_assert_nonnull (response); + g_assert_no_error (error); + g_clear_error (&error); + g_object_unref (msg); + g_uri_unref (uri); +} +#endif + static void content_sniffed (SoupMessage *msg, char *content_type, @@ -1211,6 +1237,15 @@ /* Use soup_message_headers_append_common to skip the validation check. */ soup_message_headers_append_common (response_headers, SOUP_HEADER_CONTENT_TYPE, "\r"); soup_server_message_set_status (msg, SOUP_STATUS_OK, NULL); + } else if (strcmp (path, "/invalid-header-rfc9113") == 0) { + SoupMessageHeaders *response_headers; + + response_headers = soup_server_message_get_response_headers (msg); + soup_message_headers_append (response_headers, "Invalid-Header-Value", "foo "); + soup_server_message_set_response (msg, "text/plain", + SOUP_MEMORY_STATIC, + "Success!", 8); + soup_server_message_set_status (msg, SOUP_STATUS_OK, NULL); } } @@ -1346,6 +1381,16 @@ setup_session, do_invalid_header_received_test, teardown_session); +#ifdef HAVE_NGHTTP2_OPTION_SET_NO_RFC9113_LEADING_AND_TRAILING_WS_VALIDATION + g_test_add ("/http2/invalid-header-rfc9113-received/async", Test, GINT_TO_POINTER (TRUE), + setup_session, + do_invalid_header_rfc9113_received_test, + teardown_session); + g_test_add ("/http2/invalid-header-rfc9113-received/sync", Test, GINT_TO_POINTER (FALSE), + setup_session, + do_invalid_header_rfc9113_received_test, + teardown_session); +#endif g_test_add ("/http2/sniffer/async", Test, NULL, setup_session, do_sniffer_async_test, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/tests/misc-test.c new/libsoup-3.2.1/tests/misc-test.c --- old/libsoup-3.2.0/tests/misc-test.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/tests/misc-test.c 2022-10-11 20:11:57.000000000 +0200 @@ -35,7 +35,7 @@ const char *method = soup_server_message_get_method (msg); GUri *uri = soup_server_message_get_uri (msg); - if (method != SOUP_METHOD_GET && method != SOUP_METHOD_POST) { + if (method != SOUP_METHOD_GET && method != SOUP_METHOD_POST && method != SOUP_METHOD_PUT) { soup_server_message_set_status (msg, SOUP_STATUS_NOT_IMPLEMENTED, NULL); return; } @@ -45,6 +45,25 @@ return; } + if (!strcmp (path, "/session")) { + SoupMessageHeaders *request_headers; + const char *session_id; + + request_headers = soup_server_message_get_request_headers (msg); + session_id = soup_message_headers_get_one (request_headers, "X-SoupTest-Session-Id"); + if (!session_id) { + SoupMessageHeaders *response_headers; + + response_headers = soup_server_message_get_response_headers (msg); + soup_message_headers_replace (response_headers, "X-SoupTest-Session-Id", "session-1"); + soup_server_message_set_status (msg, SOUP_STATUS_CONFLICT, NULL); + } else { + soup_server_message_set_status (msg, SOUP_STATUS_CREATED, NULL); + } + + return; + } + if (!strcmp (path, "/slow")) { GSource *timeout; soup_server_message_pause (msg); @@ -868,6 +887,141 @@ soup_test_session_abort_unref (session); } +typedef struct { + SoupSession *session; + GCancellable *cancellable; + GBytes *body; + guint64 connections[2]; + gboolean done; +} ConflictTestData; + +static void +conflict_test_send_ready_cb (SoupSession *session, + GAsyncResult *result, + ConflictTestData *data) +{ + GInputStream *stream; + SoupMessage *msg = soup_session_get_async_result_message (session, result); + GError *error = NULL; + + stream = soup_session_send_finish (session, result, &error); + if (stream) { + guint status = soup_message_get_status (msg); + + soup_test_request_read_all (stream, NULL, NULL); + g_object_unref (stream); + + if (status != SOUP_STATUS_CONFLICT) { + g_assert_cmpuint (status, ==, SOUP_STATUS_CREATED); + data->connections[1] = soup_message_get_connection_id (msg); + data->done = TRUE; + } + } else { + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); + g_error_free (error); + } +} + +static void +conflict_test_on_conflict_cb (SoupMessage *msg, + ConflictTestData *data) +{ + SoupMessageHeaders *response_headers; + SoupMessageHeaders *request_headers; + const gchar *session_id; + SoupMessage *new_msg; + + g_cancellable_cancel (data->cancellable); + g_clear_object (&data->cancellable); + + data->connections[0] = soup_message_get_connection_id (msg); + response_headers = soup_message_get_response_headers (msg); + session_id = soup_message_headers_get_one (response_headers, "X-SoupTest-Session-Id"); + new_msg = soup_message_new_from_uri (SOUP_METHOD_PUT, soup_message_get_uri (msg)); + request_headers = soup_message_get_request_headers (new_msg); + soup_message_headers_replace (request_headers, "X-SoupTest-Session-Id", session_id); + + data->cancellable = g_cancellable_new (); + soup_message_set_request_body_from_bytes (new_msg, "text/plain", data->body); + soup_session_send_async (data->session, new_msg, G_PRIORITY_DEFAULT, data->cancellable, + (GAsyncReadyCallback)conflict_test_send_ready_cb, data); + g_object_unref (new_msg); +} + +static void +conflict_test_on_got_body_cb (SoupMessage *msg, + ConflictTestData *data) +{ + if (soup_message_get_status (msg) == SOUP_STATUS_CONFLICT) + conflict_test_on_conflict_cb (msg, data); +} + +static void +do_new_request_on_conflict_test (void) +{ + GUri *uri; + SoupMessage *msg; + ConflictTestData data; + static const char *body = "conflict test body"; + + data.session = soup_test_session_new (NULL); + data.cancellable = g_cancellable_new (); + data.body = g_bytes_new_static (body, strlen (body)); + data.connections[0] = data.connections[1] = 0; + data.done = FALSE; + + /* First try with restarting on got-headers */ + uri = g_uri_parse_relative (base_uri, "/session", SOUP_HTTP_URI_FLAGS, NULL); + msg = soup_message_new_from_uri (SOUP_METHOD_PUT, uri); + soup_message_set_request_body_from_bytes (msg, "text/plain", data.body); + soup_message_add_status_code_handler (msg, "got-headers", SOUP_STATUS_CONFLICT, + G_CALLBACK (conflict_test_on_conflict_cb), + &data); + soup_session_send_async (data.session, msg, G_PRIORITY_DEFAULT, data.cancellable, + (GAsyncReadyCallback)conflict_test_send_ready_cb, &data); + + while (!data.done) + g_main_context_iteration (NULL, TRUE); + + g_assert_cmpuint (data.connections[0], >, 0); + g_assert_cmpuint (data.connections[1], >, 0); + g_assert_cmpuint (data.connections[0], !=, data.connections[1]); + + g_object_unref (msg); + g_object_unref (data.cancellable); + + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, FALSE); + + data.cancellable = g_cancellable_new (); + data.connections[0] = data.connections[1] = 0; + data.done = FALSE; + + /* Now try with the restarting on got-body */ + msg = soup_message_new_from_uri (SOUP_METHOD_PUT, uri); + soup_message_set_request_body_from_bytes (msg, "text/plain", data.body); + g_signal_connect (msg, "got-body", G_CALLBACK (conflict_test_on_got_body_cb), &data); + soup_session_send_async (data.session, msg, G_PRIORITY_DEFAULT, data.cancellable, + (GAsyncReadyCallback)conflict_test_send_ready_cb, &data); + + while (!data.done) + g_main_context_iteration (NULL, TRUE); + + g_assert_cmpuint (data.connections[0], >, 0); + g_assert_cmpuint (data.connections[1], >, 0); + g_assert_cmpuint (data.connections[0], ==, data.connections[1]); + + g_object_unref (msg); + g_object_unref (data.cancellable); + + while (g_main_context_pending (NULL)) + g_main_context_iteration (NULL, FALSE); + + g_uri_unref (uri); + g_bytes_unref (data.body); + soup_test_session_abort_unref (data.session); +} + static void wrote_informational_check_content_length (SoupServerMessage *msg, gpointer user_data) @@ -1003,6 +1157,7 @@ g_test_add_func ("/misc/connection-id", do_connection_id_test); g_test_add_func ("/misc/remote-address", do_remote_address_test); g_test_add_func ("/misc/new-request-on-redirect", do_new_request_on_redirect_test); + g_test_add_func ("/misc/new-request-on-conflict", do_new_request_on_conflict_test); g_test_add_func ("/misc/response/informational/content-length", do_response_informational_content_length_test); g_test_add_func ("/misc/invalid-utf8-headers", do_invalid_utf8_headers_test); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/tests/proxy-test.c new/libsoup-3.2.1/tests/proxy-test.c --- old/libsoup-3.2.0/tests/proxy-test.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/tests/proxy-test.c 2022-10-11 20:11:57.000000000 +0200 @@ -340,11 +340,43 @@ g_object_unref (cache); } +static void +do_proxy_connect_error_test (gconstpointer data) +{ + GUri *base_uri = (GUri *)data; + GUri *proxy_uri; + char *proxy_uri_str; + SoupSession *session; + SoupMessage *msg; + GProxyResolver *resolver; + GBytes *body; + GError *error = NULL; + + /* Proxy connection will success, but CONNECT message to https will fail due to TLS errors */ + proxy_uri = soup_uri_copy (base_uri, SOUP_URI_SCHEME, "http", NULL); + proxy_uri_str = g_uri_to_string (proxy_uri); + g_uri_unref (proxy_uri); + + resolver = g_simple_proxy_resolver_new (proxy_uri_str, (char **)ignore_hosts); + g_free (proxy_uri_str); + session = soup_test_session_new ("proxy-resolver", resolver, NULL); + g_object_unref (resolver); + + msg = soup_message_new_from_uri (SOUP_METHOD_GET, base_uri); + body = soup_test_session_async_send (session, msg, NULL, &error); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CONNECTION_CLOSED); + + g_error_free (error); + g_bytes_unref (body); + g_object_unref (msg); + soup_test_session_abort_unref (session); +} + int main (int argc, char **argv) { SoupServer *server; - GUri *base_uri; + GUri *base_uri, *base_https_uri; char *path; int i, ret; @@ -359,6 +391,7 @@ server = soup_test_server_new (SOUP_TEST_SERVER_IN_THREAD); soup_server_add_handler (server, NULL, server_callback, NULL, NULL); base_uri = soup_test_server_get_uri (server, "http", NULL); + base_https_uri = soup_test_server_get_uri (server, "https", NULL); for (i = 0; i < ntests; i++) { path = g_strdup_printf ("/proxy/%s", tests[i].explanation); @@ -369,10 +402,12 @@ g_test_add_data_func ("/proxy/fragment", base_uri, do_proxy_fragment_test); g_test_add_func ("/proxy/redirect", do_proxy_redirect_test); g_test_add_func ("/proxy/auth-cache", do_proxy_auth_cache_test); + g_test_add_data_func ("/proxy/connect-error", base_https_uri, do_proxy_connect_error_test); ret = g_test_run (); g_uri_unref (base_uri); + g_uri_unref (base_https_uri); soup_test_server_quit_unref (server); for (i = 0; i < 3; i++) g_object_unref (proxy_resolvers[i]); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsoup-3.2.0/tests/websocket-test.c new/libsoup-3.2.1/tests/websocket-test.c --- old/libsoup-3.2.0/tests/websocket-test.c 2022-09-14 21:52:15.000000000 +0200 +++ new/libsoup-3.2.1/tests/websocket-test.c 2022-10-11 20:11:57.000000000 +0200 @@ -907,6 +907,11 @@ g_assert_cmpstr (soup_message_headers_get_one (soup_message_get_response_headers (test->msg), "Sec-WebSocket-Protocol"), ==, NULL); } +typedef enum { + CLOSE_TEST_FLAG_SERVER = 1 << 0, + CLOSE_TEST_FLAG_CLIENT = 1 << 1 +} CloseTestFlags; + static const struct { gushort code; const char *reason; @@ -914,11 +919,16 @@ const char *expected_sender_reason; gushort expected_receiver_code; const char *expected_receiver_reason; + CloseTestFlags flags; } close_clean_tests[] = { - { SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL", SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL", SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL" }, - { SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY", SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY", SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY" }, - { SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL }, - { SOUP_WEBSOCKET_CLOSE_NO_STATUS, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NO_STATUS, NULL }, + { SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL", SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL", SOUP_WEBSOCKET_CLOSE_NORMAL, "NORMAL", CLOSE_TEST_FLAG_SERVER | CLOSE_TEST_FLAG_CLIENT }, + { SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY", SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY", SOUP_WEBSOCKET_CLOSE_GOING_AWAY, "GOING_AWAY", CLOSE_TEST_FLAG_SERVER | CLOSE_TEST_FLAG_CLIENT }, + { SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, CLOSE_TEST_FLAG_SERVER | CLOSE_TEST_FLAG_CLIENT }, + { SOUP_WEBSOCKET_CLOSE_NO_STATUS, NULL, SOUP_WEBSOCKET_CLOSE_NORMAL, NULL, SOUP_WEBSOCKET_CLOSE_NO_STATUS, NULL, CLOSE_TEST_FLAG_SERVER | CLOSE_TEST_FLAG_CLIENT }, + { 2999, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, CLOSE_TEST_FLAG_CLIENT }, + { 2999, NULL, 0, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, CLOSE_TEST_FLAG_SERVER }, + { 5000, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, CLOSE_TEST_FLAG_CLIENT }, + { 5000, NULL, 0, NULL, SOUP_WEBSOCKET_CLOSE_PROTOCOL_ERROR, NULL, CLOSE_TEST_FLAG_SERVER }, }; static void @@ -958,6 +968,9 @@ guint i; for (i = 0; i < G_N_ELEMENTS (close_clean_tests); i++) { + if (!(close_clean_tests[i].flags & CLOSE_TEST_FLAG_CLIENT)) + continue; + setup_soup_connection (test, data); do_close_clean_client (test, @@ -979,6 +992,9 @@ guint i; for (i = 0; i < G_N_ELEMENTS (close_clean_tests); i++) { + if (!(close_clean_tests[i].flags & CLOSE_TEST_FLAG_CLIENT)) + continue; + setup_direct_connection (test, data); do_close_clean_client (test, @@ -1030,6 +1046,9 @@ guint i; for (i = 0; i < G_N_ELEMENTS (close_clean_tests); i++) { + if (!(close_clean_tests[i].flags & CLOSE_TEST_FLAG_SERVER)) + continue; + setup_direct_connection (test, data); do_close_clean_server (test, @@ -1051,6 +1070,9 @@ guint i; for (i = 0; i < G_N_ELEMENTS (close_clean_tests); i++) { + if (!(close_clean_tests[i].flags & CLOSE_TEST_FLAG_SERVER)) + continue; + setup_direct_connection (test, data); do_close_clean_server (test, @@ -1549,6 +1571,8 @@ g_assert_cmpstr (remote_ip, ==, str); g_free (str); + g_assert_nonnull (soup_server_message_get_socket (msg)); + test->server = g_object_ref (connection); }