| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
When using chunked encoding, SoupBodyOutputStream needs to write the
final "0" chunk when it's closed, and thus may block. So we have to do
an async close in the non-blocking case.
(Does not currently pass "make check".)
https://bugzilla.gnome.org/show_bug.cgi?id=727138
|
| |
|
|
|
|
| |
Let the callback know whether I/O completed on the message, and move
the server-side "disconnect on I/O error" code from soup-message-io to
soup-server.
|
| |
|
|
|
|
|
|
|
|
| |
g_input/output_stream_close() always mark their stream closed, even on
error, even if their cancellable is pre-cancelled. That means we have
to guarantee that soup_message_io_finished() gets called when a
SoupClientInputStream is closed, even if an error occurs while
closing.
https://bugzilla.gnome.org/show_bug.cgi?id=711260
|
| | |
|
| |
|
|
|
|
|
|
| |
When closing the stream early, we should be skipping the read state
ahead to FINISHING, rather than BODY_DONE, so that got_body doesn't
get emitted (thus causing the connection to mark itself reusable).
https://bugzilla.gnome.org/show_bug.cgi?id=710494
|
| |
|
|
|
|
|
|
|
|
| |
Closing a SoupClientInputStream for a message that hadn't been
completely read was trying to read to the end of the message first.
Fix it to just cancel the read instead.
Also fix a few tests that were implicitly assuming the old behavior.
https://bugzilla.gnome.org/show_bug.cgi?id=695652
|
| |
|
|
|
|
|
|
|
| |
Messages sent via soup_session_queue_message() on a plain SoupSession
accidentally ended up using blocking I/O. Fix this (and also make
switching between sync and async ops during a streaming operation work
better).
https://bugzilla.gnome.org/show_bug.cgi?id=707711
|
| |
|
|
| |
Closes: https://bugzilla.gnome.org/show_bug.cgi?id=703461
|
| |
|
|
|
|
|
|
| |
soup_message_io_stop() was unreffing unpause_source (if it was set),
but it didn't actually own a ref on it, so this would crash.
Fortunately this would only happen if you unpaused a message and then
immediately cancelled it, which isn't very common. Fixes a sporadic
chunk-test crash though.
|
| |
|
|
|
| |
In cases where the SoupMessage API would return SOUP_STATUS_MALFORMED,
return a clearer GError in the SoupRequest API.
|
| |
|
|
|
| |
Rather than relying on soup-message-io to tell us when a connection
can be reused, track it directly within SoupConnection.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SoupContentSniffer
soup-message-io uses the content processors registered for each SoupMessage
to properly setup the stack of streams used to read a particular resource
either downloaded from the network or read from a local cached file. Note
that server-side messages do not have content processor support yet.
SoupContentDecoder becomes a content processor and wraps the given base
stream with a list of decoders when required.
SoupContentSniffer becomes a content processor working at the
SOUP_STAGE_BODY_DATA stage.
https://bugzilla.gnome.org/show_bug.cgi?id=682112
|
| |
|
|
|
|
|
|
| |
SoupBodyInputStream implements now the GSeekable interface. It does not
longer require a SoupFilterInputStream as base stream unless the encoding is
SOUP_ENCODING_CHUNKED.
https://bugzilla.gnome.org/show_bug.cgi?id=665884
|
| | |
|
| |
|
|
|
|
|
|
| |
Rather than disconnecting the connection from soup_message_io_stop()
if the message didn't complete, do it from
SoupConnection:clear_current_item(). This makes it DTRT even if the
SoupMessageQueueItem loses its connection before
soup_message_io_stop() gets called.
|
| |
|
|
|
|
|
|
|
| |
The retry-if-the-server-closes-the-connection-immediately code was
only getting run in the SoupMessage API codepaths. Fit it into the
right place in the SoupRequest paths too, and test that from
connection-test.
Might fix https://bugzilla.gnome.org/show_bug.cgi?id=679527 ?
|
| |
|
|
|
|
|
|
| |
Especially, include soup.h rather than individually including a bunch
of other public soup-*.h files.
Remove unnecessary system includes (many are leftovers from code that
has moved down into glib).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
io_run() passes io->cancellable to io_run_until(), but io may be
destroyed (and cancellable unreffed) before io_run_until() returns,
causing it to eventually call g_cancellable_is_cancelled() on garbage.
Fix by reffing it around the io_run_until() call (though really this
is just another example of "SoupMessageIOData needs to be
refcounted".)
Tweak misc-test to test this case.
Fixes crasher in rygel test case. Based on a patch from Ray Strode.
https://bugzilla.gnome.org/show_bug.cgi?id=676038
|
| |
|
|
|
|
|
|
|
| |
io_run_until forgets to release a reference it takes
in a cancellation error path.
This commit fixes that.
https://bugzilla.gnome.org/show_bug.cgi?id=676038
|
| |
|
|
|
|
|
|
| |
In order to do async authentication, we need to stop the processing of
the request during the soup_request_send_async() call. So re-enable
soup_session_pause_message() for that case. Possibly to be revisited.
https://bugzilla.gnome.org/show_bug.cgi?id=675306
|
| | |
|
| | |
|
| |
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=674747
|
| |
|
|
|
|
| |
Add a new SoupIOStream, which wraps the SoupFilterInputStream and
GOutputStream that SoupSocket exposes. Pass that to soup-message-io
rather than the SoupSocket, and update various other things for this.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Kill SoupHTTPInputStream, and have SoupHTTPRequest return the
message's body_istream directly (with a little help from SoupSession
and its subclasses). SoupHTTPRequest works synchronously now as well
(though it's still the case that async only works with
SoupSessionAsync and sync only works with SoupSessionSync).
https://bugzilla.gnome.org/show_bug.cgi?id=591739
|
| |
|
|
|
| |
Add a wrapper input stream that handles content sniffing, and use that
from soup-message-io.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Decode Content-Encodings by wrapping a GConverterInputStream around
the SoupBodyInputStream.
Because we want to be able to fall back to passing data through
undecoded in the case that decoding fails, we need to use a GConverter
wrapper (SoupConverterWrapper) that implements that.
The old soup-message-io code was automatically stopping decompression
when it reached the end of the response body, without checking that
the compressed data was actually whole at that point. Fix that.
However, this breaks the previous hack used for the zlib-to-raw
fallback, since the raw data won't have a checksum at the end.
So do that differently now.
|
| |
|
|
|
|
|
|
|
|
|
| |
Use the socket's input/output streams for the base I/O, and add new
SoupBodyInputStream and SoupBodyOutputStream that can be created from
them to handle the body of a single message (including handling
chunked encoding/decoding).
Update chunk-test, which was assuming that the chunk_allocator
callback would never be called if the message had a 0-length body;
that's no longer true.
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Claim that we support both gzip and deflate content encodings. Added support
to handle data compressed with deflate with and without zlib headers.
https://bugzilla.gnome.org/show_bug.cgi?id=661682
|
| |
|
|
|
|
|
|
| |
In particular, make sure it gets set when a connection fails, so that
soup_message_get_https_status() on the message will tell you *why* it
failed.
Also, update tests/get to display the tls-certificate-errors
|
| |
|
|
|
|
|
|
|
|
| |
Now that we have GTlsFileDatabase, we can use that to validate
certificates when the caller sets SoupSession:ssl-ca-file, rather than
doing it the slow hacky way we had been.
Also, add two new properties, SoupSession:tlsdb, to set an arbitrary
GTlsDatabase on the session, and SoupSession:use-system-ca-file, to
tell it to use the default GTlsDatabase.
|
| |
|
|
|
|
|
|
|
| |
Connection should be set to IDLE state only after being 100% sure that is
not going to be reused by the current owner.
Also, fix a bug in SoupSessionSync revealed by this change.
https://bugzilla.gnome.org/show_bug.cgi?id=651146
|
| |
|
|
|
|
|
|
|
| |
Now that the TLS handshake occurs during connection, the socket
properties are set before we get to soup-message-io (and never
change), so copy them to the message right away rather than waiting
for a property notification.
https://bugzilla.gnome.org/show_bug.cgi?id=611496
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Long ago, soup_message_body_set_accumulate() was made into a no-op on
request bodies, because otherwise there would be no body available to
send if the request was restarted. Add a SOUP_MESSAGE_CAN_REBUILD
flag, that indicates that the caller takes responsibility for handling
this, and properly discard chunks if that is set.
Also update chunk-test to test this, and (finally!) remove the FIXME
there, since we are now testing the !accumulate codepath again
properly.
https://bugzilla.gnome.org/show_bug.cgi?id=656650
|
| |
|
|
|
|
|
|
| |
is set"
This broke tests/proxy-test.
This reverts commit c56c66aa2625bc95f54f8a1972e13503f454a51a.
|
| |
|
|
|
|
| |
Fixes a bug serving large files, eg, in Rygel.
https://bugzilla.gnome.org/show_bug.cgi?id=638468
|
| |
|
|
|
|
|
|
| |
Do not reuse the SoupConnection we used for the first time when
a SoupMessage gets redirected as it could have been assigned to a different
SoupMessage meanwhile.
https://bugzilla.gnome.org/show_bug.cgi?id=651146
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Cancelling a message from another thread had some race conditions that
could sometimes cause crashes. Fix things up a bit by using
GCancellable to interrupt the I/O, rather than calling
soup_message_io_finished() directly.
Also added a test for this case to tests/misc-test, although
unfortunately due to the raciness of the bug, it only failed
sporadically even before the fix (but seems to fail never now).
https://bugzilla.gnome.org/show_bug.cgi?id=637741
|
| |
|
|
|
|
|
|
|
| |
The IO code was explicitly handling the SoupSocket::disconnect signal,
but this is actually redundant; if the socket gets disconnected we'll
get either an error (if writing) or an eof (if reading), and the code
will do the right thing with that. Watching ::disconnected too just
results in processing the same error twice and having to be extra
careful to do it idempotently.
|
| |
|
|
|
| |
also add a new test to coding-test for handling content that
doesn't decode correctly
|
| |
|
|
|
| |
Use the new GTlsConnection:peer-certificate semantics to guarantee we
set the certificate on the message as soon as it's been accepted.
|
| |
|
|
|
| |
These provide more information about the certificate on the other end of
a TLS connection.
|
| |
|
|
| |
and remove libsoup's built-in TLS support, which is no longer needed
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When sending a request on a previously-used connection, we have to
deal with the possibility of the server deciding to time out the
connection right as we start sending data (which sounds like a crazy
race condition, but is in fact pretty much standard behavior). This
got broken in the connection/session reorg earlier in the year. Fix
it.
Also, add a test to misc-test for this.
Based on patch from Sergio Villar.
https://bugzilla.gnome.org/show_bug.cgi?id=631525
|
| |
|
|
|
|
|
| |
Some servers fail to send the final 0-length chunk when allegedly doing
chunked encoding. Browsers cope. Now we do too.
https://bugzilla.gnome.org/show_bug.cgi?id=629160
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously we just ignored Content-Length if the server specified
"Connection: close", which does the right thing if the specified
Content-Length is too large, but fails if the Content-Length is
correct but the server "forgets" to close the connection. Fix this so
that we always stop reading once we get to the expected
Content-Length, but we also cope with the connection closing before
that point.
https://bugzilla.gnome.org/show_bug.cgi?id=611481
|
| |
|
|
|
|
|
| |
After the too-many-redirects merge, redirect-test was leaking a queue
item, because cancelling a message at the point it does resulted in
the completion_cb never running. Fix soup_session_cancel_message()
(again) to not have this problem.
|