2008-04-07 Dan Winship * configure.in: 2.4.1. Bump AGE and CURRENT. * NEWS: update * docs/reference/libsoup-2.4-sections.txt: add new symbols 2008-04-07 Dan Winship * libsoup/soup-message-io.c (soup_message_io_pause): If pausing a message that was waiting to unpause, cancel the unpause. 2008-04-05 Dan Winship * 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. 2008-04-05 Dan Winship * 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(). 2008-04-05 Dan Winship * libsoup/soup-dns.c (resolve_address): fix test for AI_ADDRCONFIG. Noticed while looking at #526321. 2008-04-05 Dan Winship * 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. 2008-04-05 Dan Winship 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 2008-04-05 Dan Winship * 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. 2008-04-04 Dan Winship * 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 2008-04-03 Dan Winship 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. 2008-03-29 Dan Winship * 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 2008-03-29 Dan Winship * 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. 2008-03-25 Dan Winship * 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. 2008-03-19 Dan Winship * 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). 2008-03-18 Dan Winship * 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. 2008-03-18 Dan Winship * 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. 2008-03-15 Dan Winship * 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 2008-03-14 Dan Winship * 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. 2008-03-14 Dan Winship * 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 2008-03-13 Xan Lopez * libsoup/soup-address.c: * libsoup/soup-auth-domain-basic.c: * libsoup/soup-auth-domain-digest.c: * libsoup/soup-auth-domain.c: * libsoup/soup-auth.c: * libsoup/soup-connection.c: * libsoup/soup-message.c: * libsoup/soup-server.c: * libsoup/soup-session.c: * libsoup/soup-socket.c: Use G_OBJECT_WARN_INVALID_PROPERTY_ID in all get/set_property functions. Bug #522115 2008-03-13 Xan Lopez * tests/dns.c: (main): * tests/get.c: (main): * tests/getbug.c: (main): * tests/simple-httpd.c: (main): * tests/simple-proxy.c: (main): * tests/ssl-test.c: (main): * tests/test-utils.c: (test_init): g_thread_init should be called before any other glib function. (#522117)