summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 2.66.52.66.5gnome-3-32Patrick Griffis2020-12-132-1/+5
|
* WebSockets: ensure a new connection is created for WebSocket requestswebsockets-fixes-2.66Carlos Garcia Campos2020-12-111-0/+10
| | | | | The spec says a new connection must be established and some servers reply with a 400 Bad Request when reusing an existing connection.
* WebSockets: do not start the input source when IO is closingCarlos Garcia Campos2020-12-112-1/+35
| | | | | | | | | We should not schedule a new read after reading the close message, since we don't expect more input. This fixes a crash due to an assert that checks that the input source is NULL when the connection is destroyed that happens when the connection is destroyed in the closed callback. Fixes #181
* WebSockets: plug another leak in the send_message() methodClaudio Saavedra2020-12-111-0/+1
| | | | | The GByteArray allocated in the beginning is not freed in case of error.
* WebSockets: fix read after free in send_message()Claudio Saavedra2020-12-111-7/+6
| | | | | g_byte_array_append() can reallocate its data, so make sure that we don't rely on any pointer pointing to it after calling it.
* WebSockets: handle Set-Cookie header in handshake responseCarlos Garcia Campos2020-12-112-0/+80
| | | | | | | We are currently ignoring the Set-Cookie in handshake response because the SoupCookieJar feature handles the header in the got-headers signal that is never emitted for informational messages. SoupCookieJar should also handle Set-Cookie for switching protocols informational messages.
* WebSockets: only poll IO stream when neededCarlos Garcia Campos2020-12-112-43/+77
| | | | | | | | | Instead of having two pollable sources constantly running, always try to read/write without blocking and start polling if the operation returns G_IO_ERROR_WOULD_BLOCK. This patch also fixes test /websocket/direct/close-after-close that was passing but not actually testing what we wanted, because the client close was never sent. When the mutex is released, the frame has been queued, but not sent.
* WebSockets: fix invalid read when sending large messagesClaudio Saavedra2020-12-111-3/+3
| | | | | | | | We use GByteArray, which can be reallocated, so be careful when keeping track of the current position in a message not to use potentially dangling pointers. Fixes #160
* WebSockets: allow to send close frames with no bodyCarlos Garcia Campos2020-12-112-30/+142
| | | | | | | | | | | Using the code SOUP_WEBSOCKET_CLOSE_NO_STATUS. The spec says that code should not be included in a frame, but that doesn't mean we can't use it on the API level to mean no status. We were using 0 internally which is not a valid code either. When an empty close frame is received we still reply with a SOUP_WEBSOCKET_CLOSE_NORMAL code frame, but we return SOUP_WEBSOCKET_CLOSE_NO_STATUS from soup_websocket_connection_get_close_code() because that's actually what we received.
* WebSockets: ignore any messages after close has been sent and receivedCarlos Garcia Campos2020-12-112-0/+51
| | | | | | | | | | We currently ignore data frames when close has been received, but we should also ignore any frame after close has been sent and received. Currently, if we receive two close frames we end up with the code and reason of the second frame, while the RFC says: "The WebSocket Connection Close Code is defined as the status code contained in the first Close control frame received by the application implementing this protocol."
* WebSockets: client should also mark the close frame as SOUP_WEBSOCKET_QUEUE_LASTCarlos Garcia Campos2020-12-111-1/+1
| | | | When close message was already received from the server.
* WebSockets: server must close the connection when receiving an unmasked frameCarlos Garcia Campos2020-12-112-3/+55
| | | | | | | RFC 6455: The server MUST close the connection upon receiving a frame that is not masked.
* WebSockets: client must fail when receiving a masked frame from serverCarlos Garcia Campos2020-12-112-0/+56
| | | | | | | RFC 6455: A server MUST NOT mask any frames that it sends to the client. A client MUST close a connection if it detects a masked frame.
* WebSockets: allow null characters in text messages dataCarlos Garcia Campos2020-12-111-6/+83
| | | | | | | | | | | | | | | | RFC 6455 says that text messages should contains valid UTF-8, and null characters valid according to RFC 3629. However, we are using g_utf8_validate(), which considers null characters as errors, to validate WebSockets text messages. This patch adds an internal utf8_validate() function based on g_utf8_validate() but allowing null characters and just returning a gboolean since we are always ignoring the end parameter in case of errors. soup_websocket_connection_send_text() assumes the given text is null terminated, so we need a new public function to allow sending text messages containing null characters. This patch adds soup_websocket_connection_send_message() that receives a SoupWebsocketDataType and GBytes, which is consistent with SoupWebsocketConnection::message signal.
* WebSockets: closed signal not emitted when io stream is SoupIOStreamCarlos Garcia Campos2020-12-114-2/+21
| | | | | | | | That's the case of connections created by SoupSession. In that case, if the server hasn't closed its end of the connection, we fail to shutdown the client end, because shutdown_wr_io_stream() does nothing when the io stream is not a GSocketConnection. So, for SoupIOStream we need to get the base io stream which is a GSocketConnection.
* WebSockets: fail and close the connection in case of invalid payload lengthCarlos Garcia Campos2020-12-112-0/+122
| | | | | | | | | | | | | | RFC 6455: The length of the "Payload data", in bytes: if 0-125, that is the payload length. If 126, the following 2 bytes interpreted as a 16-bit unsigned integer are the payload length. If 127, the following 8 bytes interpreted as a 64-bit unsigned integer (the most significant bit MUST be 0) are the payload length. Multibyte length quantities are expressed in network byte order. Note that in all cases, the minimal number of bytes MUST be used to encode the length, for example, the length of a 124-byte-long string can't be encoded as the sequence 126, 0, 124.
* WebSockets: return after closing connection on error in process_frameCarlos Garcia Campos2020-12-111-0/+1
|
* WebSockets: allow to send empty binary dataCarlos Garcia Campos2020-12-112-3/+58
| | | | Passing data=NULL and length=0 which is consistent with g_bytes_new().
* WebSockets: fix runtime critical warning when handshake failsCarlos Garcia Campos2020-12-112-0/+55
| | | | | | | | | | (process:20018): GLib-GIO-CRITICAL **: 12:26:09.686: g_task_return_error: assertion 'G_IS_TASK (task)' failed (process:20018): GLib-GObject-CRITICAL **: 12:26:09.686: g_object_unref: assertion 'G_IS_OBJECT (object)' failed We are trying to complete the GTask twice, first in websocket_connect_async_stop() and then in websocket_connect_async_complete(). The latter should only be called if the item finishes before got-informational signal is emitted.
* WebSockets: message never finishes when handshake failsCarlos Garcia Campos2020-12-111-1/+3
| | | | | | | | | When soup_websocket_client_verify_handshake() returns TRUE, the message connection is stolen and soup_message_io_steal() is called for the message, making the message to move to FINISHING state. However, when it returns FALSE, the message stays in RUNNING state forever. We should call soup_message_io_finished() in that case to ensure the messages transitions to FINISHING state.
* 2.66.42.66.4Claudio Saavedra2019-10-092-1/+5
|
* NTLM: Avoid a potential heap buffer overflow in v2 authenticationClaudio Saavedra2019-10-091-0/+6
| | | | | | | Check the length of the decoded v2 challenge before attempting to parse it, to avoid reading past it. Fixes #173
* 2.66.32.66.3Claudio Saavedra2019-09-112-1/+7
|
* SoupServer: fix to not allow smuggling ".." into pathIgnacio Casal Quinteiro2019-09-112-1/+75
| | | | | This was already fixed for Unix like systems but it was still possible to smuggle .. into a windows like server.
* gtkdoc: set the documentation namespaceClaudio Saavedra2019-05-161-0/+1
| | | | This prevents all documentation to be indexed under S in the index.
* meson: fix the documentation src_dir valueClaudio Saavedra2019-05-162-1/+2
| | | | | Use include_directories() instead of hardcoding it to make sure that both its source and build directory are included.
* meson: actually declare the gtk_doc optionClaudio Saavedra2019-05-161-1/+1
| | | | Forgot to change it in meson_options.txt
* meson: switch documentation option from 'doc' to 'gtk_doc'Claudio Saavedra2019-05-161-1/+1
| | | | This is the standard in GNOME currently.
* 2.66.22.66.2Claudio Saavedra2019-05-152-1/+13
|
* meson: Check TLS support only when external glib dependency is availableSeungha Yang2019-05-033-18/+24
| | | | meson does not allow compile with internal dependency (i.e., fallback dependency)
* Fix the build of tests on MinGWTomas Popela2019-04-231-1/+1
| | | | | | | | | Currently the tests are failing to build with "undefined reference to `_imp__htonl@4'". The fix is to add the platform_deps to tests dependencies. Do that by adding it to the libsoup_dep thus all the targets are fixed. https://gitlab.gnome.org/GNOME/libsoup/merge_requests/60
* meson: Explicitly set encoding to utf-8 for non-English localeSeungha Yang2019-04-091-0/+3
| | | | | | | | | | Visual Studio 2019 handle it as an error. FAILED: subprojects/libsoup/libsoup/1b29d39@@soup-2.4@sha/meson-generated_.._soup-enum-types.c.obj cl @subprojects/libsoup/libsoup/1b29d39@@soup-2.4@sha/meson-generated_.._soup-enum-types.c.obj.rsp subprojects\glib\glib/gmacros.h(824): error C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss
* meson: Make gettext optionalSeungha Yang2019-04-091-1/+4
| | | | gettext might not be available on Windows
* 2.66.12.66.1Claudio Saavedra2019-04-092-1/+15
|
* soup-auth-ntlm: get rid of unused variable warningClaudio Saavedra2019-04-091-2/+1
|
* Meson: Fallback to sqlite and libxml2 subprojectsJakub Adam2019-04-041-2/+4
| | | | | When not available in the system, those libraries can be downloaded from Wrap DB and built as subprojects.
* soup-auth-ntlm.c: Fix running on older Visual Studio CRTChun-wei Fan2019-03-301-0/+12
| | | | | | | | | | | | | This checks on Windows whether we have __USE_MINGW_ANSI_STDIO defined for MinGW builds or whether we are building with Visual Studio 2015 or later, as sscanf(..., "%2hhx", ...) would either fail to build or will fail to run correctly if either of these conditions do not hold on Windows, as the stock Windows (pre-Visual Studio 2015) CRT does not support the 'hh' modifier, as it is C99. If the sscanf() implementation on Windows does not support the 'hh' modifier, use a workaround so that we obtain the correct values we need from sscanf().
* meson: simplify test dependencies and bring back LD_LIBRARY_PATH workaroundClaudio Saavedra2019-03-191-3/+5
| | | | I was wrong to think that the workaround is not needed anymore.
* buildsystem: use MinGW ANSI STDIO when possibleРуслан Ижбулатов2019-03-181-0/+5
| | | | | | | Fixes the following error: libsoup-2.66.0/libsoup/soup-auth-ntlm.c:815:23: error: unknown conversion type character 'h' in format [-Werror=format=] sscanf(hex_pos, "%2hhx", &hmac[count]); ^
* meson: cleanup targets dependenciesClaudio Saavedra2019-03-182-6/+4
| | | | | | This fixes issues when adding new symbols and building with introspection enabled. Additionally, the workaround for tests seems to be unneeded.
* tests: disable parallelism in the proxy testClaudio Saavedra2019-03-151-1/+1
| | | | | | | | The proxy test uses apache, so it shouldn't run in parallel (see 5c1eea7). For some reason parallelism wasn't disabled for this test, causing random failures in CI. Fixes #142
* meson: fix dylib versioning on macOSTom Schoonjans2019-03-122-1/+8
|
* 2.66.02.66.0Claudio Saavedra2019-03-122-1/+5
|
* meson.build: Look for libxml2.lib correctly on Visual Studio buildsChun-wei Fan2019-03-071-1/+2
| | | | | | | On Visual Studio builds, it is not enough to look for 'xml2' for the library libxml2.lib, instead, we need to look for 'libxml2'. libxml2.lib is the library name that is produced by libxml2's NMake Makefiles.
* 2.65.922.65.92Claudio Saavedra2019-03-052-1/+12
|
* Remove stale .pc.in filesClaudio Saavedra2019-02-252-23/+0
| | | | Fixes #137
* message: Avoid use of deprecated g_type_class_add_privateMichael Catanzaro2019-02-251-34/+62
| | | | This is the only warning I see when building libsoup, so let's fix it.
* socket: Remove soup_socket_is_readable()Michael Catanzaro2019-02-252-12/+0
| | | | | I removed the only usage of this function in b609d44e so time for it to go.
* Update Dutch translationNathan Follens2019-02-241-47/+49
|
* connection: Fix logic error in previous commitMichael Catanzaro2019-02-221-6/+6
| | | | | | | | When there is no error at all, that is unexpected and we should disconnect. I mishandled it in the previous commit and Dan merged !42 before I fixed it. Related to: #134 and !42