platform/upstream/libsoup.git
12 years agorequester-test: add an early-cancellation test
Dan Winship [Wed, 2 May 2012 14:33:20 +0000 (10:33 -0400)]
requester-test: add an early-cancellation test

12 years agoFix warnings/failures with messages that are cancelled from got-headers
Dan Winship [Wed, 2 May 2012 14:32:57 +0000 (10:32 -0400)]
Fix warnings/failures with messages that are cancelled from got-headers

https://bugzilla.gnome.org/show_bug.cgi?id=674747

12 years agosoup-auth-manager-ntlm: avoid some /usr/bin/ntlm_auth warnings
Dan Winship [Wed, 2 May 2012 13:25:51 +0000 (09:25 -0400)]
soup-auth-manager-ntlm: avoid some /usr/bin/ntlm_auth warnings

ntlm_auth sometimes spews errors that we don't care about, so use
G_SPAWN_STDERR_TO_DEV_NULL.

Also, the "PW" response ("no cached credentials, ask for a password
instead") can be returned in response to the type 3 message too, so
deal with it there (and don't print a warning, because it's not an
error).

12 years agoUpdated Romanian translation
Dumitru Mișu Moldovan [Wed, 2 May 2012 10:58:39 +0000 (13:58 +0300)]
Updated Romanian translation

12 years ago2.39.1 LIBSOUP_2_39_1
Dan Winship [Tue, 1 May 2012 13:10:27 +0000 (09:10 -0400)]
2.39.1

12 years agopo: Revert "Updated Telugu Translation"
Bastien Nocera [Mon, 30 Apr 2012 11:52:49 +0000 (12:52 +0100)]
po: Revert "Updated Telugu Translation"

The translation file is missing

This reverts commit b9196b0b627cfad96a063e14dddb7083ca5a4eb9.

12 years agoAdded nb
Kjartan Maraas [Mon, 30 Apr 2012 10:38:07 +0000 (12:38 +0200)]
Added nb

12 years agoAdded Norwegian bokmål translation
Kjartan Maraas [Mon, 30 Apr 2012 10:37:54 +0000 (12:37 +0200)]
Added Norwegian bokmål translation

12 years agoUpdated Telugu Translation
Sasi Bhushan [Mon, 30 Apr 2012 08:50:12 +0000 (14:20 +0530)]
Updated Telugu Translation

12 years agotests/get: use GProxyResolverDefault
Dan Winship [Wed, 25 Apr 2012 01:27:21 +0000 (21:27 -0400)]
tests/get: use GProxyResolverDefault

12 years agoReorganize proxy resolution, and support SOCKS and other proxy types
Dan Winship [Wed, 30 Nov 2011 18:16:36 +0000 (19:16 +0100)]
Reorganize proxy resolution, and support SOCKS and other proxy types

Push the proxy resolution code from SoupSession down into
SoupConnection and SoupSocket. If using a SoupProxyResolverDefault,
just enable proxy support on the GSocketClient instead (after adding
"http" as an application protocol). This way we get support for SOCKS
proxies (and any other proxies supported by GProxy types).

https://bugzilla.gnome.org/show_bug.cgi?id=553269

12 years agoMove SoupSocket stuff out of soup-message-io.c
Dan Winship [Fri, 20 Apr 2012 15:29:14 +0000 (11:29 -0400)]
Move SoupSocket stuff out of soup-message-io.c

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.

12 years ago[l10n] Added Indonesian translation
Andika Triwidada [Fri, 27 Apr 2012 13:57:16 +0000 (20:57 +0700)]
[l10n] Added Indonesian translation

12 years agosoup-client-input-stream: emit SoupMessage::got-chunk
Sergio Villar Senin [Tue, 24 Apr 2012 16:49:58 +0000 (18:49 +0200)]
soup-client-input-stream: emit SoupMessage::got-chunk

SoupClientInputStream will emit the got-chunk signal whenever data is read
from the stream. With that hack we keep the SoupCache working while it is
not proprely migrated to the new gio-based architecture.

https://bugzilla.gnome.org/show_bug.cgi?id=674732

12 years agoAdded Russian translation
Yuri Myasoedov [Mon, 23 Apr 2012 08:45:18 +0000 (12:45 +0400)]
Added Russian translation

12 years agoUpdated Hebrew translation.
Yaron Shahrabani [Sun, 22 Apr 2012 08:40:02 +0000 (11:40 +0300)]
Updated Hebrew translation.

12 years agoAdded sl for Slovenian translation
Matej Urbančič [Sat, 21 Apr 2012 10:55:33 +0000 (12:55 +0200)]
Added sl for Slovenian translation

12 years agoAdded Slovenian translation
Matej Urbančič [Sat, 21 Apr 2012 10:55:02 +0000 (12:55 +0200)]
Added Slovenian translation

12 years agoUpdated Polish translation
Piotr Drąg [Fri, 20 Apr 2012 19:27:22 +0000 (21:27 +0200)]
Updated Polish translation

12 years agoMake the new SoupSocket APIs private
Dan Winship [Fri, 20 Apr 2012 15:09:24 +0000 (11:09 -0400)]
Make the new SoupSocket APIs private

12 years agoAdded Galician translations
Fran Diéguez [Fri, 20 Apr 2012 08:48:44 +0000 (10:48 +0200)]
Added Galician translations

Signed-off-by: Fran Diéguez <fran.dieguez@mabishu.com>
12 years agoUpdated Spanish translation
Daniel Mustieles [Fri, 20 Apr 2012 08:46:50 +0000 (10:46 +0200)]
Updated Spanish translation

12 years agobelated version bump to 2.39.0
Dan Winship [Wed, 18 Apr 2012 15:01:59 +0000 (11:01 -0400)]
belated version bump to 2.39.0

12 years agosoup-cookie-jar: Add SoupCookieJar:is-persistent property
Carlos Garcia Campos [Mon, 26 Mar 2012 15:46:16 +0000 (17:46 +0200)]
soup-cookie-jar: Add SoupCookieJar:is-persistent property

It allows to query whether cookies are stored persisently by the
SoupCookieJar.

https://bugzilla.gnome.org/show_bug.cgi?id=672838

12 years agotests: add some more SoupRequester-based tests
Dan Winship [Thu, 12 Apr 2012 03:17:13 +0000 (23:17 -0400)]
tests: add some more SoupRequester-based tests

Add SoupRequester-based tests to redirect-test and add
SoupSessionSync-based tests to requester-test.

12 years agoSoupHTTPRequest: O brave new world!
Dan Winship [Thu, 26 Jan 2012 21:25:57 +0000 (16:25 -0500)]
SoupHTTPRequest: O brave new world!

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

12 years agosoup-message-io: move content sniffing out into a wrapper stream
Dan Winship [Thu, 8 Sep 2011 23:24:21 +0000 (19:24 -0400)]
soup-message-io: move content sniffing out into a wrapper stream

Add a wrapper input stream that handles content sniffing, and use that
from soup-message-io.

12 years agosoup-message-io: Use GConverterInputStream for content-decoding
Dan Winship [Thu, 23 Dec 2010 20:57:24 +0000 (15:57 -0500)]
soup-message-io: Use GConverterInputStream for content-decoding

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.

12 years agosoup-message-io: use gio streams rather than SoupSocket
Dan Winship [Wed, 8 Dec 2010 14:56:37 +0000 (15:56 +0100)]
soup-message-io: use gio streams rather than SoupSocket

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.

12 years agoAdd SoupFilterInputStream
Dan Winship [Sun, 15 Jan 2012 15:17:21 +0000 (10:17 -0500)]
Add SoupFilterInputStream

SoupFilterInputStream is basically a subset of GDataInputStream, plus
non-blocking read_line()/read_until().

Wrap the existing socket istream member with a SoupFilterInputStream,
and use its buffering rather than doing the buffering in SoupSocket.

12 years agoSoupSessionAsync: fix the GMainContext tracking
Dan Winship [Wed, 11 Apr 2012 17:17:15 +0000 (13:17 -0400)]
SoupSessionAsync: fix the GMainContext tracking

Using (non-reffed) GMainContexts as hash keys can mess up when a
context gets freed and then a new one is created at the same location
(in which case the session might think it has an idle_run_queue
queued, but it doesn't really). Reorganize the way this works to avoid
that problem.

12 years agoadd *.gmo to .gitignore
Dan Winship [Tue, 17 Apr 2012 22:12:43 +0000 (18:12 -0400)]
add *.gmo to .gitignore

12 years agoAdded Polish translation
Piotr Drąg [Tue, 17 Apr 2012 15:12:30 +0000 (17:12 +0200)]
Added Polish translation

12 years agoAdd gettext support
Dan Winship [Fri, 13 Apr 2012 00:17:06 +0000 (20:17 -0400)]
Add gettext support

There were already error messages in soup-request.c and
soup-requester.c marked for translation, and we'll be adding more
soon.

12 years ago2.38.1 LIBSOUP_2_38_1
Dan Winship [Mon, 16 Apr 2012 20:10:14 +0000 (16:10 -0400)]
2.38.1

12 years agosoup-request-file: Update the file-URI-parsing code
Dan Winship [Tue, 10 Apr 2012 21:16:51 +0000 (17:16 -0400)]
soup-request-file: Update the file-URI-parsing code

using g_file_new_from_uri() breaks a few edge cases. Go back to using
g_file_new_from_path(), and do the special win32 logic by hand.

https://bugs.webkit.org/show_bug.cgi?id=82484

12 years agosoup-session: unpause messages when cancelling them
Dan Winship [Wed, 11 Apr 2012 13:56:37 +0000 (09:56 -0400)]
soup-session: unpause messages when cancelling them

Otherwise paused messages get leaked when you abort the session.

https://bugzilla.gnome.org/show_bug.cgi?id=673905

12 years agosoup-session: fix up TLS/SSL property interactions
Dan Winship [Tue, 10 Apr 2012 17:31:45 +0000 (13:31 -0400)]
soup-session: fix up TLS/SSL property interactions

SoupSession:ssl-use-system-ca-file was broken, in that setting it to
either TRUE or FALSE would enable it. Fix that, and also fix up the
documentation and property notifications around that,
SoupSession:tls-database, and SoupSession:ssl-ca-file. Add a test to
tests/ssl-test to verify things.

https://bugzilla.gnome.org/show_bug.cgi?id=673678

12 years agoserver: keep a ref on the client context while clearing up
Jonny Lamb [Wed, 4 Apr 2012 00:54:25 +0000 (20:54 -0400)]
server: keep a ref on the client context while clearing up

We need to keep a ref on the client context struct for the duration of
the cleanup otherwise it will be disposed of before the
SoupSocket::disconnect callback is called, and that will dereference
the old client context pointer.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=673468

Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
12 years agoFix some problems with cancelling an async socket connect op
Dan Winship [Mon, 2 Apr 2012 13:56:37 +0000 (09:56 -0400)]
Fix some problems with cancelling an async socket connect op

Cancelling a message while it was still connecting could result in an
(erroneous) warning about "disposing socket while still connected", or
an (accurate) warning about passing NULL to
g_tls_connection_handshake_finish(). Fix both of these.

Pointed out on the mailing list by Sven Neumann.

12 years agosoup-connection.c: do not unref the socket twice while disconnecting
Sergio Villar Senin [Wed, 28 Mar 2012 08:29:49 +0000 (10:29 +0200)]
soup-connection.c: do not unref the socket twice while disconnecting

Reentrant calls to soup_socket_disconnect() when disconnecting the socket
lead to double disconnections and double unref of the same SoupSocket.

https://bugzilla.gnome.org/show_bug.cgi?id=672178

12 years ago2.38.0 LIBSOUP_2_38_0
Dan Winship [Mon, 26 Mar 2012 19:56:56 +0000 (15:56 -0400)]
2.38.0

12 years agogtk-doc fixes
Dan Winship [Mon, 26 Mar 2012 19:56:37 +0000 (15:56 -0400)]
gtk-doc fixes

12 years ago2.37.92 LIBSOUP_2_37_92
Dan Winship [Mon, 19 Mar 2012 21:47:32 +0000 (17:47 -0400)]
2.37.92

12 years agosoup-session.c: add soup_session_prefetch_dns
Sergio Villar Senin [Wed, 14 Mar 2012 10:00:04 +0000 (11:00 +0100)]
soup-session.c: add soup_session_prefetch_dns

This deprecates soup_session_prepare_for_uri(). It basically does the same,
i.e., it lets the session prepare for a possible upcoming request by doing
DNS resolution. It additionally has cancellation support and adds a callback
to notify the caller when the operation finishes.

https://bugs.webkit.org/show_bug.cgi?id=41630

12 years ago2.37.91 LIBSOUP_2_37_91
Dan Winship [Mon, 5 Mar 2012 23:21:36 +0000 (18:21 -0500)]
2.37.91

12 years agoUse G_GNUC_BEGIN_IGNORE_DEPRECATIONS (where available)
Dan Winship [Sun, 19 Feb 2012 00:41:48 +0000 (19:41 -0500)]
Use G_GNUC_BEGIN_IGNORE_DEPRECATIONS (where available)

The XMLRPC API uses GValueArray, so ignore deprecation warnings about
that.

12 years agoconnection-test, requester-test: test non-persistent connections
Dan Winship [Sun, 4 Mar 2012 15:23:20 +0000 (10:23 -0500)]
connection-test, requester-test: test non-persistent connections

Make sure non-persistent connections are closed by the time we finish
processing the request.

12 years agotests: split connection-test out of misc-test
Dan Winship [Sun, 4 Mar 2012 15:07:49 +0000 (10:07 -0500)]
tests: split connection-test out of misc-test

12 years agosoup-session: don't mark CONNECTING connections IDLE on cancel
Dan Winship [Thu, 1 Mar 2012 16:34:37 +0000 (11:34 -0500)]
soup-session: don't mark CONNECTING connections IDLE on cancel

When finishing up a queue item, SoupSession was always marking its
connection IDLE, even if it had previously been CONNECTING. This
created a race condition where if lots of pending connections were
cancelled at once, some of them might see connections labelled IDLE
that didn't actually have a SoupSocket (before those connections got
asynchronously cleaned up). Fix this by only marking connections IDLE
if they had previously been IN_USE.

https://bugzilla.gnome.org/show_bug.cgi?id=667245

12 years agorequester-test: add some more tests
Dan Winship [Tue, 31 Jan 2012 00:15:50 +0000 (19:15 -0500)]
requester-test: add some more tests

Make sure that chunked encoding and failed auth work correctly

12 years agoSoupURI: fix fallback handling of soup_uri_set_path(uri, NULL)
Dan Winship [Sat, 25 Feb 2012 13:54:58 +0000 (08:54 -0500)]
SoupURI: fix fallback handling of soup_uri_set_path(uri, NULL)

In the old code, if you set a URI's path to NULL and then did
soup_uri_to_string(uri, FALSE), you'd get back a path of "/". Fix the
new code to behave the same way (and test it).

https://bugzilla.gnome.org/show_bug.cgi?id=670431

12 years agoSoupAuthManagerNTLM: fix don't-fallback-to-Basic code
Dan Winship [Fri, 24 Feb 2012 19:50:52 +0000 (14:50 -0500)]
SoupAuthManagerNTLM: fix don't-fallback-to-Basic code

Sessions using NTLM should never fall back to using Basic auth to
access a resource which advertises NTLM auth. But ntlm-test wasn't
actually testing this, and it broke at some point. Fix that, and
add tests to ntlm-test.

12 years agoSoupRequestFile: fix handling of URIs with query components
Dan Winship [Fri, 24 Feb 2012 16:55:45 +0000 (11:55 -0500)]
SoupRequestFile: fix handling of URIs with query components

At the moment, gio mishandles file: URIs with query components,
so strip them out before passing the URI to gio.

Also remove some useless code from an earlier incarnation of
SoupRequestFile.

12 years agoMakefile.glib: Fix locale-specific issues
Priit Laes [Fri, 24 Feb 2012 10:00:20 +0000 (12:00 +0200)]
Makefile.glib: Fix locale-specific issues

When using Estonian (et_EE) locale, 'a-z' range skips 'tuv...'

https://bugzilla.gnome.org/show_bug.cgi?id=654395

12 years agosoup-message-io: prevent a possible out-of-bounds memory access
Dan Winship [Wed, 22 Feb 2012 18:29:55 +0000 (13:29 -0500)]
soup-message-io: prevent a possible out-of-bounds memory access

12 years ago2.37.90 LIBSOUP_2_37_90
Dan Winship [Mon, 20 Feb 2012 23:04:47 +0000 (18:04 -0500)]
2.37.90

12 years agoSoupCache: some issues in SoupCache (3/3)
Sergio Villar Senin [Fri, 27 Jan 2012 17:56:21 +0000 (18:56 +0100)]
SoupCache: some issues in SoupCache (3/3)

Check that cache control is not blank to prevent some criticals.

https://bugzilla.gnome.org/show_bug.cgi?id=668865

12 years agoSoupCache: some issues in SoupCache (2/3)
Sergio Villar Senin [Fri, 27 Jan 2012 15:24:56 +0000 (16:24 +0100)]
SoupCache: some issues in SoupCache (2/3)

Do not generate conditional requests to revalidate resources if the server
has not provided neither "Last-Modified" nor "ETag" because the conditional
request could not be properly constructed in that case, and thus, we will
end up issuing two requests for the same resource.

https://bugzilla.gnome.org/show_bug.cgi?id=668865

12 years agoSoupCache: some issues in SoupCache (1/3)
Sergio Villar Senin [Fri, 27 Jan 2012 13:06:41 +0000 (14:06 +0100)]
SoupCache: some issues in SoupCache (1/3)

Respect section 13.9 from specs. Resources whose URL has a query and do not
have expiration time provided by the server must not be cached.

https://bugzilla.gnome.org/show_bug.cgi?id=668865

12 years agoSoupSessionAsync: don't queue idles from dispose()
Dan Winship [Tue, 14 Feb 2012 03:05:43 +0000 (22:05 -0500)]
SoupSessionAsync: don't queue idles from dispose()

SoupSession does a soup_session_abort() from dispose(), which had the
effect in SoupSessionAsync of queueing an idle (to check if new
messages could be sent now that old connections had been closed). This
causes problems if the session was disposed from a thread other than
the one that its GMainContext is running in, which is weird, and also
incompatible with some garbage-collected runtimes. So fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=667364

12 years agosoup-message-server-io: fix processing of IPv6 HTTP/1.0 messages
Dan Winship [Tue, 14 Feb 2012 02:38:39 +0000 (21:38 -0500)]
soup-message-server-io: fix processing of IPv6 HTTP/1.0 messages

When receiving an HTTP/1.0 message with no Host header on an IPv6
interface, SoupServer would internally generate an invalid URL and
then return 400 Bad Request. Fix, and add a test for it.

https://bugzilla.gnome.org/show_bug.cgi?id=666399

12 years agosoup_form_decode_multipart: check that msg really is a non-NULL message
Simon McVittie [Wed, 8 Feb 2012 10:05:02 +0000 (10:05 +0000)]
soup_form_decode_multipart: check that msg really is a non-NULL message

If it wasn't, the next line would segfault anyway.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agosoup_form_decode_multipart: allow file_control_name to be NULL as documented
Simon McVittie [Wed, 8 Feb 2012 10:03:42 +0000 (10:03 +0000)]
soup_form_decode_multipart: allow file_control_name to be NULL as documented

This was documented as allowed, but would have crashed.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agovalgrind run...
Dan Winship [Sun, 12 Feb 2012 14:21:09 +0000 (09:21 -0500)]
valgrind run...

12 years agosoup-uri: revert some of the previously-added return-if-fails
Dan Winship [Thu, 9 Feb 2012 14:35:00 +0000 (09:35 -0500)]
soup-uri: revert some of the previously-added return-if-fails

Although it has always been documented that a SoupURI must have a
non-NULL path, nothing ever enforced this, and most methods checked
whether it was NULL before looking at it anyway. So lots of existing
code was getting this wrong, and is now breaking because of the
"g_return_if_fail (SOUP_URI_IS_VALID (uri))" checks.

So, change most of those to just g_warn_if_fail() (while adding back
the old return-if-fail !NULL checks), but also fix soup_uri_set_path()
and soup_uri_new_with_base() to handle NULL paths more sanely (after
warning). Also, allow calling the getters on invalid URIs.

Add a new test to uri-testing to make sure that URIs created with
soup_uri_new(NULL) behave as expected at each step of the way...

https://bugzilla.gnome.org/show_bug.cgi?id=667637

12 years agosoup-uri: fix the scheme parsing to require alpha, not alphanumeric
Dan Winship [Thu, 9 Feb 2012 22:00:52 +0000 (17:00 -0500)]
soup-uri: fix the scheme parsing to require alpha, not alphanumeric

also remove an ancient comment about running the regression tests,
since it's implied everywhere now.

12 years agoMakefile.glib: fix for make earlier than 3.82
Dan Winship [Wed, 8 Feb 2012 21:05:34 +0000 (16:05 -0500)]
Makefile.glib: fix for make earlier than 3.82

12 years agoUse Makefile.glib
Dan Winship [Fri, 3 Jun 2011 22:29:59 +0000 (18:29 -0400)]
Use Makefile.glib

Test drive Makefile.glib from bug 654395 (excepted distributed with
the tarball rather than using one installed with glib).

12 years agosoup_form_decode_multipart: document all (out) parameters as nullable
Simon McVittie [Wed, 8 Feb 2012 10:00:58 +0000 (10:00 +0000)]
soup_form_decode_multipart: document all (out) parameters as nullable

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479

12 years agotests: sniffing: Avoid loop with uninitialised length
Robert Swain [Tue, 31 Jan 2012 12:58:56 +0000 (13:58 +0100)]
tests: sniffing: Avoid loop with uninitialised length

[This would only happen if a request was made to an unhandled path,
which this test doesn't do, but it seems reasonable to return an empty
response rather than crashing. -smcv]

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Bug-NB: NB#297634

12 years agotests: simple-httpd: Don't leak index_path string
Robert Swain [Tue, 31 Jan 2012 12:52:37 +0000 (13:52 +0100)]
tests: simple-httpd: Don't leak index_path string

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Bug-NB: NB#297634

12 years agoSafeguard against NULL in strcmp
Mark Nauwelaerts [Tue, 31 Jan 2012 11:02:45 +0000 (12:02 +0100)]
Safeguard against NULL in strcmp

[In both of these cases, the situation being guarded against is:
check_password() is called, but soup_message_headers_get_one() does not find
an "Authorization" header. -smcv]

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Bug-NB: NB#297634

12 years agoform: Check file pointer before dereferencing
Robert Swain [Tue, 31 Jan 2012 13:27:38 +0000 (14:27 +0100)]
form: Check file pointer before dereferencing

[It's not documented as being allowed to be NULL, but later in the
function there's a check, and GLib convention is generally that all
'out' parameters are allowed to be NULL whether it makes sense or not. -smcv]

Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=669479
Bug-NB: NB#297634

12 years ago2.37.5 LIBSOUP_2_37_5
Dan Winship [Mon, 6 Feb 2012 22:19:26 +0000 (17:19 -0500)]
2.37.5

12 years agosoup_uri_new: do not allow invalid URIs to be returned, except via soup_uri_new ...
Simon McVittie [Tue, 10 Jan 2012 13:51:31 +0000 (13:51 +0000)]
soup_uri_new: do not allow invalid URIs to be returned, except via soup_uri_new (NULL)

Also document the possible NULL return.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977

12 years agoSoupURI: add SOUP_URI_IS_VALID() and use it for basic precondition checks
Simon McVittie [Fri, 3 Feb 2012 14:13:32 +0000 (14:13 +0000)]
SoupURI: add SOUP_URI_IS_VALID() and use it for basic precondition checks

In this patch, field setters don't have precondition checks for the
validity of the URI object itself, only a non-NULL check, to avoid
breaking existing code if it calls soup_uri_new (NULL) and then sets
fields in an unexpected order:

    uri = soup_uri_new (NULL);                    /* uri is invalid */
    soup_uri_set_host (uri, "www.google.com");
    soup_uri_set_query (uri, "q=badgers");
    soup_uri_set_scheme (uri, "http");            /* still invalid... */
    soup_uri_set_path (uri, "/search");           /* finally valid */

Also annotate nullable setter parameters as (allow-none), to justify
why they don't have a precondition check.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977

12 years agosoup_uri_copy_host: always set the path to something non-NULL
Simon McVittie [Fri, 3 Feb 2012 17:47:54 +0000 (17:47 +0000)]
soup_uri_copy_host: always set the path to something non-NULL

Not doing so is considered to be invalid.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977

12 years agoSoupProxyResolver: construct a valid SoupURI
Simon McVittie [Fri, 3 Feb 2012 17:47:16 +0000 (17:47 +0000)]
SoupProxyResolver: construct a valid SoupURI

path = NULL is not considered valid.

Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977

12 years agoTry to make file:// uris work in win32 too
Paweł Forysiuk [Fri, 3 Feb 2012 15:50:44 +0000 (16:50 +0100)]
Try to make file:// uris work in win32 too

12 years agouri-parsing test: add a case that was exercised by a protocol fuzzer
Simon McVittie [Fri, 3 Feb 2012 14:20:43 +0000 (14:20 +0000)]
uri-parsing test: add a case that was exercised by a protocol fuzzer

This was suspected to cause a crash via a NULL path; while it seems it
doesn't actually have that problem, it still seems worth testing.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
12 years agouri-parsing test: verify that URIs are split correctly
Simon McVittie [Fri, 3 Feb 2012 14:19:28 +0000 (14:19 +0000)]
uri-parsing test: verify that URIs are split correctly

Testing the round-trip (split + reassemble) is necessary, but not
sufficient: a large proportion of SoupURI's API is in terms of the
separate parts, and this was never explicitly tested before.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
12 years agosoup_uri_new: annotate uri_string as nullable
Simon McVittie [Fri, 3 Feb 2012 13:51:53 +0000 (13:51 +0000)]
soup_uri_new: annotate uri_string as nullable

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agoSoupServer: reject non-HTTP URIs and URIs with no host
Simon McVittie [Tue, 10 Jan 2012 17:03:39 +0000 (17:03 +0000)]
SoupServer: reject non-HTTP URIs and URIs with no host

This prevents a critical warning and other misbehaviour in the
simple-httpd test, when using requests like "GET http: HTTP/1.0".

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agoHeader parsing test: verify that a full URI can appear after the "GET"
Simon McVittie [Tue, 10 Jan 2012 15:56:08 +0000 (15:56 +0000)]
Header parsing test: verify that a full URI can appear after the "GET"

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agosoup_uri_uses_default_port: correct documentation
Simon McVittie [Tue, 10 Jan 2012 13:51:47 +0000 (13:51 +0000)]
soup_uri_uses_default_port: correct documentation

We now know the default for ftp, too.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agoSoupURI: give "foo:" a non-NULL path member
Simon McVittie [Tue, 10 Jan 2012 13:20:38 +0000 (13:20 +0000)]
SoupURI: give "foo:" a non-NULL path member

SoupURI documents uri->path as being required, and got_headers in
SoupServer assumes that it's non-NULL, but in fact parsing a URI
consisting solely of a scheme ("foo:") would leave path = NULL.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667637
Bug-NB: NB#294977
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Dan Winship <danw@gnome.org>
12 years agorequester-test: add some more tests
Dan Winship [Mon, 30 Jan 2012 23:55:40 +0000 (18:55 -0500)]
requester-test: add some more tests

Make sure that content-sniffing and redirections work

12 years agochunk-test: add a check that wrote-body-data gives the right data
Dan Winship [Fri, 27 Jan 2012 18:25:24 +0000 (13:25 -0500)]
chunk-test: add a check that wrote-body-data gives the right data

(This was already working, but not tested, on master, but it was
broken on a work branch.)

12 years agoSoupHTTPInputStream: don't burn through GCancellable fds
Dan Winship [Mon, 23 Jan 2012 17:34:12 +0000 (12:34 -0500)]
SoupHTTPInputStream: don't burn through GCancellable fds

SoupSession limits the number of outgoing TCP connections, but
SoupRequestHTTP/SoupHTTPInputStream were still using a file descriptor
for the GCancellable of each request that got queued, even before it
was sent. This meant that if the app queued 1000ish requests all at
once (eg, while rendering an HTML page with *lots* of images), we
would run out of file descriptors.

Fix this by just using the GCancellable::cancelled signal rather than
g_cancellable_get_fd().

https://bugzilla.gnome.org/show_bug.cgi?id=668508

12 years agoSoupSession: Do not actually send a request if it was cancelled before.
Raphael Kubo da Costa [Tue, 17 Jan 2012 14:30:48 +0000 (12:30 -0200)]
SoupSession: Do not actually send a request if it was cancelled before.

soup_session_cancel_message() may have been called in a REQUEST_STARTED
callback, so it is safer to make sure that
soup_connection_send_request() is called only if that is not the case.

https://bugzilla.gnome.org/show_bug.cgi?id=668098

12 years agopost-release version bump
Dan Winship [Tue, 17 Jan 2012 19:34:41 +0000 (14:34 -0500)]
post-release version bump

12 years agosoup-message-io: make soup_message_io_unpause() obey use-thread-context
Dan Winship [Tue, 17 Jan 2012 19:02:46 +0000 (14:02 -0500)]
soup-message-io: make soup_message_io_unpause() obey use-thread-context

12 years ago2.37.4 LIBSOUP_2_37_4
Dan Winship [Mon, 16 Jan 2012 23:50:01 +0000 (18:50 -0500)]
2.37.4

12 years agoBelatedly add regression test for CVE-2011-2524
Dan Winship [Mon, 16 Jan 2012 23:09:22 +0000 (18:09 -0500)]
Belatedly add regression test for CVE-2011-2524

https://bugzilla.gnome.org/show_bug.cgi?id=667635

12 years agosoup-request-http: plug leak
Xan Lopez [Sun, 1 Jan 2012 18:12:28 +0000 (19:12 +0100)]
soup-request-http: plug leak

The content type of the request is never freed.

https://bugzilla.gnome.org/show_bug.cgi?id=667099

12 years agoconfigure.ac: bump glib requirement to 2.31.7 for GSocketClientEvent
Dan Winship [Thu, 22 Dec 2011 20:53:36 +0000 (15:53 -0500)]
configure.ac: bump glib requirement to 2.31.7 for GSocketClientEvent

12 years agoSoupMessage: add network-event signal
Dan Winship [Thu, 8 Dec 2011 16:34:20 +0000 (11:34 -0500)]
SoupMessage: add network-event signal

Proxy the new GSocketClient::event signal and emit it on SoupMessage,
when relevant, to allow (a) debugging, (b) status messages, (c) request
timing, (d) fiddling with sockets

12 years agoSoupConnection: belatedly fix up unix-only code
Dan Winship [Wed, 7 Dec 2011 22:03:19 +0000 (17:03 -0500)]
SoupConnection: belatedly fix up unix-only code

The last-minute-check-if-the-socket-has-been-closed-by-the-server code
was written long ago to use soup_socket_get_fd() and g_poll(), and so
was unix-only, but now that SoupSocket is GSocket-based, we can use
g_socket_condition_check() instead.

12 years agoForce some SoupMessages to use a fresh SoupConnection
Dan Winship [Wed, 7 Dec 2011 21:53:26 +0000 (16:53 -0500)]
Force some SoupMessages to use a fresh SoupConnection

Add a new SOUP_MESSAGE_NEW_CONNECTION flag, and insist on getting a
brand new SoupConnection for any message that has that flag set, or
that uses a non-idempotent method.

Add a test to misc-test for this.

https://bugzilla.gnome.org/show_bug.cgi?id=578990