platform/upstream/libsoup.git
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

15 years agomake this $(includedir)/libsoup-gnome-2.4/libsoup rather than being the
Dan Winship [Fri, 28 Nov 2008 22:21:18 +0000 (22:21 +0000)]
make this $(includedir)/libsoup-gnome-2.4/libsoup rather than being the

* libsoup/Makefile.am (libsoupgnomeincludedir): make this
$(includedir)/libsoup-gnome-2.4/libsoup rather than being the same
as $(libsoupincludedir). Makes it easier to split into two
packages.

svn path=/trunk/; revision=1215

15 years agofix method name in example. #562411, Andreas Bruse.
Dan Winship [Fri, 28 Nov 2008 21:28:09 +0000 (21:28 +0000)]
fix method name in example. #562411, Andreas Bruse.

* docs/reference/client-howto.xml: fix method name in example.
#562411, Andreas Bruse.

svn path=/trunk/; revision=1214

15 years agoclarify exactly when stuff gets logged (and in particular, that
Dan Winship [Mon, 24 Nov 2008 17:15:47 +0000 (17:15 +0000)]
clarify exactly when stuff gets logged (and in particular, that

* libsoup/soup-logger.c: clarify exactly when stuff gets logged
(and in particular, that SoupSession::authenticate gets emitted
before the response it is authenticating gets logged).

svn path=/trunk/; revision=1207

16 years agofix linking with --as-needed. #559342, pointed out by Götz Waschk
Dan Winship [Thu, 6 Nov 2008 15:14:45 +0000 (15:14 +0000)]
fix linking with --as-needed. #559342, pointed out by Götz Waschk

* libsoup/Makefile.am (libsoup_gnome_2_4_la_LIBADD): fix linking
with --as-needed. #559342, pointed out by Götz Waschk

svn path=/trunk/; revision=1205

16 years ago2.25.1 LIBSOUP_2_25_1
Dan Winship [Tue, 4 Nov 2008 21:54:35 +0000 (21:54 +0000)]
2.25.1

* configure.in: 2.25.1

* NEWS: update

svn path=/trunk/; revision=1203

16 years agofix to mention that xan and diegoe did most of the cookie stuff
Dan Winship [Tue, 4 Nov 2008 21:49:12 +0000 (21:49 +0000)]
fix to mention that xan and diegoe did most of the cookie stuff

svn path=/trunk/; revision=1202

16 years agomisc doc fixes
Dan Winship [Tue, 4 Nov 2008 21:08:30 +0000 (21:08 +0000)]
misc doc fixes

* libsoup/soup-address.c (soup_address_is_resolved):
* libsoup/soup-cookie.c (soup_cookie_copy):
* libsoup/soup-cookie-jar.c (soup_cookie_jar_class_init):
* libsoup/soup-message-headers.c (SoupMessageHeadersType):
* libsoup/soup-proxy-resolver.c
(soup_proxy_resolver_get_proxy_async)
(soup_proxy_resolver_get_proxy_sync):
* libsoup/soup-status.c (soup_status_proxyify): misc doc fixes

* libsoup/soup-cookie-jar-text.h: remove a "deprecated" API that
was never actually released

* libsoup/soup.h: include soup-proxy-resolver.h

* docs/reference/Makefile.am (SCAN_OPTIONS): set
--deprecated-guards correctly
(IGNORE_HFILES): ignore some more internal files
(GTKDOC_LIBS): link against libsoup-gnome, not libsoup

* docs/reference/libsoup-2.4-docs.sgml:
* docs/reference/libsoup-2.4.types:
* docs/reference/libsoup-2.4-sections.txt: add new stuff

svn path=/trunk/; revision=1201

16 years agoimplementation of SoupCookieJar that persists to a text file in the old
Dan Winship [Tue, 4 Nov 2008 20:30:37 +0000 (20:30 +0000)]
implementation of SoupCookieJar that persists to a text file in the old

* libsoup/soup-cookie-jar-text.c: implementation of SoupCookieJar
that persists to a text file in the old Mozilla cookies.txt
format.

* libsoup/soup-cookie-jar-sqlite.c: implementation of
SoupCookieJar that persists to an sqlite database in the new
Mozilla cookies.sqlite format. (Part of libsoup-gnome.)

* libsoup/soup-cookie-jar.c: add various functionality needed by
the two new subclasses. Does not break API/ABI compat with 2.24.

* libsoup/soup-cookie.c (soup_cookie_get_type): register
SoupCookie as a boxed type.
(domain_matches): fix a bug here that meant "foo.com" couldn't set
a cookie for domain=.foo.com
(soup_cookie_applies_to_uri): fix path checking

* configure.in: if building --with-gnome, require sqlite3

svn path=/trunk/; revision=1200

16 years agodon't remove the item from the queue here; it should already have happened
Dan Winship [Mon, 3 Nov 2008 22:43:12 +0000 (22:43 +0000)]
don't remove the item from the queue here; it should already have happened

* libsoup/soup-session-sync.c (process_queue_item): don't remove
the item from the queue here; it should already have happened in
all circumstances. Possible fix for #559052.

* libsoup/soup-session.c (cancel_message): don't remove the item
from the queue here; the call to soup_message_finished() will do
that.

* libsoup/soup-message-queue.c (soup_message_queue_remove): This
should only be called once, so g_return_if_fail (!item->removed)

* tests/test-utils.c (test_init): install a new default g_log
handler that increments the error count when it's called so that a
test won't pass if it triggers a g_warning() or
g_return_if_fail().

svn path=/trunk/; revision=1199

16 years agofix srcdir/builddir mixup.
Dan Winship [Mon, 3 Nov 2008 22:18:36 +0000 (22:18 +0000)]
fix srcdir/builddir mixup.

* tests/Makefile.am (get_LDADD): fix srcdir/builddir mixup.

svn path=/trunk/; revision=1198

16 years agodon't leak the header string
Dan Winship [Mon, 3 Nov 2008 22:11:51 +0000 (22:11 +0000)]
don't leak the header string

* libsoup/soup-message-headers.c (set_content_foo): don't leak the
header string

* libsoup/soup-multipart.c (generate_boundary): avoid a (harmless)
valgrind warning

* libsoup/soup-proxy-resolver-static.c (get_proxy_sync): don't
leak the address on error

* libsoup/soup-session-sync.c (wait_for_connection): don't leak
proxy_addr

* tests/misc-test.c: don't leak the SoupMessage signal ids

* tests/range-test.c (main): don't leak base_uri

* tests/libsoup.supp: update this using lots and lots of wildcards

svn path=/trunk/; revision=1197

16 years agoFix the signal handler disconnection here: for "finished" we were passing
Dan Winship [Mon, 3 Nov 2008 15:50:30 +0000 (15:50 +0000)]
Fix the signal handler disconnection here: for "finished" we were passing

* libsoup/soup-session.c (message_finished): Fix the signal
handler disconnection here: for "finished" we were passing the
wrong user_data to g_signal_handlers_disconnect_by_func(), and for
"got_body" it turns out you can't use _disconnect_by_func() when
there's a metamarshal, making it incompatible
withsoup_message_add_header_handler(). Fixes a crash in
evolution-exchange, #559054.

* tests/misc-test.c (do_msg_reuse_test): Ensure that SoupSession
and its features disconnect all of their signals from a message
when they're done with it.

svn path=/trunk/; revision=1196

16 years agocommit changelog for previous commit. oops
Dan Winship [Fri, 31 Oct 2008 18:12:53 +0000 (18:12 +0000)]
commit changelog for previous commit. oops

svn path=/trunk/; revision=1195

16 years ago Add libsoup-gnome, for new features that depend on GNOME
Dan Winship [Fri, 31 Oct 2008 18:12:18 +0000 (18:12 +0000)]
Add libsoup-gnome, for new features that depend on GNOME
libraries.

* configure.in: Check for libproxy and/or gconf, accept
--without-gnome option, output libsoup-gnome-2.4.pc

* libsoup-gnome-2.4.pc: pc file for libsoup with GNOME support

* libsoup/Makefile.am: build libsoup-gnome.la if so configured

* libsoup/soup-gnome.h: base header for libsoup-gnome

* libsoup/soup-proxy-resolver-libproxy.c: An implementation of
SoupProxyResolver that uses libproxy.

* libsoup/soup-proxy-resolver-gconf.c: An implementation of
SoupProxyResolver that uses the proxy keys in GConf. Does not
completely handle ignore_hosts; this is currently just used as a
fallback if libproxy is not available.

* libsoup/soup-gnome-features.c: provides
SOUP_TYPE_PROXY_RESOLVER_GNOME (abstracting over
SoupProxyResolverGConf and SoupProxyResolverLibproxy) and
SOUP_TYPE_GNOME_FEATURES_2_26, which adds "all GNOME-specific
features in libsoup 2.26", which is currently just the proxy
resolver.

* libsoup/soup-session-async.c (resolved_proxy_addr): set
item->resolved_proxy_addr
(run_queue): resolve the proxy if !item->resolved_proxy_addr, not
if !item->proxy_addr, since the proxy addr might resolve to NULL.

* tests/Makefile.am (get_LDADD):
* tests/get.c: If we built libsoup-gnome, use it in "get" for
automatic proxy support

svn path=/trunk/; revision=1194

16 years agorename from libsoup.pc.in; the attempt to keep the source tree
Dan Winship [Fri, 31 Oct 2008 17:55:32 +0000 (17:55 +0000)]
rename from libsoup.pc.in; the attempt to keep the source tree

* libsoup-2.4.pc.in: rename from libsoup.pc.in; the attempt to
keep the source tree API-version-generic wasn't really working,
and we're probably not ever going to change the API version again
anyway.

* Makefile.am (pkgconfig_DATA): install the .pc file the normal
way rather than using an install-data-local rule to rename the .pc
file as we install it

* libsoup/Makefile.am (libsoupincludedir):
* tests/Makefile.am (LIBS):
* docs/reference/Makefile.am (GTKDOC_LIBS): Say "2.4" everywhere,
instead of 2.4 in some places and $(SOUP_API_VERSION) in others.

* configure.in: updates for .pc renaming. Also, use
AS_HELP_STRING() in AC_ARG_ENABLE() and AC_ARG_WITH() rules

svn path=/trunk/; revision=1193

16 years agonew abstract base class for a SoupSessionFeature that determines what
Dan Winship [Fri, 31 Oct 2008 13:05:14 +0000 (13:05 +0000)]
new abstract base class for a SoupSessionFeature that determines what

* libsoup/soup-proxy-resolver.c: new abstract base class for a
SoupSessionFeature that determines what proxy to use for a given
URI.

* libsoup/soup-proxy-resolver-static.c: a SoupProxyResolver that
always returns the same value.

* libsoup/soup-session.c (set_property, get_property): implement
the SOUP_SESSION_PROXY_URI property by creating/destroying a
SoupProxyResolverStatic as needed.
(soup_session_get_connection): Use the proxy address passed by the
caller rather than priv->proxy_uri.

* libsoup/soup-session-async.c (run_queue): if the session has a
proxy resolver, use it, and pass the resolved proxy to
soup_session_get_connection().
(request_restarted): clear the previously-resolved proxy address
when restarting the message

* libsoup/soup-session-sync.c (wait_for_connection): if the
session has a proxy resolver, use it, and pass the resolved proxy
to soup_session_get_connection().

* libsoup/soup-message-queue.h (SoupMessageQueueItem): add
proxy-address-resolving fields

* libsoup/soup-status.c (soup_status_proxify): moved from
soup-connection; turn SOUP_STATUS_CANT_RESOLVE into
SOUP_STATUS_CANT_RESOLVE_PROXY, and SOUP_STATUS_CANT_CONNECT into
SOUP_STATUS_CANT_CONNECT_PROXY (and pass all other statuses
through unchanged)

svn path=/trunk/; revision=1192

16 years agodo directory listings. (wrote this a long time ago, it just never made it
Dan Winship [Thu, 30 Oct 2008 21:01:55 +0000 (21:01 +0000)]
do directory listings. (wrote this a long time ago, it just never made it

* tests/simple-httpd.c: do directory listings. (wrote this a long
time ago, it just never made it into svn)

svn path=/trunk/; revision=1191

16 years agofree the expires date, if set
Dan Winship [Mon, 27 Oct 2008 21:40:40 +0000 (21:40 +0000)]
free the expires date, if set

* libsoup/soup-cookie.c (soup_cookie_free): free the expires date,
if set

* libsoup/soup-auth-domain-basic.h:
* libsoup/soup-auth-domain-digest.h:
* libsoup/soup-auth-domain.h:
* libsoup/soup-cookie-jar.h:
* libsoup/soup-logger.h:
* libsoup/soup-multipart.h: add G_BEGIN/END_DECLS

* libsoup/soup-date.c: add some g_return_if_fails

Patches from and inspired by Xan Lopez, #522125

svn path=/trunk/; revision=1190

16 years agofix up some of the regression test configuration stuff, and print warnings
Dan Winship [Wed, 22 Oct 2008 15:41:23 +0000 (15:41 +0000)]
fix up some of the regression test configuration stuff, and print warnings

* configure.in:
* tests/Makefile.am: fix up some of the regression test
configuration stuff, and print warnings when some tests aren't run
do to missing dependencies

svn path=/trunk/; revision=1189

16 years agoremove gtk-doc.make. i'm not sure why it was ever committed
Dan Winship [Wed, 22 Oct 2008 14:40:41 +0000 (14:40 +0000)]
remove gtk-doc.make. i'm not sure why it was ever committed

svn path=/trunk/; revision=1188

16 years agoadd SOUP_MAINTAINER_FLAGS here too.
Dan Winship [Mon, 20 Oct 2008 15:06:16 +0000 (15:06 +0000)]
add SOUP_MAINTAINER_FLAGS here too.

* tests/Makefile.am (INCLUDES): add SOUP_MAINTAINER_FLAGS here
too.

* tests/dns.c (main):
* tests/getbug.c (main):
* tests/server-auth-test.c (do_test): replace deprecated glib
functions

svn path=/trunk/; revision=1184

16 years agoBuild with G_DISABLE_DEPRECATED and G_DISABLE_SINGLE_INCLUDES; enforce the
Cosimo Cecchi [Mon, 20 Oct 2008 13:17:59 +0000 (13:17 +0000)]
Build with G_DISABLE_DEPRECATED and G_DISABLE_SINGLE_INCLUDES; enforce the

2008-10-20  Cosimo Cecchi  <cosimoc@gnome.org>

* configure.in:
* libsoup/Makefile.am:
* libsoup/soup-status.h:
* libsoup/soup-types.h:
* libsoup/soup-uri.c: (soup_uri_to_string):
Build with G_DISABLE_DEPRECATED and G_DISABLE_SINGLE_INCLUDES; enforce
the first switch under maintainer mode and the second one
unconditionally (#557072).

svn path=/trunk/; revision=1183

16 years agocompare scheme name case-insensitively, to prevent an infinite loop when
Dan Winship [Sun, 19 Oct 2008 13:41:17 +0000 (13:41 +0000)]
compare scheme name case-insensitively, to prevent an infinite loop when

* libsoup/soup-auth.c (soup_auth_update): compare scheme name
case-insensitively, to prevent an infinite loop when it's not in
standard form. #536285

svn path=/trunk/; revision=1182

16 years agoif the caller passed the total_length of the message body, then sort sort
Dan Winship [Fri, 10 Oct 2008 21:35:35 +0000 (21:35 +0000)]
if the caller passed the total_length of the message body, then sort sort

* libsoup/soup-message-headers.c
(soup_message_headers_get_ranges): if the caller passed the
total_length of the message body, then sort sort the ranges and
merge overlapping ones to generate a minimal set.

* tests/range-test.c: test it

svn path=/trunk/; revision=1181

16 years agoVerify whether uri is non-NULL and avoid crash on NULL pointer dereference
Andrew W. Nosenko [Fri, 10 Oct 2008 17:05:58 +0000 (17:05 +0000)]
Verify whether uri is non-NULL and avoid crash on NULL pointer dereference

2008-10-09  Andrew W. Nosenko  <andrew.w.nosenko@gmail.com>

* libsoup/soup-uri.c (soup_uri_to_string): Verify whether uri is
non-NULL and avoid crash on NULL pointer dereference therefore.

svn path=/trunk/; revision=1180

16 years agoChange the SoupURI properties to SoupAddress properties.
Dan Winship [Fri, 3 Oct 2008 21:01:54 +0000 (21:01 +0000)]
Change the SoupURI properties to SoupAddress properties.

* libsoup/soup-connection.c: Change the SoupURI properties to
SoupAddress properties.

* libsoup/soup-address.c (soup_address_resolve_async)
(soup_address_resolve_sync): Redo slightly so that multiple
simultaneous attempts to resolve the same address won't cause
problems.
(soup_address_hash_by_name, soup_address_equal_by_name):
(soup_address_hash_by_ip, soup_address_equal_by_ip): methods to
hash addresses by name or IP address

* libsoup/soup-message.c (soup_message_get_address): gets a
SoupAddress corresponding to the message's URI

* libsoup/soup-auth-manager.c (SoupAuthHost): hash hosts by
soup_address_hash_by_name() rather than by URI.

* libsoup/soup-session.c (soup_session_get_connection): pass
addresses to soup_connection_new(), not URIs.
(SoupSessionHost): hash hosts by soup_address_hash_by_ip() rather
than by URI. This requires that the addresses will have already
been resolved by the SoupSession subclasses before calling
soup_session_get_connection(), but also means that now requests
made to different virtual hosts on the same IP address can share a
connection.

* libsoup/soup-message-queue.c (SoupMessageQueueItem): add
address-resolving state

* libsoup/soup-session-sync.c (process_queue_item): resolve the
message's address before getting a connection

* libsoup/soup-session-async.c (run_queue, resolve_msg_addr)
(resolved_msg_addr): resolve the message's address before getting
a connection
(request_restarted): if the message gets requeued to a different
host, we'll need to re-resolve the address.

* libsoup/soup-uri.c (soup_uri_copy_root, soup_uri_host_hash)
(soup_uri_host_equal): No longer needed

* libsoup/soup-dns.c (do_async_callback): disconnect from the
cancellable before invoking the callback

* tests/proxy-test.c (tests): fix the 403 example; hostnames are
resolved by the session now, even when sending to a proxy, so we
need to use a hostname that actually exists

svn path=/trunk/; revision=1179

16 years agoMake this more complicated, with a SoupMessageQueueItem to keep track of
Dan Winship [Fri, 3 Oct 2008 20:17:56 +0000 (20:17 +0000)]
Make this more complicated, with a SoupMessageQueueItem to keep track of

* libsoup/soup-message-queue.c: Make this more complicated, with a
SoupMessageQueueItem to keep track of the session's per-message
state. (Part of the process of moving session-related state out of
SoupMessagePrivate.)

* libsoup/soup-session.c: Update to work in terms of
SoupMessageQueueItem

* libsoup/soup-session-async.c:
* libsoup/soup-session-sync.c: use SoupMessageQueueItem (and get
rid of SoupSessionAsyncQueueData and SoupSessionSyncAsyncData).

svn path=/trunk/; revision=1178

16 years agoupdate
Dan Winship [Fri, 3 Oct 2008 19:48:26 +0000 (19:48 +0000)]
update

svn path=/trunk/; revision=1177

16 years agoNew type and methods for working with multipart HTTP bodies (eg,
Dan Winship [Wed, 1 Oct 2008 21:53:26 +0000 (21:53 +0000)]
New type and methods for working with multipart HTTP bodies (eg,

* libsoup/soup-multipart.c: New type and methods for working with
multipart HTTP bodies (eg, multipart/form-data and
multipart/byte-ranges)

* libsoup/soup-message-headers.c (soup_message_headers_get_ranges)
(soup_message_headers_set_ranges)
(soup_message_headers_set_range)
(soup_message_headers_get_content_range)
(soup_message_headers_set_content_range): New methods for dealing
with the Range and Content-Range headers.

* libsoup/soup-form.h (SOUP_FORM_MIME_TYPE_URLENCODED)
(SOUP_FORM_MIME_TYPE_MULTIPART): #define these MIME types here

* libsoup/soup-form.c (soup_form_decode_multipart): new utility
for parsing multipart/form-data forms.
(soup_form_request_new_from_multipart): new utility for
constructing multipart/form-data forms

* libsoup/soup-headers.c (soup_headers_parse): this is now
non-static, for use by soup-multipart

* libsoup/soup-message-server-io.c (get_response_headers)
(handle_partial_get): if the client requested a partial GET, and
the SoupServer is returning the full body, rebuild the response to
include only the requested range instead

* tests/forms-test.c: renamed from query-test and updated to do
both application/x-www-form-urlencoded and multipart/form-data
tests

* tests/range-test.c: test of Range/Content-Range functionality

svn path=/trunk/; revision=1176

16 years agoUpdate these to deal with RFC2231-encoded UTF-8 header params
Dan Winship [Wed, 1 Oct 2008 21:12:24 +0000 (21:12 +0000)]
Update these to deal with RFC2231-encoded UTF-8 header params

* libsoup/soup-headers.c (soup_header_parse_param_list)
(soup_header_parse_semi_param_list): Update these to deal with
RFC2231-encoded UTF-8 header params
(soup_header_g_string_append_param): new utility method to do
parameters with quoted-strings (handling escaping) and RFC2231.

* libsoup/soup-auth-digest.c (get_authorization):
* libsoup/soup-auth-domain-basic.c (challenge):
* libsoup/soup-auth-domain-digest.c (challenge): use
soup_header_g_string_append_param so we handle escaping correctly

* libsoup/soup-message-headers.c
(soup_message_headers_get_content_type)
(soup_message_headers_set_content_type)
(soup_message_headers_get_content_disposition)
(soup_message_headers_set_content_disposition): New convenience
methods.

* tests/header-parsing.c (do_rfc2231_tests): new test of RFC2231
encoded header parsing in Content-Disposition.

* tests/get.c (get_url): use
soup_message_headers_get_content_type()

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

svn path=/trunk/; revision=1175

16 years agoadd a new -s flag to indicate that it's being run from inside
Dan Winship [Wed, 1 Oct 2008 20:54:09 +0000 (20:54 +0000)]
add a new -s flag to indicate that it's being run from inside

* tests/xmlrpc-test.c (main): add a new -s flag to indicate that
it's being run from inside xmlrpc-server-test.
(test_echo): if we aren't running inside xmlrpc-server-test, and
the response strings don't match the request strings, then compare
them to echo_strings_broken instead; a bug in php-xmlrpc manifests
when using libxml2 >= 2.7.1, resulting in incorrect responses. :-/

* tests/xmlrpc-server-test.c (do_xmlrpc_tests): Pass -s to
xmlrpc-test

svn path=/trunk/; revision=1173

16 years agobump version to 2.25.0
Dan Winship [Wed, 1 Oct 2008 20:15:19 +0000 (20:15 +0000)]
bump version to 2.25.0

* configure.in: bump version to 2.25.0

svn path=/trunk/; revision=1172

16 years agodoc fixups
Dan Winship [Wed, 1 Oct 2008 20:09:42 +0000 (20:09 +0000)]
doc fixups

* libsoup/soup-cookie-jar.c:
* libsoup/soup-cookie.c:
* libsoup/soup-cookie.h:
* libsoup/soup-headers.c:
* libsoup/soup-logger.c:
* libsoup/soup-session-feature.c:
* libsoup/soup-session-feature.h:
* libsoup/soup-session.c: doc fixups

* docs/reference/libsoup-2.4-docs.sgml:
* docs/reference/libsoup-2.4-sections.txt:
* docs/reference/libsoup-2.4.types: Add missing bits

svn path=/trunk/; revision=1170

16 years agosoup_value_hash_insert_value() copies the value, so we have to
Dan Winship [Tue, 30 Sep 2008 17:16:48 +0000 (17:16 +0000)]
soup_value_hash_insert_value() copies the value, so we have to

* libsoup/soup-xmlrpc.c (parse_value):
soup_value_hash_insert_value() copies the value, so we have to
g_value_unset() our copy.

* tests/chunk-test.c:
* tests/misc-test.c:
* tests/ntlm-test.c: fix leaks

* tests/libsoup.supp: update

svn path=/trunk/; revision=1169

16 years agostore the GSource in priv, don't ref the session. Otherwise the session
Dan Winship [Tue, 30 Sep 2008 15:43:17 +0000 (15:43 +0000)]
store the GSource in priv, don't ref the session. Otherwise the session

* libsoup/soup-session-async.c (do_idle_run_queue): store the
GSource in priv, don't ref the session. Otherwise the session
won't get destroyed if you abort it and then don't return to its
main loop. (addendum to #498509, Arnout Vandecappelle)
(finalize): Destroy the idle_run_queue source when finalizing.
(run_queue, got_connection): Ref the session when calling
soup_connection_connect_async(), and do a
do_idle_run_queue()+unref in got_connection, to ensure correct
handling regardless of what the application does with its own ref
on the session.
(final_finished): Likewise, ref/do_idle_run_queue/unref rather
than calling run_queue directly and playing with weak pointers.

* libsoup/soup-session.c (connect_result): ref the session around
the cancel-if-error loop

Fixes #533473, crash in seahorse when connecting to a
non-responsive key server.

* tests/misc-test.c (do_callback_unref_test): Add a test for the
bug in #533473.

* tests/test-utils.c (soup_test_session_abort_unref): abort and
unref a SoupSession, and consider it an error if the session still
exists afterward. Suggested by Arnout Vandecappelle.
(test_server_shutdown): Likewise, consider it an error if the
server is leaked.

* tests/*.c: Use soup_test_session_abort_unref().

svn path=/trunk/; revision=1168

16 years agolibsoup/soup-auth-manager-ntlm.c libsoup/soup-auth-manager.c
Dan Winship [Fri, 26 Sep 2008 21:59:42 +0000 (21:59 +0000)]
libsoup/soup-auth-manager-ntlm.c libsoup/soup-auth-manager.c

* libsoup/soup-auth-manager-ntlm.c
* libsoup/soup-auth-manager.c
* libsoup/soup-cookie-jar.c
* libsoup/soup-dns.c
* libsoup/soup-logger.c:
* libsoup/soup-message-body.h:
* libsoup/soup-message.h
* libsoup/soup-misc.h:
* libsoup/soup-xmlrpc.h:

* tests/continue-test.c:
* tests/ntlm-test.c: Fix warnings pointed out by gcc -pedantic.
#553976, Sander Dijkhuis.

svn path=/trunk/; revision=1167

16 years ago2.24.0.1
Dan Winship [Wed, 24 Sep 2008 12:17:55 +0000 (12:17 +0000)]
2.24.0.1

* configure.in: 2.24.0.1

* NEWS: Update

* libsoup/soup-session.c (redirect_handler):
* libsoup/soup-message.c (soup_message_new):
(soup_message_new_from_uri, soup_message_set_uri): Revert the
2008-08-25 change; it breaks the rhythmbox DAAP plugin. #553466.
To be revisited.

svn path=/trunk/; revision=1164

16 years ago2.24.0 LIBSOUP_2_24_0
Dan Winship [Mon, 22 Sep 2008 18:08:07 +0000 (18:08 +0000)]
2.24.0

* configure.in: 2.24.0

svn path=/trunk/; revision=1161

16 years ago2.23.92 (belated; I apparently forgot to commit this after disting LIBSOUP_2_23_92
Dan Winship [Tue, 16 Sep 2008 16:36:19 +0000 (16:36 +0000)]
2.23.92 (belated; I apparently forgot to commit this after disting

2.23.92
(belated; I apparently forgot to commit this after disting 2.23.92)

svn path=/trunk/; revision=1159

16 years agoa 302 response to HEAD (or any other safe method) should be treated like a
Dan Winship [Sun, 7 Sep 2008 17:43:03 +0000 (17:43 +0000)]
a 302 response to HEAD (or any other safe method) should be treated like a

* libsoup/soup-session.c (redirect_handler): a 302 response to
HEAD (or any other safe method) should be treated like a 307, not
a 303. #551190, Jonathan Matthew.

* tests/redirect-test.c: test that

svn path=/trunk/; revision=1158

16 years ago2.23.91 LIBSOUP_2_23_91
Dan Winship [Mon, 1 Sep 2008 21:48:11 +0000 (21:48 +0000)]
2.23.91

* configure.in: 2.23.91

* NEWS: update

svn path=/trunk/; revision=1156

16 years agonew macro to check if a URI is a valid http or https URI.
Dan Winship [Mon, 25 Aug 2008 13:53:41 +0000 (13:53 +0000)]
new macro to check if a URI is a valid http or https URI.

* libsoup/soup-uri.h (SOUP_URI_VALID_FOR_HTTP): new macro to check
if a URI is a valid http or https URI.

* libsoup/soup-uri.c (soup_uri_new_with_base): Update http/https
check to use SOUP_URI_VALID_FOR_HTTP().

* libsoup/soup-session.c (redirect_handler): Check
SOUP_URI_VALID_FOR_HTTP() and call it an error if the check fails.

* libsoup/soup-message.c (soup_message_new): Remove the uri->host
check from here. Update docs to clarify that @uri must be an
http/https URI.
(soup_message_new_from_uri): Check SOUP_URI_VALID_FOR_HTTP().
Update docs.
(soup_message_set_uri): Check SOUP_URI_VALID_FOR_HTTP(). Update
docs.

Should prevent the crash in #528882, but there's still something
going wrong there at a higher level.

svn path=/trunk/; revision=1155

16 years agoAdd a SoupDate to GTimeVal conversion function, for use in gvfs. #549006,
Bastien Nocera [Fri, 22 Aug 2008 14:13:56 +0000 (14:13 +0000)]
Add a SoupDate to GTimeVal conversion function, for use in gvfs. #549006,

2008-08-22  Bastien Nocera  <hadess@hadess.net>

* libsoup/soup-date.c (soup_date_to_time_t),
(soup_date_to_timeval):
* libsoup/soup-date.h: Add a SoupDate to GTimeVal conversion
function, for use in gvfs. #549006, with help from Dan Winship
<danw@gnome.org>

svn path=/trunk/; revision=1154

16 years agoRevert previous commit; that would still fail in the case of an
Dan Winship [Mon, 18 Aug 2008 15:42:06 +0000 (15:42 +0000)]
Revert previous commit; that would still fail in the case of an

* libsoup.pc.in (Requires): Revert previous commit; that would
still fail in the case of an application linking against a library
that privately links against libsoup. The only correct solution in
the face of --as-needed (or on OSes where the linker always works
that way) is for the module that actually calls g_thread_init() to
explicitly link against libgthread.

svn path=/trunk/; revision=1153

16 years agog_return_if_fail if either username or password is NULL. Noted on the
Dan Winship [Thu, 14 Aug 2008 14:38:21 +0000 (14:38 +0000)]
g_return_if_fail if either username or password is NULL. Noted on the

* libsoup/soup-auth.c (soup_auth_authenticate): g_return_if_fail
if either username or password is NULL. Noted on the mailing list.

* libsoup/soup-auth-basic.c (authenticate): remove redundant check

svn path=/trunk/; revision=1152

16 years agoAdd gthread-2.0; the app must call g_thread_init(), but libsoup won't pull
Dan Winship [Thu, 14 Aug 2008 14:37:48 +0000 (14:37 +0000)]
Add gthread-2.0; the app must call g_thread_init(), but libsoup won't pull

* libsoup.pc.in (Requires): Add gthread-2.0; the app must call
g_thread_init(), but libsoup won't pull it in itself if built with
--as-needed, so make sure it gets pulled in from here. Noted by
Zeeshan Ali.

svn path=/trunk/; revision=1151

16 years ago2.23.6 LIBSOUP_2_23_6
Dan Winship [Mon, 4 Aug 2008 13:42:30 +0000 (13:42 +0000)]
2.23.6

* configure.in: 2.23.6

* NEWS: update

svn path=/trunk/; revision=1149

16 years agoFix horrible bizarre brokenness in GIOChannel subclassing. #536417, Tor
Dan Winship [Sat, 26 Jul 2008 14:22:00 +0000 (14:22 +0000)]
Fix horrible bizarre brokenness in GIOChannel subclassing. #536417, Tor

* libsoup/soup-gnutls.c: Fix horrible bizarre brokenness in
GIOChannel subclassing. #536417, Tor Lillqvist.

svn path=/trunk/; revision=1148

16 years agoAdd this to schedule a callback in a GMainContext "right away", as opposed
Dan Winship [Sat, 26 Jul 2008 14:19:18 +0000 (14:19 +0000)]
Add this to schedule a callback in a GMainContext "right away", as opposed

* libsoup/soup-misc.c (soup_add_completion): Add this to schedule
a callback in a GMainContext "right away", as opposed to
soup_add_idle(), which uses a lower priority and therefore may not
end up calling the callback for a long time if the application is
busy with I/O. #536676, Benjamin Otte.

* libsoup/soup-dns.c (resolver_thread, async_cancel)
(soup_dns_lookup_resolve_async):
* libsoup/soup-message-io.c (soup_message_io_unpause):
* libsoup/soup-session-sync.c (queue_message_thread):
* libsoup/soup-session-async.c (do_idle_run_queue):
* libsoup/soup-socket.c (async_cancel)
(soup_socket_connect_async):
* tests/test-utils.c (test_server_shutdown): Use
soup_add_completion() rather than soup_add_idle().

* docs/reference/libsoup-2.4-sections.txt: add soup_add_completion

svn path=/trunk/; revision=1147

16 years agodon't add a Host header to the message if the caller already added one.
Dan Winship [Sat, 26 Jul 2008 14:08:31 +0000 (14:08 +0000)]
don't add a Host header to the message if the caller already added one.

* libsoup/soup-message-client-io.c (get_request_headers): don't
add a Host header to the message if the caller already added one.
#539803, Marc Maurer.

* libsoup/soup-logger.c (print_request): likewise

* tests/misc-test.c: new test file for small miscellaneous test
cases.
(do_host_test): test Host-header overriding

svn path=/trunk/; revision=1146

16 years agochange read_length, write_length, and written to goffset so we can
Dan Winship [Sat, 26 Jul 2008 13:29:17 +0000 (13:29 +0000)]
change read_length, write_length, and written to goffset so we can

* libsoup/soup-message-io.c (SoupMessageIOData): change
read_length, write_length, and written to goffset so we can
properly handle message bodies > 4G. #539861, Peter Christensen.

svn path=/trunk/; revision=1145

16 years agoif the server response doesn't include an algorithm, it is supposed to
Dan Winship [Sat, 26 Jul 2008 13:18:57 +0000 (13:18 +0000)]
if the server response doesn't include an algorithm, it is supposed to

* libsoup/soup-auth-digest.c (soup_auth_digest_parse_algorithm):
if the server response doesn't include an algorithm, it is
supposed to default to MD5. #544681, Mads Chr. Olesen.

svn path=/trunk/; revision=1144

16 years agoadd $(GLIB_LIBS) so this still works when building with weird LDFLAGS.
Dan Winship [Sat, 26 Jul 2008 13:10:27 +0000 (13:10 +0000)]
add $(GLIB_LIBS) so this still works when building with weird LDFLAGS.

* tests/Makefile.am (LIBS): add $(GLIB_LIBS) so this still works
when building with weird LDFLAGS. #541506, Götz Waschk.

* docs/reference/Makefile.am (GTKDOC_LIBS): likewise

svn path=/trunk/; revision=1143

16 years agoThe SO_RCVTIMEO and SO_SNDTIMEO options to setsockopt() take int values,
Tor Lillqvist [Wed, 4 Jun 2008 13:25:57 +0000 (13:25 +0000)]
The SO_RCVTIMEO and SO_SNDTIMEO options to setsockopt() take int values,

2008-06-04  Tor Lillqvist  <tml@novell.com>

* libsoup/soup-socket.c (set_fdflags): The SO_RCVTIMEO and
SO_SNDTIMEO options to setsockopt() take int values, in
milliseconds, on Windows. Not struct timeval. Eek. So passing a
struct timeval meant that the tv_sec value (which is first in the
struct) is interpreted as milliseconds. setsockopt apparently
doesn't even get upset by the fact that the option size doesn't
match the sizeof(int) it should expect.

svn path=/trunk/; revision=1142

16 years agofix the path checking
Dan Winship [Fri, 2 May 2008 18:10:10 +0000 (18:10 +0000)]
fix the path checking

* libsoup/soup-cookie.c (soup_cookie_applies_to_uri): fix the path
checking

svn path=/trunk/; revision=1141

16 years agoFix compilation error in the !HAVE_IPV6 && !HAVE_INET_PTON &&
Tor Lillqvist [Tue, 29 Apr 2008 06:32:19 +0000 (06:32 +0000)]
Fix compilation error in the !HAVE_IPV6 && !HAVE_INET_PTON &&

2008-04-29  Tor Lillqvist  <tml@novell.com>

* libsoup/soup-dns.c (soup_dns_is_ip_address): Fix compilation
error in the !HAVE_IPV6 && !HAVE_INET_PTON && !HAVE_INET_ATON
case.

svn path=/trunk/; revision=1140

16 years ago2.23.1, bump AGE and CURRENT LIBSOUP_2_23_1
Dan Winship [Mon, 21 Apr 2008 20:18:18 +0000 (20:18 +0000)]
2.23.1, bump AGE and CURRENT

* configure.in: 2.23.1, bump AGE and CURRENT

* NEWS: update

svn path=/trunk/; revision=1138

16 years ago Fixes for GnuTLS support on Win32. #528752, patch from Marc Maurer
Dan Winship [Sun, 20 Apr 2008 23:11:54 +0000 (23:11 +0000)]
Fixes for GnuTLS support on Win32. #528752, patch from Marc Maurer

* libsoup/soup-gnutls.c (soup_ssl_wrap_iochannel): add an argument
saying whether or not the socket is non-blocking, since there's no
way to determine this from the fd in WinSock.
(do_handshake, soup_gnutls_read, soup_gnutls_write): Update for
that.

* libsoup/soup-socket.c (soup_socket_start_proxy_ssl): Update for
that

* libsoup/soup-nossl.c (soup_ssl_wrap_iochannel): update the
declaration here too

* tests/ssl-test.c: Some updates to get this closer to working on
Windows...

svn path=/trunk/; revision=1137

16 years agoCheck that the cookie was parsed successfully before setting it
Chris Lord [Mon, 14 Apr 2008 21:15:49 +0000 (21:15 +0000)]
Check that the cookie was parsed successfully before setting it

        * libsoup/soup-cookie-jar.c (soup_cookie_jar_set_cookie):
        Check that the cookie was parsed successfully before setting it

svn path=/trunk/; revision=1136

16 years ago Initial HTTP cookie support imported from development git repo,
Dan Winship [Wed, 9 Apr 2008 02:02:02 +0000 (02:02 +0000)]
Initial HTTP cookie support imported from development git repo,
including patches from Xan Lopez.

TODO: make sure the logic in soup_cookie_jar_get_cookies() is
right. Add a test program to tests/.

* libsoup/soup-cookie.c: Code for parsing and generating HTTP
cookies.

* libsoup/soup-cookie-jar.c: Code for managing SoupCookies and
integrating cookie management with a SoupSession.

* libsoup/soup-date.c (soup_date_is_past): New, checks if a
SoupDate refers to a time in the past

* libsoup/soup-dns.c (soup_dns_is_ip_address): New, checks if a
string is a valid IP address

* libsoup/soup-headers.c (soup_header_parse_semi_param_list): New,
like soup_header_parse_param_list, but for semicolon-delimited
data.

svn path=/trunk/; revision=1135

16 years agoMake this a GObject and specifically a SoupSessionFeature. Add an
Dan Winship [Tue, 8 Apr 2008 22:13:03 +0000 (22:13 +0000)]
Make this a GObject and specifically a SoupSessionFeature. Add an

* libsoup/soup-auth-manager.c: Make this a GObject and
specifically a SoupSessionFeature. Add an "authenticate" signal,
and emit that rather than explicitly calling into the SoupSession
and telling it when to emit its own authenticate signal.

* libsoup/soup-auth-manager-ntlm.c: Make this a subclass of
SoupAuthManager, with NTLM support controllable via a property.

* libsoup/soup-session.c (soup_session_init): create an
auth_manager of type SOUP_TYPE_AUTH_MANAGER_NTLM, but defaulting
to USE_NTLM=FALSE. Connect to its "authenticate" signal, and call
soup_session_add_feature() on it.
(set_property, get_property): proxy the USE_NTLM property to the
auth manager.
(auth_manager_authenticate): signal handler for SoupAuthManager
"authenticate" signal. (Replaces soup_session_emit_authenticate(),
which is no longer needed)

svn path=/trunk/; revision=1134

16 years agoNew interface type representing a feature that can be added to a
Dan Winship [Tue, 8 Apr 2008 22:05:14 +0000 (22:05 +0000)]
New interface type representing a feature that can be added to a

* libsoup/soup-session-feature.c: New interface type representing
a feature that can be added to a SoupSession.

* libsoup/soup-session.c (soup_session_add_feature): Add a feature
to the session by prepending it to priv->features and calling
soup_session_feature_attach() on it.
(soup_session_add_feature_by_type): Add a feature to the session
by creating an object of the indicated type and passing it to
soup_session_add_feature.
(soup_session_remove_feature)
(soup_session_remove_feature_by_type): Likewise, remove features
(soup_session_class_init, set_property): register/handle
construct-time feature adding/removing properties
(dispose): cleanup features

* libsoup/soup-logger.c: port to SoupSessionFeature

* tests/test-utils.c (soup_test_session_new): Use
soup_session_add_feature rather than soup_logger_attach.

svn path=/trunk/; revision=1133

16 years agoHaving branched for gnome-2-22, bump version to 2.23.0 for the GNOME 2.23
Dan Winship [Tue, 8 Apr 2008 21:37:12 +0000 (21:37 +0000)]
Having branched for gnome-2-22, bump version to 2.23.0 for the GNOME 2.23

* configure.in: Having branched for gnome-2-22, bump version to
2.23.0 for the GNOME 2.23 series. SOUP_API_VERSION will stay at
2.4, which is confusing but seemed like the best solution at this
point.

svn path=/trunk/; revision=1132

16 years ago2.4.1. Bump AGE and CURRENT. LIBSOUP_2_4_1
Dan Winship [Mon, 7 Apr 2008 17:21:04 +0000 (17:21 +0000)]
2.4.1. Bump AGE and CURRENT.

* configure.in: 2.4.1. Bump AGE and CURRENT.

* NEWS: update

* docs/reference/libsoup-2.4-sections.txt: add new symbols

svn path=/trunk/; revision=1129

16 years agoIf pausing a message that was waiting to unpause, cancel the unpause.
Dan Winship [Mon, 7 Apr 2008 13:22:22 +0000 (13:22 +0000)]
If pausing a message that was waiting to unpause, cancel the unpause.

* libsoup/soup-message-io.c (soup_message_io_pause): If pausing a
message that was waiting to unpause, cancel the unpause.

svn path=/trunk/; revision=1128

16 years agoDon't cache negative results, even if the DNS server explicitly states
Dan Winship [Sat, 5 Apr 2008 20:27:28 +0000 (20:27 +0000)]
Don't cache negative results, even if the DNS server explicitly states

* libsoup/soup-dns.c (resolve_address, resolve_name): Don't
cache negative results, even if the DNS server explicitly states
that the host does not exist; some servers give different answers
to clients inside and outside their firewall. #523269,  Jörgen
Scheibengruber.

svn path=/trunk/; revision=1127

16 years agoNew, replaces SOUP_MESSAGE_OVERWRITE_CHUNKS, but can be set on either the
Dan Winship [Sat, 5 Apr 2008 19:35:35 +0000 (19:35 +0000)]
New, replaces SOUP_MESSAGE_OVERWRITE_CHUNKS, but can be set on either the

* libsoup/soup-message-body.c (soup_message_body_set_accumulate)
(soup_message_body_get_accumulate): New, replaces
SOUP_MESSAGE_OVERWRITE_CHUNKS, but can be set on either the
incoming or outgoing message body.
(soup_message_body_get_chunk): update to still dtrt if !accumulate
(soup_message_body_got_chunk, soup_message_body_wrote_chunk): New
methods to handle accumulating/discarding chunks.

* libsoup/soup-message-io.c (read_body_chunk): Use
soup_message_body_got_chunk.
(io_write): Use soup_message_body_wrote_chunk, to discard unneeded
chunks after writing them. Fixes most of #522146.

* libsoup/soup-message.c (soup_message_class_init): add a new
flag, "server-side", to indicate whether the message is
client-side or server-side, and update several methods to use it.
(got_body): Update for accumulate
(soup_message_set_flags): If the caller changes OVERWRITE_CHUNKS,
update the corresponding accumulate flag.

* libsoup/soup-message.h (SOUP_MESSAGE_OVERWRITE_CHUNKS):
deprecated now

* tests/chunk-test.c (do_request_test): Use
soup_message_body_set_accumulate() now, and verify that the chunks
are being discarded appropriately.
(do_response_test): Use
soup_message_body_set_accumulate() instead of OVERWRITE_CHUNKS.

* tests/pull-api.c (do_fully_async_test)
(do_synchronously_async_test): Use
soup_message_body_set_accumulate().

svn path=/trunk/; revision=1126

16 years agofix test for AI_ADDRCONFIG. Noticed while looking at #526321.
Dan Winship [Sat, 5 Apr 2008 17:11:21 +0000 (17:11 +0000)]
fix test for AI_ADDRCONFIG. Noticed while looking at #526321.

* libsoup/soup-dns.c (resolve_address): fix test for
AI_ADDRCONFIG. Noticed while looking at #526321.

svn path=/trunk/; revision=1125

16 years agoglobally ignore SIGPIPE rather than only doing it around socket write
Dan Winship [Sat, 5 Apr 2008 14:09:40 +0000 (14:09 +0000)]
globally ignore SIGPIPE rather than only doing it around socket write

* libsoup/soup-socket.c (soup_socket_class_init)
(soup_socket_write): globally ignore SIGPIPE rather than only
doing it around socket write calls, since with SSL even socket
read calls may need to write, and also because SIGPIPE is
completely moronic and no one should be using it, and the previous
"solution" wasn't thread-safe anyway. Fixes #524397, reported by
Curtis Magyar.

svn path=/trunk/; revision=1124

16 years ago Misc fixes noticed by "sparse" or by running gcc with additional
Dan Winship [Sat, 5 Apr 2008 13:56:22 +0000 (13:56 +0000)]
Misc fixes noticed by "sparse" or by running gcc with additional
-W flags

* libsoup/soup-auth-manager-ntlm.c (ntlm_authorize_post): fix a
potentially uninitialized variable. (Grumble. gcc needs
-Wdo-optimization-so-you-can-generate-code-flow-related-warnings-
but-then-emit-unoptimized-code-for-ease-of-debugging)

* libsoup/soup-gnutls.c (soup_gnutls_channel_funcs): make this
static

* libsoup/soup-uri.c (uri_decoded_copy, uri_normalized_copy): add
"static". (This doesn't change the generated code; the prototype
was already declared static and so gcc was treating the function
as static even though the main declaration *wasn't* declared
static. I'm not sure if this is a bug in gcc or an oddity of the
spec, but it's confusing, so...)

* libsoup/soup-xmlrpc.c (soup_xmlrpc_build_method_response):
s/FALSE/NULL/

* libsoup/soup-xmlrpc.h: add G_GNUC_PRINTF to
soup_xmlrpc_build_format

* tests/*.c: misc minor fixes, mostly involving missing "const"s
and "static"s to get better warnings, and then remove some unused
variables.

* tests/continue-test.c (do_message): fix a crash when the test
fails

* tests/test-utils.h (debug_printf): add G_GNUC_PRINTF to
prototype

svn path=/trunk/; revision=1123

16 years agoExplicitly assign each of the variables to NULL, because that apparently
Dan Winship [Sat, 5 Apr 2008 13:32:12 +0000 (13:32 +0000)]
Explicitly assign each of the variables to NULL, because that apparently

* libsoup/soup-method.c: Explicitly assign each of the variables
to NULL, because that apparently causes the OS X linker to treat
them differently than if they are left implicitly NULL. #522957.

svn path=/trunk/; revision=1122

16 years agoExplicitly assign each of the variables to NULL, because that apparently
Dan Winship [Sat, 5 Apr 2008 13:26:05 +0000 (13:26 +0000)]
Explicitly assign each of the variables to NULL, because that apparently

* libsoup/soup-method.c: Explicitly assign each of the variables
to NULL, because that apparently causes the OS X linker to treat
them differently than if they are left implicitly NULL. #522957.

svn path=/trunk/; revision=1121

16 years agoadd a new signal "wrote-body-data" to address the problem that
Dan Winship [Fri, 4 Apr 2008 13:20:01 +0000 (13:20 +0000)]
add a new signal "wrote-body-data" to address the problem that

* libsoup/soup-message.c: add a new signal "wrote-body-data" to
address the problem that "wrote-chunk" is not usable for progress
info (especially with non-chunked encoding). #525101, suggested by
Christian Kellner.

* libsoup/soup-message-io.c (write_data): emit wrote-body-data as
appropriate.
(io_write): update so that (a) Content-Length writes can be done
in multiple chunks (as long as the caller explicitly sets the
Content-Length header beforehand), and (b) the body data doesn't
get copied an extra time. Based on a patch from Christian.

* libsoup/soup-message-client-io.c (get_request_headers): Don't
update the Content-Length header if it's already set, even if it
doesn't match the (current) body length.

* tests/chunk-test.c: test some chunk-encoding-related behavior

svn path=/trunk/; revision=1120

16 years ago Be more aggressive about closing unused persistent connections
Dan Winship [Thu, 3 Apr 2008 23:58:38 +0000 (23:58 +0000)]
Be more aggressive about closing unused persistent connections
when needed, to avoid slow load times in WebKit.

* libsoup/soup-session-async.c (run_queue): Remove the
"try_pruning" flag from here and from all the callers, and
*always* try pruning idle connections if it would help.

* libsoup/soup-session.c (soup_session_try_prune_connection):
Rather than only closing a single connection, close all idle
connections.

svn path=/trunk/; revision=1119

16 years agode-constify msg->reason_phrase; it's no more const than any other struct
Dan Winship [Sat, 29 Mar 2008 19:51:05 +0000 (19:51 +0000)]
de-constify msg->reason_phrase; it's no more const than any other struct

* libsoup/soup-message.h (SoupMessage): de-constify
msg->reason_phrase; it's no more const than any other struct
field.

* libsoup/soup-message.c (finalize)
(soup_message_cleanup_response, soup_message_set_status)
(soup_message_set_status_full): don't need to cast reason_phase to
non-const when freeing it now

* libsoup/soup-message-client-io.c (parse_response_headers):
Likewise, remove reason-phrase non-const casts

svn path=/trunk/; revision=1118

16 years agofix the test for no-day-parsed (parse_year): likewise fix the test for
Dan Winship [Sat, 29 Mar 2008 19:43:18 +0000 (19:43 +0000)]
fix the test for no-day-parsed (parse_year): likewise fix the test for

* libsoup/soup-date.c (parse_day): fix the test for no-day-parsed
(parse_year): likewise fix the test for no-year-parsed
(parse_time): don't accept empty components here
(parse_textual_date): don't accept a comma if it wasn't preceded
by a weekday
(soup_date_weekday): Fix leap year handling here; the code this
was originally based on only had to work between 1970 and 2038, so
it didn't worry about the mod 100 and mod 400 rules...

* tests/date.c: Add date/string conversion tests (in particular,
to make sure soup_date_weekday is working). Also add test cases
with missing components and make sure they *don't* parse.

svn path=/trunk/; revision=1117

16 years agoupdate to latest
Dan Winship [Sat, 29 Mar 2008 19:43:07 +0000 (19:43 +0000)]
update to latest

svn path=/trunk/; revision=1116

16 years agodon't crash if the auth_callback returns NULL (meaning "unrecognized
Dan Winship [Tue, 25 Mar 2008 22:55:54 +0000 (22:55 +0000)]
don't crash if the auth_callback returns NULL (meaning "unrecognized

* libsoup/soup-auth-domain-digest.c (accepts): don't crash if the
auth_callback returns NULL (meaning "unrecognized user").

* tests/server-auth-test.c (do_test, do_auth_tests): Test bad
usernames as well as bad passwords.
(main): Remove erroneous local run_tests variable.

Pointed out by Curtis Magyar.

svn path=/trunk/; revision=1115

16 years agoRemove erroneous local run_tests variable. (Noted by "Curtman" on IRC.)
Dan Winship [Tue, 25 Mar 2008 21:52:08 +0000 (21:52 +0000)]
Remove erroneous local run_tests variable. (Noted by "Curtman" on IRC.)

* tests/server-auth-test.c (main): Remove erroneous local
run_tests variable. (Noted by "Curtman" on IRC.)

svn path=/trunk/; revision=1114

16 years agocompare WWW-Authenticate auth schemes case-insensitively.
Dan Winship [Wed, 19 Mar 2008 18:58:08 +0000 (18:58 +0000)]
compare WWW-Authenticate auth schemes case-insensitively.

* libsoup/soup-auth.c (soup_auth_new): compare WWW-Authenticate
auth schemes case-insensitively.

* libsoup/soup-auth-digest.c (update): allow Digest
WWW-Authenticate header with no "qop" option. (The original RFC
2069 style of Digest auth.)
(soup_auth_digest_parse_qop): this returns a bitfield, so don't
return -1 if there are no recognized values.

* tests/httpd.conf.in: use "AuthDigestQop none" in /Digest/realm3
so we test that

Fixes #498484 (Digest auth against Apple's Calendar Server).

svn path=/trunk/; revision=1113

16 years agoAdd a new property, SOUP_SESSION_IDLE_TIMEOUT, to specify a timeout after
Dan Winship [Tue, 18 Mar 2008 23:38:00 +0000 (23:38 +0000)]
Add a new property, SOUP_SESSION_IDLE_TIMEOUT, to specify a timeout after

* libsoup/soup-session.c (soup_session_class_init): Add a new
property, SOUP_SESSION_IDLE_TIMEOUT, to specify a timeout after
which idle connections should be closed.
(soup_session_get_connection): pass the idle_timeout value on to
the connection.

* libsoup/soup-connection.c (soup_connection_class_init): Add
SOUP_CONNECTION_IDLE_TIMEOUT.
(start_idle_timer, stop_idle_timer): add/remove a timeout to call
soup_connection_disconnect().
(socket_connect_result, soup_connection_connect_sync): start the
idle timer after connection is complete
(set_current_request): call stop_idle_timer() when starting a new
request
(clear_current_request): call start_idle_timer() when finishing a
request
(dispose): call stop_idle_timer() when destroying the connection

#518214, based on a patch from Jorn Baayen.

svn path=/trunk/; revision=1112

16 years agoif delaying the unpause to idle time, we need to keep track of the idle
Dan Winship [Tue, 18 Mar 2008 23:08:05 +0000 (23:08 +0000)]
if delaying the unpause to idle time, we need to keep track of the idle

* libsoup/soup-message-io.c (soup_message_io_unpause): if delaying
the unpause to idle time, we need to keep track of the idle source
(soup_message_io_stop): if the message is waiting to unpause
itself, cancel that

* libsoup/soup-server.c (soup_server_pause_message): call
soup_message_io_pause(), not soup_message_io_unpause(). Duh.

svn path=/trunk/; revision=1111

16 years agoDefine two new signals, request_queued and request_unqueued, to provided a
Dan Winship [Sun, 16 Mar 2008 02:28:36 +0000 (02:28 +0000)]
Define two new signals, request_queued and request_unqueued, to provided a

        * libsoup/soup-session.c: Define two new signals, request_queued
        and request_unqueued, to provided a clearer (and
        clearly-documented) lifecycle for messages, helping us (and other
        people) avoid bugs like #522601, SoupSession::authenticate signal
        emitted multiple times per message (reported and analyzed by Tommi
        Komulainen).

        * libsoup/soup-logger.c:
        * libsoup/soup-auth-manager.c:
        * libsoup/soup-auth-manager-ntlm.c: Use request_queued/unqueued

        * tests/auth-test.c (do_async_auth_test): add a regression test

svn path=/trunk/; revision=1110

16 years agoFix Host header syntax when the host is an IPv6 address literal. Noticed
Dan Winship [Fri, 14 Mar 2008 23:10:57 +0000 (23:10 +0000)]
Fix Host header syntax when the host is an IPv6 address literal. Noticed

* libsoup/soup-message-client-io.c (get_request_headers): Fix Host
header syntax when the host is an IPv6 address literal. Noticed
while poking at #522519.

svn path=/trunk/; revision=1109

16 years agoadd an orig_http_version field.
Dan Winship [Fri, 14 Mar 2008 23:09:43 +0000 (23:09 +0000)]
add an orig_http_version field.

* libsoup/soup-message-private.h (SoupMessagePrivate): add
an orig_http_version field.

* libsoup/soup-message.c (soup_message_init): initialize
orig_http_version.
(soup_message_set_http_version): If called before the status code
is received, set orig_http_version too.
(soup_message_cleanup_response): Restore orig_http_version, so
that we don't send an HTTP/1.0 request in response to an HTTP/1.0
redirect. #521848, Tommi Komulainen.

* libsoup/soup-message-server-io.c (get_response_headers):
actually output "HTTP/1.0", not "HTTP/1.1", if the message's http
version is 1.0.

* tests/redirect-test.c (server_callback): Add a regression test;
set http_version to 1.0 when returning a redirect, but require it
to be 1.1 when processing the following request

svn path=/trunk/; revision=1108

16 years agoFix ChangeLog
Xan Lopez [Thu, 13 Mar 2008 23:02:26 +0000 (23:02 +0000)]
Fix ChangeLog

svn path=/trunk/; revision=1107

16 years ago Use G_OBJECT_WARN_INVALID_PROPERTY_ID in all get/set_property functions.
Xan Lopez [Thu, 13 Mar 2008 23:00:41 +0000 (23:00 +0000)]
Use G_OBJECT_WARN_INVALID_PROPERTY_ID in all get/set_property functions.

Bug #522115

svn path=/trunk/; revision=1106

16 years agog_thread_init should be called before any other glib function.
Xan Lopez [Thu, 13 Mar 2008 10:35:28 +0000 (10:35 +0000)]
g_thread_init should be called before any other glib function.

svn path=/trunk/; revision=1105

16 years ago2.4.0! LIBSOUP_2_4_0
Dan Winship [Mon, 10 Mar 2008 21:49:27 +0000 (21:49 +0000)]
2.4.0!

        * configure.in: 2.4.0!

        * NEWS: update

svn path=/trunk/; revision=1103

16 years agotypo in a comment
Dan Winship [Thu, 28 Feb 2008 17:15:48 +0000 (17:15 +0000)]
typo in a comment

svn path=/trunk/; revision=1102

16 years ago (redirect_handler): PROPFIND is defined to be "safe and
Dan Winship [Thu, 28 Feb 2008 17:14:45 +0000 (17:14 +0000)]
(redirect_handler): PROPFIND is defined to be "safe and
idempotent", so allow automatic redirects of it. (Pointed out by
Christian Kellner. FIXME: need a way for apps to declare
additional safe methods). Also, treat 302 like 307, not like 303,
because that behavior is universal in the real world, despite the
spec's protests.

* tests/redirect-test.c (tests): update POST 302 behavior check

* tests/Makefile.am (TESTS): oops, add redirect-test so it gets
run by "make check"/"make distcheck"

svn path=/trunk/; revision=1101

16 years agoRe-revert the change from 2008-02-09; the problem with ssl-test.c was not
Dan Winship [Thu, 28 Feb 2008 17:08:58 +0000 (17:08 +0000)]
Re-revert the change from 2008-02-09; the problem with ssl-test.c was not

* tests/ssl-test.c: Re-revert the change from 2008-02-09; the
problem with ssl-test.c was not that soup_gnutls_init() wasn't
thread-safe, it's that the server thread doesn't do anything that
would ever cause soup_gnutls_init() to be called, and so if the
client thread doesn't start first, the server thread will run
without initializing GNUTLS.

svn path=/trunk/; revision=1100

16 years agofree priv->user_agent. #518798, Wouter Cloetens.
Dan Winship [Thu, 28 Feb 2008 17:05:31 +0000 (17:05 +0000)]
free priv->user_agent. #518798, Wouter Cloetens.

* libsoup/soup-session.c (finalize): free priv->user_agent.
#518798, Wouter Cloetens.

svn path=/trunk/; revision=1099

16 years agoensure that nread/nwrote parameters aren't NULL. They are also properly
Benjamin Otte [Wed, 27 Feb 2008 21:39:27 +0000 (21:39 +0000)]
ensure that nread/nwrote parameters aren't NULL. They are also properly

2008-02-27  Benjamin Otte  <otte@gnome.org>

* libsoup/soup-socket.c: (read_from_network), (soup_socket_read),
(soup_socket_read_until), (soup_socket_write):
ensure that nread/nwrote parameters aren't NULL. They are also
properly set on error paths now.

svn path=/trunk/; revision=1098

16 years ago2.3.4 LIBSOUP_2_3_4
Dan Winship [Mon, 25 Feb 2008 19:44:47 +0000 (19:44 +0000)]
2.3.4

* configure.in: 2.3.4

* NEWS: Update

svn path=/trunk/; revision=1096

16 years agorename from libsoup to libsoup-2.4 (TARGET_DIR): don't need to override
Dan Winship [Mon, 25 Feb 2008 19:28:31 +0000 (19:28 +0000)]
rename from libsoup to libsoup-2.4 (TARGET_DIR): don't need to override

* docs/reference/Makefile.am (DOC_MODULE): rename from libsoup to
libsoup-2.4
(TARGET_DIR): don't need to override this now

* docs/reference/libsoup-2.4.types:
* docs/reference/libsoup-2.4-docs.txt:
* docs/reference/libsoup-2.4-overrides.txt:
* docs/reference/libsoup-2.4-sections.txt: Rename these from
unversioned, to match DOC_MODULE

Fixes doc installation to work with devhelp again. #518384, Mart
Raudsepp.

svn path=/trunk/; revision=1095