platform/upstream/libsoup.git
15 years agoMake SOUP_SESSION_TIMEOUT also affect async connection
Mark Nauwelaerts [Mon, 13 Jul 2009 00:19:16 +0000 (20:19 -0400)]
Make SOUP_SESSION_TIMEOUT also affect async connection

http://bugzilla.gnome.org/show_bug.cgi?id=588177

15 years agoFix a content-sniffer crash with redirected URLs
Dan Winship [Sun, 12 Jul 2009 16:22:45 +0000 (12:22 -0400)]
Fix a content-sniffer crash with redirected URLs

SoupMessageHeaders was not properly cleaning up the cached
Content-Type when a request was redirected, which meant that if the
redirected-to URL had no Content-Type header, then
soup_message_headers_get_content_type() would return the Content-Type
of the original request, but
soup_message_headers_get_one("Content-Type") would return NULL,
causing the sniffer to crash.

http://bugzilla.gnome.org/show_bug.cgi?id=588335

15 years agoMiscellaneous content-sniffing fixes
Dan Winship [Fri, 10 Jul 2009 17:11:07 +0000 (13:11 -0400)]
Miscellaneous content-sniffing fixes

Remove the should_sniff_content flag; if there is a sniffer, we always
sniff.

Clean up soup-message-io a bit to require fewer special cases, and fix
a few potential leaks/crashes where it wasn't dealing with
IF_CANCELLED_OR_PAUSED correctly. (Although this looks like a large
patch, it actually results in a much smaller diff relative to 2.26.

Fix tests/sniffing-test to do chunked encoding correctly, make sure to
return data in chunks that are smaller than the sniffing buffer size,
and make resources/mbox larger than the sniffing buffer size so it
takes multiple reads to get enough data (when using chunked encoding).
Also add tests for empty response bodies (from Gustavo).

http://bugzilla.gnome.org/show_bug.cgi?id=587907

15 years agoActually test chunked encoding, and fix some hangs
Gustavo Noronha Silva [Fri, 10 Jul 2009 13:29:28 +0000 (14:29 +0100)]
Actually test chunked encoding, and fix some hangs

The test was not really testing chunked encoding, because of incorrect
handling of the query string in the SoupURI, now it does. This has
exposed a couple hangs.

This change also avoids hanging on chunked encoding messages on the
sniffing test by calling soup_message_body_complete(), and by
sanitizing IO read state and read_length inconditionally when we reach
got_body, during message IO.

15 years agoFix the SOUP_METHOD_* and SOUP_URI_SCHEME_* defines to be threadsafe
Dan Winship [Fri, 3 Jul 2009 01:28:53 +0000 (21:28 -0400)]
Fix the SOUP_METHOD_* and SOUP_URI_SCHEME_* defines to be threadsafe

Also fix/optimize a few other things in URI scheme canonicalization

15 years agoImplement content sniffing
Gustavo Noronha Silva [Wed, 17 Jun 2009 23:53:17 +0000 (20:53 -0300)]
Implement content sniffing

The implementation is based on the draft spec on Content-Type
Processing Model (draft-abarth-mime-sniff-01). It is a spinoff from
the HTML5 spec.

Soup now provides a SoupContentSniffer session feature, which hooks
into the message I/O, and delays emissions of the got-chunk signal to
be able to figure out the Content-Type of messages from the actual
content received, in some cases.

GIO is also used to sniff content, whenever the spec allows further
sniffing.

http://bugzilla.gnome.org/show_bug.cgi?id=572589

15 years agoRequire explicit --disable-ssl to build without GNUTLS support
Dan Winship [Sun, 28 Jun 2009 14:00:00 +0000 (10:00 -0400)]
Require explicit --disable-ssl to build without GNUTLS support

In general, if someone is trying to build without GNUTLS installed
it's an accident, so bail out with an error.

Inspired by http://bugzilla.gnome.org/show_bug.cgi?id=584955

15 years agoFix POST 301 redirect behavior
Dan Winship [Mon, 22 Jun 2009 21:52:39 +0000 (17:52 -0400)]
Fix POST 301 redirect behavior

We were doing POST->GET translation on 302 and 303, but we need to do
it on 301 as well to be compatible.

http://bugzilla.gnome.org/show_bug.cgi?id=586692

15 years ago2.27.2 LIBSOUP_2_27_2
Dan Winship [Tue, 16 Jun 2009 15:39:22 +0000 (11:39 -0400)]
2.27.2

15 years agoRemove -r flag from tests/get
Dan Winship [Tue, 9 Jun 2009 17:36:12 +0000 (13:36 -0400)]
Remove -r flag from tests/get

The requirement that it imposed--that we "guess" the name of the index
file when fetching a URL that ended with "/"--is more annoying than
the usefulness of being able to test multiple downloads at once.

15 years agoadd a HACKING file with some initial notes on code style and correctness
Dan Winship [Mon, 8 Jun 2009 13:55:15 +0000 (09:55 -0400)]
add a HACKING file with some initial notes on code style and correctness

15 years agoAdd "Content-Length: 0" to requests with a Content-Type but no body
Dan Winship [Sun, 7 Jun 2009 03:14:05 +0000 (23:14 -0400)]
Add "Content-Length: 0" to requests with a Content-Type but no body

Some servers get annoyed if a POST/PUT declares a Content-Type but
contains no body, so make sure to send a 0-length body (which is
different) instead.

15 years agoImplement SoupProxyURIResolver, to replace SoupProxyResolver
Dan Winship [Sat, 6 Jun 2009 22:57:51 +0000 (18:57 -0400)]
Implement SoupProxyURIResolver, to replace SoupProxyResolver

Simplifies implementations, allows for non-http proxy resolution, and
allows authentication information to be passed.

http://bugzilla.gnome.org/show_bug.cgi?id=580051

15 years agoSoupConnection/SoupSession reorg and cleanup
Dan Winship [Sat, 6 Jun 2009 22:55:48 +0000 (18:55 -0400)]
SoupConnection/SoupSession reorg and cleanup

Move CONNECT handling from SoupConnection to SoupSession so it works
more like other requests. Generally clean up and simplify
SoupConnection, and simplify the coordination between SoupSession and
its subclasses.

15 years agoFix hostname resolution behavior
Dan Winship [Sat, 6 Jun 2009 22:52:30 +0000 (18:52 -0400)]
Fix hostname resolution behavior

Previously we went to some effort to resolve the message URI hostname
to an IP address before figuring out proxies/connections, but this
turns out to be wrong for multiple reasons:

  1. Some hosts that send all requests via proxy don't even have a
     working DNS config.
     (http://bugzilla.gnome.org/show_bug.cgi?id=577532)

  2. Apparently no one expects hostnames in requests to be matched
     against IP addresses in proxy ignore lists anyway.

  3. The big web browsers all implement connection limits on a
     per-hostname basis, not a per-IP basis, and some web pages take
     advantage of this by using multiple aliases for the same host
     to get around the connection limit.

Also update tests/proxy-test to verify that the hostname is not
resolved when passing a request to a proxy.

15 years agoMore temporary SSL tweaking
Dan Winship [Thu, 4 Jun 2009 00:13:38 +0000 (20:13 -0400)]
More temporary SSL tweaking

Disable TLS 1.0 too, since some sites don't even support that (I'm
looking at you, PayPal). Eventually we'll want to make this be more
clever, and have it first try TLS 1.1 with extensions, and then fall
back to SSL 3.0 if the server gets confused by the new stuff. But that
will take some rewriting.

15 years agoInclude the (optional) algorithm param in Digest auth responses
Dan Winship [Tue, 2 Jun 2009 01:37:55 +0000 (21:37 -0400)]
Include the (optional) algorithm param in Digest auth responses

Apple's CalDAV server apparently considers it mandatory.
http://bugzilla.gnome.org/show_bug.cgi?id=583091

15 years agoUse POSIXly-correct "test a = b" rather than bash "test a == b"
Dan Winship [Tue, 2 Jun 2009 01:26:37 +0000 (21:26 -0400)]
Use POSIXly-correct "test a = b" rather than bash "test a == b"

Stupid bash. http://bugzilla.gnome.org/show_bug.cgi?id=583911

15 years agoUpdate REQUIRED_AUTOMAKE_VERSION to match reality
Dan Winship [Tue, 2 Jun 2009 01:21:18 +0000 (21:21 -0400)]
Update REQUIRED_AUTOMAKE_VERSION to match reality

http://bugzilla.gnome.org/show_bug.cgi?id=583942

15 years agoDon't emit "authenticate" until a message is actually sent and fails.
Dan Winship [Thu, 21 May 2009 21:36:17 +0000 (18:36 -0300)]
Don't emit "authenticate" until a message is actually sent and fails.

In some cases, we're reasonably sure it's going to fail if we don't
emit authenticate, but forcing callers to deal with both the
pre-sending and post-sending cases in their authenticate handlers
makes writing them tricky. (In particular, calling
soup_message_io_pause() in the pre-sending case won't work, since the
message hasn't actually started yet.) This also solves the problem
that we were previously emitting "authenticate" both before and after
the message was sent in some cases.

Add a regression test for this case (written by Gustavo Noronha, who
figured out the circumstances where the bug was happening), and tweak
the existing regression tests to match the new rules.

http://bugzilla.gnome.org/show_bug.cgi?id=583462

15 years agoTemporarily redo the TLS compatibility patch
Dan Winship [Mon, 18 May 2009 14:04:39 +0000 (10:04 -0400)]
Temporarily redo the TLS compatibility patch

It broke tests/ssl-test on machines that support %SSL3_RECORD_VERSION.
For now, we will just not use that flag, and instead always disable
TLS 1.1. The gnutls problem has been reported upstream.

15 years agoDon't set AI_CANONNAME when calling getaddrinfo()
Dan Winship [Mon, 18 May 2009 13:46:30 +0000 (09:46 -0400)]
Don't set AI_CANONNAME when calling getaddrinfo()

We weren't using the information it generated, so it had no effect
besides slowing things down with additional DNS traffic. Pointed out
by Christophe Gillette on libsoup-list.

15 years agoFix a warning introduced in fix for bug 582002
Dan Winship [Fri, 15 May 2009 14:26:34 +0000 (10:26 -0400)]
Fix a warning introduced in fix for bug 582002

15 years agoFix cflags to work with older versions of gcc
Dan Winship [Sun, 19 Apr 2009 14:46:40 +0000 (10:46 -0400)]
Fix cflags to work with older versions of gcc

Check that gcc supports -Wmissing-include-dirs and -Wundef rather than
using them unconditionally.

http://bugzilla.gnome.org/show_bug.cgi?id=578851

15 years agoFix the header/body boundary detection logic
Dan Winship [Sat, 9 May 2009 18:34:31 +0000 (14:34 -0400)]
Fix the header/body boundary detection logic

The change to support LF LF in addition to CRLF CRLF broke this subtly
so that if the first network read returned a packet that ended at a
CR, then the following LF would be mistakenly interpreted as ending
the headers.

http://bugzilla.gnome.org/show_bug.cgi?id=582002

15 years agoAttempt better compatibility with non-TLS1.1 https servers.
Dan Winship [Fri, 8 May 2009 22:11:20 +0000 (18:11 -0400)]
Attempt better compatibility with non-TLS1.1 https servers.

Try to use the (not-yet-widely-deployed) SSL3_RECORD_VERSION option in
gnutls to make it handshake according to the backward-compatibility
recommendations in the TLS spec. If that fails, fall back to just
disabling TLS1.1. Should hopefully help us to work better with servers
that freak out if you even suggest using TLS1.1.

Fix based on a Pidgin patch from Martin von Gagern.

http://bugzilla.gnome.org/show_bug.cgi?id=581342

15 years agoAdd another missing G_GNUC_NULL_TERMINATED and a G_GNUC_PRINTF
Dan Winship [Fri, 8 May 2009 20:59:36 +0000 (16:59 -0400)]
Add another missing G_GNUC_NULL_TERMINATED and a G_GNUC_PRINTF

15 years agoMark soup_uri_set_query_from_fields with G_GNUC_NULL_TERMINATED
Ross Burton [Thu, 7 May 2009 15:11:39 +0000 (16:11 +0100)]
Mark soup_uri_set_query_from_fields with G_GNUC_NULL_TERMINATED

http://bugzilla.gnome.org/show_bug.cgi?id=581754

15 years agoHandle PUT methods in soup_form_request_for_data
Ross Burton [Fri, 8 May 2009 13:04:19 +0000 (14:04 +0100)]
Handle PUT methods in soup_form_request_for_data

http://bugzilla.gnome.org/show_bug.cgi?id=581860

15 years agoNEWS: fix a bug number that was typoed
Dan Winship [Tue, 5 May 2009 14:06:16 +0000 (10:06 -0400)]
NEWS: fix a bug number that was typoed

15 years ago2.27.1 LIBSOUP_2_27_1
Dan Winship [Tue, 5 May 2009 01:27:15 +0000 (21:27 -0400)]
2.27.1

15 years agoFix typo in documentation: TIME should be TYPE.
Pierre-Luc Beaudoin [Fri, 24 Apr 2009 14:51:16 +0000 (10:51 -0400)]
Fix typo in documentation: TIME should be TYPE.

15 years agoFix a crash when cancelling a message from a "restarted" handler
Dan Winship [Tue, 28 Apr 2009 16:23:03 +0000 (12:23 -0400)]
Fix a crash when cancelling a message from a "restarted" handler

SoupSessionAsync was mistakenly leaving its own "restarted" handler connected
even after "finished" was emitted. misc-test was supposed to catch that, but
it was using SoupSessionSync rather than Async. Changed it to use Async since
Async adds some signal handlers of its own, while Sync does not.

Fixes #380193, reported by Gustavo Noronha

15 years agoFix mbox to be a mailto
Dan Winship [Tue, 28 Apr 2009 14:37:51 +0000 (10:37 -0400)]
Fix mbox to be a mailto

15 years agoVerify that soup_auth_is_for_proxy() is returning the right thing
Dan Winship [Tue, 28 Apr 2009 14:37:01 +0000 (10:37 -0400)]
Verify that soup_auth_is_for_proxy() is returning the right thing

15 years agoBelatedly move Changelog to Changelog.pre-git, update for that
Dan Winship [Fri, 24 Apr 2009 15:01:13 +0000 (11:01 -0400)]
Belatedly move Changelog to Changelog.pre-git, update for that

15 years agoAdd a missing file to .gitignore
Dan Winship [Fri, 24 Apr 2009 15:00:47 +0000 (11:00 -0400)]
Add a missing file to .gitignore

15 years agoheader-parsing.c: Add tests for new bad-header-parsing rules
Dan Winship [Sun, 19 Apr 2009 15:25:14 +0000 (11:25 -0400)]
header-parsing.c: Add tests for new bad-header-parsing rules

15 years agoAdd an "expect_warning" variable to the test framework
Dan Winship [Sun, 19 Apr 2009 15:24:43 +0000 (11:24 -0400)]
Add an "expect_warning" variable to the test framework

This lets a test tell the log handler that it is expecting to cause a
warning, so it shouldn't be treated as an error

15 years agosoup_message_headers_append: require @name to be non-empty
Dan Winship [Sun, 19 Apr 2009 15:22:11 +0000 (11:22 -0400)]
soup_message_headers_append: require @name to be non-empty

15 years agoBug 579318 – stupid servers that return garbled headers
Dan Winship [Sun, 19 Apr 2009 15:22:49 +0000 (11:22 -0400)]
Bug 579318 – stupid servers that return garbled headers

soup_headers_parse: don't pass bad header lines to
soup_message_headers_append, since it will emit warnings in that case
now. Also, don't bail out because one line of the headers is bad.
Instead, just skip the bad line and continue with the next good line.

15 years agoMark soup_message_headers_get() deprecated
Dan Winship [Sun, 19 Apr 2009 14:40:41 +0000 (10:40 -0400)]
Mark soup_message_headers_get() deprecated

(in favor of soup_message_headers_get_one() and _get_list())

15 years agoAdd more tests to tests/date.c
Dan Winship [Sat, 18 Apr 2009 15:40:10 +0000 (11:40 -0400)]
Add more tests to tests/date.c

Conversion between formats
non-UTC timestamps
floating timestamps

15 years agoFix soup_date_to_string() to deal with non-UTC times correctly
Dan Winship [Sat, 18 Apr 2009 15:37:26 +0000 (11:37 -0400)]
Fix soup_date_to_string() to deal with non-UTC times correctly

soup_date_new_from_string: fix setting of UTC vs floating for ISO8601
and RFC2822 timestamps. Allow a time of "24:00:00" (per ISO).

soup_date_to_string: coerce @date to UTC for HTTP and cookie dates,
output correct offset for RFC2822, ISO compact, and ISO full.

15 years agoBug 579055 – SOUP_DATE_RFC2822 not handled in soup_date_to_string()
Enrico Tröger [Sat, 18 Apr 2009 13:33:39 +0000 (09:33 -0400)]
Bug 579055 – SOUP_DATE_RFC2822 not handled in soup_date_to_string()

15 years agoAdd a regression test for SOUP_SESSION_TIMEOUT
Dan Winship [Sat, 18 Apr 2009 12:34:22 +0000 (08:34 -0400)]
Add a regression test for SOUP_SESSION_TIMEOUT

15 years agoBug 578928 – SOUP_SESSION_TIMEOUT does not work with https
Dan Winship [Sat, 18 Apr 2009 12:31:48 +0000 (08:31 -0400)]
Bug 578928 – SOUP_SESSION_TIMEOUT does not work with https

soup-gnutls.c: Fix error-code logic to return G_IO_STATUS_AGAIN even
with synchronous connections, if the underlying socket operation
returns EAGAIN.

15 years agoBug 574414 – Make SOUP_SESSION_TIMEOUT work with SoupSessionAsync
Dan Winship [Sat, 18 Apr 2009 12:29:28 +0000 (08:29 -0400)]
Bug 574414 – Make SOUP_SESSION_TIMEOUT work with SoupSessionAsync

soup-socket.c: when adding an IO watch to wait for an async socket to
become readable/writable, add a timeout as well, and fail if the
timeout times out.

soup-connection.c: Pass the TIMEOUT flag to async sockets too

15 years agoAdd .gitignore
Dan Winship [Fri, 17 Apr 2009 14:43:34 +0000 (10:43 -0400)]
Add .gitignore

15 years agoAdd libsoup.doap
Dan Winship [Fri, 17 Apr 2009 14:13:51 +0000 (10:13 -0400)]
Add libsoup.doap

15 years ago2.26.1 LIBSOUP_2_26_1
Dan Winship [Mon, 13 Apr 2009 22:15:27 +0000 (22:15 +0000)]
2.26.1

* configure.in: 2.26.1

* NEWS: update

svn path=/trunk/; revision=1275

15 years ago2.26.1
Dan Winship [Mon, 13 Apr 2009 22:15:08 +0000 (22:15 +0000)]
2.26.1

* configure.in: 2.26.1

* NEWS: update

svn path=/trunk/; revision=1274

15 years agofix use of async context here
Dan Winship [Mon, 13 Apr 2009 21:50:14 +0000 (21:50 +0000)]
fix use of async context here

* libsoup/soup-proxy-resolver-gnome.c (get_proxy_async): fix
use of async context here

svn path=/trunk/; revision=1273

15 years ago Bug 578809 – warnings in soup_address_equal_by_ip
Dan Winship [Mon, 13 Apr 2009 20:52:07 +0000 (20:52 +0000)]
Bug 578809 – warnings in soup_address_equal_by_ip

* libsoup/soup-session.c (get_host_for_message): don't try to look
up unresolved addresses in the hosts hash; just return NULL. The
"cancel other messages for the bad host" code in connect_result()
will loop over the whole queue, including messages with unresolved
addresses.

svn path=/trunk/; revision=1272

15 years ago Bug 578746 – http_proxy env var set to "http://:80" in session
Dan Winship [Mon, 13 Apr 2009 14:04:54 +0000 (14:04 +0000)]
Bug 578746 – http_proxy env var set to ":80" in session
despite proxy mode "none"

* libsoup/soup-proxy-resolver-gnome.c (update_proxy_settings):
Don't set anything if proxy_mode is NONE, and properly ignore the
proxy host if it's empty.

svn path=/trunk/; revision=1271

15 years ago Bug 578645 - crash in Rhythmbox Music Player
Dan Winship [Sat, 11 Apr 2009 12:45:57 +0000 (12:45 +0000)]
Bug 578645 - crash in Rhythmbox Music Player

* libsoup/soup-proxy-resolver-gnome.c
(soup_proxy_resolver_gnome_init): unlock id.lock before freeing
it. (Fixes the case where SoupProxyResolverGNOME is first
initialized from a thread other than the main thread, while the
default main loop is running.)

svn path=/trunk/; revision=1270

15 years ago2.26.0.9, aka "I can't believe it's not 2.26.1!", a pre-release to give LIBSOUP_2_26_0_9
Dan Winship [Wed, 8 Apr 2009 18:07:48 +0000 (18:07 +0000)]
2.26.0.9, aka "I can't believe it's not 2.26.1!", a pre-release to give

* configure.in: 2.26.0.9, aka "I can't believe it's not 2.26.1!",
a pre-release to give the proxy resolver fix a bit of extra
testing before next week.

* NEWS: Update

svn path=/trunk/; revision=1268

15 years ago Re-fix GNOME proxy resolution (qv bug 571527)
Dan Winship [Wed, 8 Apr 2009 17:16:52 +0000 (17:16 +0000)]
Re-fix GNOME proxy resolution (qv bug 571527)

* libsoup/soup-proxy-resolver-gnome.c: New and improved GNOME
proxy resolver; gets information out of GConf in a thread-safe
manner, and then passes it on to libproxy via environment
variables, so that libproxy won't try to access GConf itself, but
we still can use it for PAC, WPAD, and ignore_hosts.

* libsoup/soup-proxy-resolver-gconf.c:
* libsoup/soup-proxy-resolver-libproxy.c: gone now

* libsoup/soup-gnome-features.c: update for the fact that
SoupProxyResolverGNOME is actually a real type now, not
compile-time-defined alias

svn path=/trunk/; revision=1267

15 years ago Fix ISO 8601 parsing to accept either "." or ","
Dan Winship [Wed, 8 Apr 2009 14:23:15 +0000 (14:23 +0000)]
Fix ISO 8601 parsing to accept either "." or ","

* libsoup/soup-date.c (parse_iso8601_date): accept either "." or
"," as decimal separator, per the spec. qv glib bug 578369.

svn path=/trunk/; revision=1265

15 years ago Don't allow CR/LF in header names or values
Dan Winship [Sun, 5 Apr 2009 21:53:10 +0000 (21:53 +0000)]
Don't allow CR/LF in header names or values

* libsoup/soup-message-headers.c (soup_message_headers_append):
Don't let the caller create a header with whitespace or ":" in its
name, or with CR or LF in its value, since that would result in us
generating syntactically invalid headers.

svn path=/trunk/; revision=1264

15 years ago Bug 577386 – Fails to handle HTTPS redirect from a certain site.
Dan Winship [Fri, 3 Apr 2009 14:31:44 +0000 (14:31 +0000)]
Bug 577386 – Fails to handle HTTPS redirect from a certain site.

* libsoup/soup-gnutls.c (soup_gnutls_read): Treat abnormal
EOFs as though they were normal, rather than as errors. Shrug.

Reported by Diego Escalante Urrelo.

svn path=/trunk/; revision=1263

15 years ago Bug 577360 – handle cookies with same name but different path
Dan Winship [Fri, 3 Apr 2009 14:14:07 +0000 (14:14 +0000)]
Bug 577360 – handle cookies with same name but different path

* libsoup/soup-cookie-jar.c (soup_cookie_jar_add_cookie): check
both name and path when matching cookies; "foo=one; path=/bar"
should not replace "foo=two; path=/". They are separate cookies.

Reported by Alexander V. Butenko.

svn path=/trunk/; revision=1262

15 years agoFix the -p option in tests/get again
Dan Winship [Fri, 3 Apr 2009 00:49:43 +0000 (00:49 +0000)]
Fix the -p option in tests/get again

svn path=/trunk/; revision=1261

15 years ago Bug 577630 - libsoup should ignore broken Content-Type headers
Dan Winship [Fri, 3 Apr 2009 00:45:08 +0000 (00:45 +0000)]
Bug 577630 - libsoup should ignore broken Content-Type headers

* libsoup/soup-message-headers.c (content_type_setter): Ignore
Content-Type if it's not at least minimally syntactically correct.
(soup_message_headers_get_content_type): Document that.

* tests/header-parsing.c (do_content_type_tests): test it.

svn path=/trunk/; revision=1260

15 years ago Bug 577728 – soup_header_g_string_append_param should handle NULL values
Dan Winship [Fri, 3 Apr 2009 00:28:39 +0000 (00:28 +0000)]
Bug 577728 – soup_header_g_string_append_param should handle NULL values

* libsoup/soup-headers.c (soup_header_g_string_append_param):
allow @value to be %NULL.

* tests/header-parsing.c (do_append_param_tests): test
soup_header_g_string_append_param()

svn path=/trunk/; revision=1259

15 years ago Bug 576760 – soup_message_headers_get_content_type returns bad headers
Dan Winship [Fri, 3 Apr 2009 00:25:51 +0000 (00:25 +0000)]
Bug 576760 – soup_message_headers_get_content_type returns bad headers

* libsoup/soup-message-headers.c (soup_message_headers_get_one)
(soup_message_headers_get_list): New replacements for
soup_message_headers_get(), indicating explicitly whether the
caller expects the header to be a list or not; for non-list-type
headers, if there's more than one, the second one should be
ignored rather than concatenated to the first.
(soup_message_headers_get): deprecate this.

* libsoup/*.c:
* tests/*.c: Update to use soup_message_headers_get_one() or
_get_list() as appropriate.

* tests/header-parsing.c (do_content_type_tests): Add some tests
of Content-Type parsing/setting, including making sure that
duplicate Content-Type headers are ignored.

* docs/reference/libsoup-2.4-sections.txt: update

svn path=/trunk/; revision=1258

15 years ago Bug 576583 - Tests fail if "localhost" resolves to ::1
Dan Winship [Fri, 27 Mar 2009 19:47:03 +0000 (19:47 +0000)]
Bug 576583 - Tests fail if "localhost" resolves to ::1

* tests/*.c: Use "127.0.0.1" in URIs rather than "localhost",
since the default SoupServer config only listen on IPv4 (qv bug
522519), and tests/httpd.conf.in only configures apache to listen
on IPv4, and we don't handle multiple IP addresses (qv bug 526321)
but the machine might be configured to return "::1" rather than
"127.0.0.1" first for "localhost". Patch from Andreas Rottmann.

svn path=/trunk/; revision=1257

15 years agoFix docs to not claim that the cookie domain can be %NULL. Add some
Dan Winship [Fri, 27 Mar 2009 16:19:47 +0000 (16:19 +0000)]
Fix docs to not claim that the cookie domain can be %NULL. Add some

* libsoup/soup-cookie.c (soup_cookie_new): Fix docs to not claim
that the cookie domain can be %NULL. Add some g_return_if_fail()s.

svn path=/trunk/; revision=1256

15 years agoclarify that SoupSessionAsync is not thread-safe, and that setting a
Dan Winship [Fri, 27 Mar 2009 16:18:30 +0000 (16:18 +0000)]
clarify that SoupSessionAsync is not thread-safe, and that setting a

* docs/reference/client-howto.xml: clarify that SoupSessionAsync
is not thread-safe, and that setting a non-default GMainContext on
a non-threadsafe object means you can only use that object from
that GMainContext's thread.

svn path=/trunk/; revision=1255

15 years agoBug 574957 - soup-session-sync doesn't unlock mutex on proxy error
Milan Crha [Thu, 26 Mar 2009 09:20:36 +0000 (09:20 +0000)]
Bug 574957 - soup-session-sync doesn't unlock mutex on proxy error

2009-03-26  Milan Crha  <mcrha@redhat.com>

Bug 574957 - soup-session-sync doesn't unlock mutex on proxy error

* libsoup/soup-session-sync.c: (wait_for_connection):
Unlock private lock also on proxy error.

svn path=/trunk/; revision=1254

15 years ago Bug 571283 - Allow LF LF instead of CRLF CRLF as header/body separator
Dan Winship [Tue, 24 Mar 2009 23:12:21 +0000 (23:12 +0000)]
Bug 571283 - Allow LF LF instead of CRLF CRLF as header/body separator

* libsoup/soup-message-io.c (read_metadata): Change how this
works; instead of taking a boundary string, just always pass "\n"
as the boundary to soup_socket_read_until(), but call it multiple
times if the caller wants us to read until a blank line.
(io_read): update to deal with the fact that the headers might be
terminated by LF LF rather than CRLF CRLF.

svn path=/trunk/; revision=1253

15 years ago Bug 566530 - Handle (illegal) unencoded spaces in URIs
Dan Winship [Mon, 23 Mar 2009 21:39:40 +0000 (21:39 +0000)]
Bug 566530 - Handle (illegal) unencoded spaces in URIs

* libsoup/soup-uri.c (uri_normalized_copy): optionally fix up
parts with unencoded spaces in them.
(soup_uri_new_with_base): tell uri_normalized_copy() to fix up
spaces in the path and query components

* tests/uri-parsing.c (abs_tests): test parsing and unparsing a
URI with an unencoded space in it.

* tests/redirect-test.c (tests, server_callback): add a test of
redirecting to a URI with an unencoded space in it.

svn path=/trunk/; revision=1252

15 years ago2.26.0 LIBSOUP_2_26_0
Dan Winship [Mon, 16 Mar 2009 16:24:05 +0000 (16:24 +0000)]
2.26.0

* configure.in: 2.26.0

* NEWS: Update

svn path=/trunk/; revision=1250

15 years agoAdd G_{BEGIN,END}_DECLS guards to public headers.
Xan Lopez [Sat, 14 Mar 2009 21:58:40 +0000 (21:58 +0000)]
Add G_{BEGIN,END}_DECLS guards to public headers.

2009-03-14  Xan Lopez  <xan@gnome.org>

        Add G_{BEGIN,END}_DECLS guards to public headers.

        * libsoup/soup-auth.h:
        * libsoup/soup-cookie-jar-sqlite.h:
        * libsoup/soup-cookie-jar-text.h:
        * libsoup/soup-proxy-resolver.h:

svn path=/trunk/; revision=1249

15 years agoadd more detail to the doc comment
Dan Winship [Wed, 11 Mar 2009 17:51:43 +0000 (17:51 +0000)]
add more detail to the doc comment

* libsoup/soup-session.c (soup_session_cancel_message): add more
detail to the doc comment

* libsoup/soup-message.c (SoupMessage): Note in the doc comment
that reason phrases are not very useful, and should not be
presented to the user.

* libsoup/soup-status.c: add a comment explaining why reason
phrases aren't localized. Also some misc doc fixes.
(soup_status_get_phrase): Note in the doc comment that you
shouldn't present reason phrases to the user.

svn path=/trunk/; revision=1248

15 years ago Bug 571527 – gvfsd-http crashed with SIGSEGV in
Dan Winship [Mon, 9 Mar 2009 23:35:25 +0000 (23:35 +0000)]
Bug 571527 – gvfsd-http crashed with SIGSEGV in
g_hash_table_lookup().

As currently written, libproxy's gnome plugin causes intermittent
gvfsd-http crashes, and I didn't have time to come up with either
a fix or a workaround. So for 2.26.0 we will fall back to using
the GConf-based proxy resolver. Hopefully to be fixed for 2.26.1.

* configure.in: require both gconf and libproxy if building
--with-gnome

* libsoup/soup-proxy-resolver-gconf.c: bring this back.

* libsoup/soup-gnome-features.c
(soup_proxy_resolver_gnome_get_type): use gconf instead of
libproxy

* libsoup/Makefile.am: updates

svn path=/trunk/; revision=1247

15 years agogtk-doc updates. In particular, document a bunch of convenience #defines,
Dan Winship [Sun, 8 Mar 2009 15:05:43 +0000 (15:05 +0000)]
gtk-doc updates. In particular, document a bunch of convenience #defines,

* libsoup/*.c: gtk-doc updates. In particular, document a bunch of
convenience #defines, and add "Since" tags where appropriate.

svn path=/trunk/; revision=1246

15 years agoProcess messages in the CONNECTING iostate before messages in the QUEUED
Dan Winship [Fri, 6 Mar 2009 15:19:50 +0000 (15:19 +0000)]
Process messages in the CONNECTING iostate before messages in the QUEUED

* libsoup/soup-session-async.c (run_queue): Process messages in
the CONNECTING iostate before messages in the QUEUED iostate.
Otherwise, if a bunch of messages are queued all at once, and the
server doesn't support persistent connections, some messages can
get stranded in the queue. Fixes #574365 (reported by Xan Lopez)
and removes a five-year-old FIXME...

svn path=/trunk/; revision=1245

15 years agonow returns NULL if there is no Content-Type header; fix documentation to
Gustavo Noronha Silva [Fri, 20 Feb 2009 14:33:30 +0000 (14:33 +0000)]
now returns NULL if there is no Content-Type header; fix documentation to

2009-02-20  Gustavo Noronha Silva  <gns@gnome.org>

* libsoup/soup-message-headers.c
(soup_message_headers_get_content_type): now returns NULL if there
is no Content-Type header; fix documentation to account for this
change and to actually be correct about how the Content-Type is
returned.

svn path=/trunk/; revision=1244

15 years ago Bug 572153 – SoupServer doesn't support SOUP_ENCODING_EOF
Dan Winship [Thu, 19 Feb 2009 18:55:49 +0000 (18:55 +0000)]
Bug 572153 – SoupServer doesn't support SOUP_ENCODING_EOF

* libsoup/soup-message-io.c (io_write): Various fixes to make
SOUP_ENCODING_EOF work correctly when sending response
bodies. (Previously, the code assumed that SoupServer responses
would always be chunked or Content-Length-encoded.)

* libsoup/soup-message-client-io.c (get_request_headers): when
changing a request body from SOUP_ENCODING_NONE to
SOUP_ENCODING_CONTENT_LENGTH, return the new encoding value to
soup-message-io, not the old one.

* libsoup/soup-message.c (set_property): when setting
priv->server_side to TRUE, set the default encoding on the
response headers to CONTENT_LENGTH. (Moved from SoupServer.)
(soup_message_cleanup_response): If priv->server_side is TRUE,
re-fix the response header encoding after clearing the headers.
Otherwise the response headers revert to SOUP_ENCODING_EOF after
sending a "100 Continue".
(soup_message_is_keepalive): reorganize a little, fix a bug in the
HTTP/1.0 case.

* libsoup/soup-server.c (start_request): remove request encoding
override from here.

* tests/streaming-test.c: new test of SoupServer response
streaming, testing chunked, content-length, and eof-terminated
responses

svn path=/trunk/; revision=1243

15 years agoexplain why @len normally needs to be at least @boundary_len+1. Suggested
Dan Winship [Thu, 19 Feb 2009 16:21:13 +0000 (16:21 +0000)]
explain why @len normally needs to be at least @boundary_len+1. Suggested

* libsoup/soup-socket.c (soup_socket_read_until): explain why @len
normally needs to be at least @boundary_len+1. Suggested by
Benjamin Otte.
(soup_socket_class_init): add longer gtk-docs to the non-blocking
property, to explain the way non-blocking I/O works in SoupSocket.

svn path=/trunk/; revision=1242

15 years agoFix a series of issues that prevented SoupCookieJarSQLite from working:
Xan Lopez [Thu, 19 Feb 2009 14:00:52 +0000 (14:00 +0000)]
Fix a series of issues that prevented SoupCookieJarSQLite from working:

2009-02-19  Xan Lopez  <xan@gnome.org>

        * libsoup/soup-cookie-jar-sqlite.c:
        (callback):
        (try_create_table):
        (exec_query_with_try_create_table):
        (load):
        (changed):

        Fix a series of issues that prevented SoupCookieJarSQLite from working:

        - Try to create cookies table on errors. The table was never created before.
        - Store max_age in a gulong, not int.
        - Parse correctly boolean values from query. It's 0/1, not FALSE/TRUE.
- The host is stored as host in the table, not as domain.

        #572409

svn path=/trunk/; revision=1241

15 years ago2.25.91 LIBSOUP_2_25_91
Dan Winship [Mon, 16 Feb 2009 23:40:33 +0000 (23:40 +0000)]
2.25.91

* configure.in: 2.25.91

* NEWS: update

svn path=/trunk/; revision=1239

15 years agoUpdates: Mention SoupSessionFeature (and link to SoupLogger,
Dan Winship [Sun, 15 Feb 2009 21:28:28 +0000 (21:28 +0000)]
Updates: Mention SoupSessionFeature (and link to SoupLogger,

* docs/reference/client-howto.xml: Updates: Mention
SoupSessionFeature (and link to SoupLogger, SoupCookieJar, and
SoupProxyResolverGNOME specifically). Mention forms and XML-RPC
support. Mention header-parsing methods. Give a concrete example
of connecting to SoupMessage signals. Document the (minimal)
thread-safety guarantees

* docs/reference/build-howto.xml: basic notes on pkg-config and
#include usage.

svn path=/trunk/; revision=1238

15 years agoFix crash when getting a 407 when using SoupProxyResolverGNOME (or when
Dan Winship [Fri, 6 Feb 2009 16:07:44 +0000 (16:07 +0000)]
Fix crash when getting a 407 when using SoupProxyResolverGNOME (or when

* libsoup/soup-auth-manager.c (authenticate_auth): Fix crash when
getting a 407 when using SoupProxyResolverGNOME (or when not using
any proxy). Launchpad bug #326099. (Note that this doesn't
actually make proxy-auth-with-SoupProxyResolverGNOME *work*, it
just makes it not crash.)

svn path=/trunk/; revision=1237

15 years ago2.25.5 LIBSOUP_2_25_5
Dan Winship [Mon, 2 Feb 2009 21:59:27 +0000 (21:59 +0000)]
2.25.5

* configure.in: 2.25.5

* NEWS: update

svn path=/trunk/; revision=1235

15 years agofix docs build
Dan Winship [Mon, 2 Feb 2009 21:58:25 +0000 (21:58 +0000)]
fix docs build

svn path=/trunk/; revision=1234

15 years agoRemove this, as it was incomplete, and libproxy is now officially a
Dan Winship [Mon, 2 Feb 2009 17:28:46 +0000 (17:28 +0000)]
Remove this, as it was incomplete, and libproxy is now officially a

* libsoup/soup-proxy-resolver-gconf.h:
* libsoup/soup-proxy-resolver-gconf.c: Remove this, as it was
incomplete, and libproxy is now officially a dependency of GNOME.

* libsoup/Makefile.am:
* libsoup/soup-gnome-features.c: remove gconf-vs-libproxy ifdefs

* configure.in: Remove GConf checks, require libproxy if building
libsoup-gnome.

svn path=/trunk/; revision=1233

15 years agoFix this; previously it would discard the entire message body after
Dan Winship [Thu, 29 Jan 2009 18:40:24 +0000 (18:40 +0000)]
Fix this; previously it would discard the entire message body after

* libsoup/soup-message-body.c (soup_message_body_wrote_chunk): Fix
this; previously it would discard the entire message body after
writing a SOUP_MEMORY_TEMPORARY chunk. Part of WebKit bug 18343.

* libsoup/soup-message-io.c (io_write): use
io->write_chunk->length *before* freeing io->write_chunk.

* tests/chunk-test.c (do_temporary_test): new test to make sure
that TEMPORARY buffers are handled properly.

svn path=/trunk/; revision=1232

15 years agoremove the dummy typedef for struct SoupSessionFeature that was needed
Dan Winship [Wed, 21 Jan 2009 17:15:35 +0000 (17:15 +0000)]
remove the dummy typedef for struct SoupSessionFeature that was needed

* libsoup/soup-session-feature.h: remove the dummy typedef for
struct SoupSessionFeature that was needed because we weren't
scanning soup-types.h. Fixes the build with non-GNU compilers.

* libsoup/soup-session-feature.c: document
SoupSessionFeatureInterface

* docs/reference/Makefile.am (IGNORE_HFILES): oops, don't ignore
soup-types.h

* docs/reference/libsoup-2.4-docs.sgml:
* docs/reference/libsoup-2.4-sections.txt: Split
SoupSessionFeature into its own file.

svn path=/trunk/; revision=1231

15 years agoDon't pass NULL to soup_message_headers_replace(), call
Dan Winship [Mon, 12 Jan 2009 22:21:50 +0000 (22:21 +0000)]
Don't pass NULL to soup_message_headers_replace(), call

* libsoup/soup-cookie-jar.c (request_started): Don't pass NULL to
soup_message_headers_replace(), call soup_message_headers_remove()
if there are no cookies. Likely fix for webkit bug #23240.

* libsoup/soup-message-headers.c (soup_message_headers_append):
g_return_if_fail (value != NULL)

svn path=/trunk/; revision=1227

15 years ago 2.25.4 LIBSOUP_2_25_4
Dan Winship [Mon, 5 Jan 2009 21:37:00 +0000 (21:37 +0000)]
2.25.4

* NEWS: update

svn path=/trunk/; revision=1225

15 years agodoh. belatedly commit the 2.25.3 commit, and then bump to 2.25.4
Dan Winship [Tue, 23 Dec 2008 19:25:27 +0000 (19:25 +0000)]
doh. belatedly commit the 2.25.3 commit, and then bump to 2.25.4

svn path=/trunk/; revision=1224

15 years agoadd these to query session features. #565392.
Dan Winship [Tue, 23 Dec 2008 19:21:08 +0000 (19:21 +0000)]
add these to query session features. #565392.

* libsoup/soup-session.c (soup_session_get_features)
(soup_session_get_feature): add these to query session features.
#565392.

svn path=/trunk/; revision=1223

15 years agoadd some more warning CFLAGS, inspired by Benjamin Otte's blog post,
Dan Winship [Tue, 23 Dec 2008 19:05:12 +0000 (19:05 +0000)]
add some more warning CFLAGS, inspired by Benjamin Otte's blog post,

* configure.in: add some more warning CFLAGS, inspired by Benjamin
Otte's blog post, although none of them picked out any actual
bugs. Annoyingly, the most interesting warnings came from
-Wwrite-strings and -Wshadow, both of which I decided against
keeping, because they had too many false positives.

* libsoup/soup-cookie-jar.c (soup_cookie_jar_get_cookies): rename
a variable to avoid shadowing.

* libsoup/soup-message-headers.c
(soup_message_headers_get_ranges): move a variable declaration to
avoid a possibly-confusing shadowing.

* tests/forms-test.c:
* tests/header-parsing.c:
* tests/range-test.c:
* tests/test-utils.c: constify some "char *"s that should have
already been const.

* tests/get.c (find_hrefs): rename an arg whose name shadowed a
global, to avoid possible future confusion
(get_url): Likewise with a functional-internal shadowing.

svn path=/trunk/; revision=1222

15 years agoExplicitly document the fact that you have to call soup_uri_set_path()
Dan Winship [Tue, 9 Dec 2008 19:53:49 +0000 (19:53 +0000)]
Explicitly document the fact that you have to call soup_uri_set_path()

* libsoup/soup-uri.c (soup_uri_new): Explicitly document the fact
that you have to call soup_uri_set_path() when using
soup_uri_new(NULL), since path is required to be non-%NULL.

* libsoup/soup-connection.c (connect_message): initialize
uri->path

* libsoup/soup-cookie.c (soup_cookie_applies_to_uri):
g_return_val_if_fail() rather than crashing if uri->path is %NULL.
Also, fix the cookie/uri path comparison to not potentially read
off the end of uri->path. #562191, Mark Lee.

svn path=/trunk/; revision=1221

15 years agoCorrectly handle forms that have URI-encoded parameter names. #563302,
Dan Winship [Fri, 5 Dec 2008 03:57:05 +0000 (03:57 +0000)]
Correctly handle forms that have URI-encoded parameter names. #563302,

* libsoup/soup-form.c (soup_form_decode): Correctly handle forms
that have URI-encoded parameter names. #563302, Evan Nemerson.

* tests/forms-test.c: test that

svn path=/trunk/; revision=1220

15 years agodisconnect from gconf notifications. Fixes a crash, #563145.
Dan Winship [Wed, 3 Dec 2008 19:49:14 +0000 (19:49 +0000)]
disconnect from gconf notifications. Fixes a crash, #563145.

* libsoup/soup-proxy-resolver-gconf.c (finalize): disconnect from
gconf notifications. Fixes a crash, #563145.

svn path=/trunk/; revision=1219

15 years ago2.25.2 LIBSOUP_2_25_2
Dan Winship [Mon, 1 Dec 2008 23:08:33 +0000 (23:08 +0000)]
2.25.2

* configure.in: 2.25.2

* NEWS: update

svn path=/trunk/; revision=1217

15 years agoFix this so we choose the *strongest* auth type first, rather than the
Dan Winship [Fri, 28 Nov 2008 23:12:32 +0000 (23:12 +0000)]
Fix this so we choose the *strongest* auth type first, rather than the

* libsoup/soup-auth-manager.c (auth_type_compare_func): Fix this
so we choose the *strongest* auth type first, rather than the
weakest. Doh. #562339, Pontus Oldberg.

svn path=/trunk/; revision=1216