| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
The spec says a new connection must be established and some servers
reply with a 400 Bad Request when reusing an existing connection.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
The GByteArray allocated in the beginning is not freed in case
of error.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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."
|
|
|
|
| |
When close message was already received from the server.
|
|
|
|
|
|
|
| |
RFC 6455:
The server MUST close the connection upon receiving a
frame that is not masked.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Passing data=NULL and length=0 which is consistent with g_bytes_new().
|
|
|
|
|
|
|
|
|
|
| |
(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.
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
Check the length of the decoded v2 challenge before attempting to
parse it, to avoid reading past it.
Fixes #173
|
| |
|
|
|
|
|
| |
This was already fixed for Unix like systems but it was still
possible to smuggle .. into a windows like server.
|
|
|
|
| |
This prevents all documentation to be indexed under S in the index.
|
|
|
|
|
| |
Use include_directories() instead of hardcoding it to make sure
that both its source and build directory are included.
|
|
|
|
| |
Forgot to change it in meson_options.txt
|
|
|
|
| |
This is the standard in GNOME currently.
|
| |
|
|
|
|
| |
meson does not allow compile with internal dependency (i.e., fallback dependency)
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
gettext might not be available on Windows
|
| |
|
| |
|
|
|
|
|
| |
When not available in the system, those libraries can be downloaded
from Wrap DB and built as subprojects.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
| |
I was wrong to think that the workaround is not needed anymore.
|
|
|
|
|
|
|
| |
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]);
^
|
|
|
|
|
|
| |
This fixes issues when adding new symbols and building with
introspection enabled. Additionally, the workaround for
tests seems to be unneeded.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Fixes #137
|
|
|
|
| |
This is the only warning I see when building libsoup, so let's fix it.
|
|
|
|
|
| |
I removed the only usage of this function in b609d44e so time for it to
go.
|
| |
|
|
|
|
|
|
|
|
| |
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
|