1 2003-12-19 Dan Winship <danw@ximian.com>
3 * libsoup/soup-message-filter.c: New. An interface for objects
4 that want to act on every message passing through a session.
5 (Initially being used for authentication, but could also be used
6 for cache handling, cookie management, etc.)
8 * libsoup/soup-connection.c (class_init, etc): Add a message
10 (send_request): If the connection has a message filter set, run
11 it on the message before sending it.
12 (soup_connection_connect_async, etc): When setting up a tunnel, if
13 we get back a 407 and the session tries to requeue the message,
14 either re-send it, or return SOUP_STATUS_TRY_AGAIN (depending on
15 whether or not the proxy closed the connection).
16 (soup_connection_connect_sync): Likewise
17 (send_request, request_done): Ref/unref the connection
19 * libsoup/soup-session.c (soup_session_get_type): Implement the
20 SoupMessageFilter interface.
21 (soup_session_get_connection): Use the session as the connection's
23 (soup_session_add_filter, soup_session_remove_filter): Add/remove
24 filters from the session
25 (setup_message): do auth handling, and call each of the session's
26 filters' setup_message methods as well.
27 (soup_session_send_message_via): No longer needed.
28 (connect_result): Handle SOUP_STATUS_TRY_AGAIN.
30 * libsoup/soup-session-async.c (run_queue): Use
31 soup_connection_send_request, since soup_session_send_message_via
34 * libsoup/soup-session-sync.c (send_message): Likewise
36 * libsoup/soup-message.c (soup_message_is_keepalive): A successful
37 response to a CONNECT is always keepalive, even if it's HTTP/1.0
38 with no Connection header.
40 * libsoup/soup-status.h: add SOUP_STATUS_TRY_AGAIN
42 * libsoup/soup-types.h: Add SoupMessageFilter, and macros for
43 gobject interface types.
45 * tests/get.c (main): Add a -p flag to specify a proxy
47 * tests/simple-proxy.c: Fix #includes
49 2003-12-18 Dan Winship <danw@ximian.com>
51 * libsoup/soup-connection.c (soup_connection_disconnect): Actually
52 disconnect the socket rather than just unreffing it, since the IO
53 code may be holding an extra ref on it.
54 (send_request): connect to the "restarted" signal too
55 (request_restarted): Deal with "Connection: close"
57 * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this
58 not go into an infinite loop if the server only supports Basic.
60 2003-12-17 Rodrigo Moya <rodrigo@ximian.com>
62 * libsoup/Makefile.am: install soup-message-queue.h with the rest
65 2003-12-17 Dan Winship <danw@ximian.com>
67 * configure.in: Add gthread to glib check
69 * libsoup/soup-session.c: Make this an abstract class.
71 * libsoup/soup-session-async.c: A SoupSession class for
72 asynchronous gmain-based operation; replaces the old SoupSession.
74 * libsoup/soup-session-sync.c: A SoupSession class for synchronous
75 blocking operation for use with threaded apps.
77 * libsoup/soup-types.h, libsoup/soup.h: add the new session
80 * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
81 try to unref the socket if the socket creation fails.
82 (soup_connection_reserve): New, to explicitly mark a connection as
83 being in use without queueing a message on it.
85 * libsoup/soup-dns.c (check_hostent): Oof. Fix the logic of the
86 "block" flag to not be reversed.
88 * libsoup/soup-message.c (finished): set status to FINISHED here.
89 (soup_message_cancel): Gone; needs to be done at the session
92 * libsoup/soup-message-queue.c: Add a mutex and make all of the
93 operations thread-safe.
95 * libsoup/soup-socket.c (disconnect_internal): Make this
97 (soup_socket_connect): Make the sync case work correctly.
99 * libsoup/Makefile.am: add the SoupSession subclasses
101 * tests/Makefile.am: libsoup depends on libgthread now, so
102 revserver doesn't need to explicitly.
104 * tests/get.c, tests/auth-test.c, tests/simple-proxy.c: Use
105 soup_session_async_new().
107 2003-12-16 Rodrigo Moya <rodrigo@ximian.com>
109 * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_int_value):
112 2003-12-16 Joe Shaw <joe@ximian.com>
114 * libsoup/soup-connection.c (socket_connect_result,
115 soup_connection_connect_sync): Only set up a tunnel if the
116 destination protocol is HTTPS.
118 * libsoup/soup-message.c (class_init): Add a default handler for
120 (wrote_body): Run the SOUP_HANDLER_POST_REQUEST handlers here.
121 (soup_message_cancel): Don't set the status to
122 SOUP_STATUS_CANCELLED and call soup_message_finished() if the
123 status is already SOUP_MESSAGE_STATUS_FINISHED.
125 * libsoup/soup-session.c (set_property): Don't cancel the session
126 if the proxy URI set as a property isn't different from the old
128 (get_host_for_message): Refactor some code so that we can easily
129 get the right SoupSessionHost for proxies as well as from the
131 (authenticate_auth): Take a gboolean proxy parameter. Check it to
132 see which URI (message URI or proxy URI) to use for
133 authentication. Add a long comment about lack of clarity in RFC
134 2617 with respect to proxies and protection spaces.
136 2003-12-15 Dan Winship <danw@ximian.com>
138 * libsoup/soup-socket.h (soup_socket_read, soup_socket_read_until,
139 soup_socket_write): s/guint/gsize/ to match the definitions in
140 soup-socket.c. #52167.
142 2003-12-12 Rodrigo Moya <rodrigo@ximian.com>
144 * libsoup/soup-soap-message.c: removed debugging of the messages here.
146 2003-12-12 Rodrigo Moya <rodrigo@ximian.com>
148 * libsoup/soup-soap-message.c (soup_soap_message_start_envelope):
149 added information for SOAP-ENV namespace.
151 2003-12-10 Dan Winship <danw@ximian.com>
153 * libsoup/soup-message-client-io.c (parse_response_headers): if we
154 receive an HTTP/1.0 response to an HTTP/1.1 request, downgrade the
155 message's http_version so the keep-alive handling is correct.
156 Fixes a problem noticed almost simultaneously by Rodrigo and Joe.
158 * libsoup/soup-message.c (soup_message_restarted, etc): Add a
159 "restarted" signal as suggested by Joe.
161 * libsoup/soup-message-io.c (soup_message_io_finished): emit
162 either "restarted" or "finished" as appropriate
164 * libsoup/soup-session.c (soup_session_queue_message): Connect to
165 "restarted" and run the queue if a message gets restarted
167 * libsoup/soup-status.h: Remove a stray comma that gtk-doc doesn't
170 2003-12-10 Tambet Ingo <tambet@ximian.com>
172 * configure.in: Use autoconfig to check for socklen_t ...
174 * libsoup/soup-address.c: ... and remove it from here ...
176 * libsoup/soup-dns.c: ... and here.
178 2003-12-09 Rodrigo Moya <rodrigo@ximian.com>
180 * libsoup/soup-soap-message.c (soup_soap_message_persist):
181 (soup_soap_message_parse_response): print out request/response's
182 contents, if in debug mode.
184 2003-12-07 JP Rosevear <jpr@ximian.com>
186 * configure.in: Bump version
188 2003-11-28 Rodrigo Moya <rodrigo@ximian.com>
190 * libsoup/soup-soap-response.[ch]
191 (soup_soap_parameter_get_first_child,
192 soup_soap_parameter_get_first_child_by_name,
193 soup_soap_parameter_get_next_child,
194 soup_soap_parameter_get_next_child_by_name): new functions to
195 manage SoupSoapParameter's children.
196 (soup_soap_response_get_first_parameter): dont return a GList, but
197 a SoupSoapParameter contained in the GList.
199 2003-11-26 Rodrigo Moya <rodrigo@ximian.com>
201 * libsoup/soup-soap-response.[ch]
202 (soup_soap_parameter_get_string_value): new function.
204 2003-11-26 Rodrigo Moya <rodrigo@ximian.com>
206 * libsoup/soup-soap-response.[ch]: added SoupSoapParameter
207 structure, to "hide" the usage of xmlNode's.
208 (soup_soap_parameter_get_name): functions to manage SOAP
210 (soup_soap_response_get_first_parameter,
211 soup_soap_response_get_first_parameter_by_name,
212 soup_soap_response_get_next_parameter,
213 soup_soap_response_get_next_parameter_by_name):
214 new functions for an easy access to the response's parameters.
215 (soup_soap_response_from_string): removed warnings.
217 2003-11-25 Rodrigo Moya <rodrigo@ximian.com>
219 * libsoup/soup-soap-response.c (soup_soap_response_set_method_name):
222 2003-11-25 Rodrigo Moya <rodrigo@ximian.com>
224 * libsoup/soup-soap-response.[ch] (soup_soap_response_get_method_name,
225 soup_soap_response_set_method_name, soup_soap_message_get_parameters):
227 (finalize): NULL out new private fields.
228 (soup_soap_response_from_string): added validation code.
230 2003-11-23 Rodrigo Moya <rodrigo@ximian.com>
232 * libsoup/soup-soap-response.[ch]: new class for managing SOAP
235 * libsoup/soup-soap-message.[ch] (soup_soap_message_parse_response):
238 * libsoup/Makefile.am: added new files.
240 2003-11-18 Rodney Dawes <dobey@ximian.com>
242 * gtk-doc.make: Add gtk-doc.make to cvs for systems without gtk-doc
244 2003-11-18 Rodney Dawes <dobey@ximian.com>
246 * acinclude.m4: Add GTK_DOC_CHECK
248 2003-11-18 Dan Winship <danw@ximian.com>
250 * configure.in: Replace old gtk-doc test with GTK_DOC_CHECK()
251 (AC_OUTPUT): add docs/Makefile, docs/reference/Makefile
253 * autogen.sh (REQUIRED_AUTOMAKE_VERSION): 1.6, for gtk-doc.make
255 * Makefile.am: updates for gtk-doc
256 (SUBDIRS): add back "docs"
258 * docs/Makefile.am (EXTRA_DIST): remove, since those old docs
259 aren't around any more
261 * docs/reference/*: set up gtk-doc
263 * libsoup/Makefile.am (INCLUDES): Change G_LOG_DOMAIN to
264 "libsoup". Remove unused defines.
266 * libsoup/soup-connection.c: Fix doc comments
267 * libsoup/soup-message.c: Likewise
268 * libsoup/soup-misc.c: Likewise
269 * libsoup/soup-socket.c: Likewise
270 * libsoup/soup-uri.c: Likewise
272 * libsoup/soup-address.h: Fixes to please gtk-doc
273 * libsoup/soup-connection.h: Likewise
274 * libsoup/soup-message.h: Likewise
275 * libsoup/soup-message-private.h: Likewise
276 * libsoup/soup-misc.h: Likewise
277 * libsoup/soup-server-auth.h: Likewise
278 * libsoup/soup-socket.h: Likewise
279 * libsoup/soup-status.h: Likewise
281 2003-11-18 Dan Winship <danw@ximian.com>
283 * configure.in: Fix up the SSL checks some. Remove some useless
286 * libsoup/soup-misc.h: declare soup_ssl_supported.
288 * libsoup/soup-gnutls.c: add soup_ssl_supported declaration.
290 * libsoup/soup-nossl.c: Not an SSL implementation, built if
291 HAVE_SSL is not defined.
293 * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): add soup-nossl.c
295 * libsoup/soup-socket.c (soup_socket_start_ssl): Return success or
297 (listen_watch): Deal with soup_socket_start_ssl failing.
299 * libsoup/soup-connection.c (tunnel_connect_finished,
300 socket_connect_result, soup_connection_connect_sync): Deal with
301 the soup_socket_start_ssl failing.
303 * libsoup/soup-server.c (soup_server_new): Deal with
304 soup_ssl_get_server_credentials failing
306 2003-11-18 Rodrigo Moya <rodrigo@ximian.com>
308 * libsoup/soup-soap-message.[ch] (soup_soap_message_start_fault,
309 soup_soap_message_end_fault, soup_soap_message_start_fault_detail,
310 soup_soap_message_end_fault_detail, soup_soap_message_start_header,
311 soup_soap_message_end_header,
312 soup_soap_message_start_header_element,
313 soup_soap_message_end_header_element, soup_soap_message_write_int,
314 soup_soap_message_write_double, soup_soap_message_write_base64,
315 soup_soap_message_write_time, soup_soap_message_write_string,
316 soup_soap_message_write_buffer, soup_soap_message_set_element_type,
317 soup_soap_message_set_null, soup_soap_message_add_attribute,
318 soup_soap_message_add_namespace,
319 soup_soap_message_set_default_namespace,
320 soup_soap_message_get_namespace_prefix,
321 soup_soap_message_set_encoding_style, soup_soap_message_reset,
322 soup_soap_message_persist): new functions from old SoupSerializer.
324 2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
326 * libsoup/soup-soap-message.[ch] (soup_soap_message_new,
327 soup_soap_message_new_from_uri): added a bunch of initialization
329 (soup_soap_message_get_xml_doc, soup_soap_message_start_envelope,
330 soup_soap_message_end_envelope, soup_soap_message_start_body,
331 soup_soap_message_end_body, soup_soap_message_start_element,
332 soup_soap_message_end_element):
335 * configure.in: depend on libxml-2.0 for the SOAP code.
337 * libsoup/Makefile.am: use XML CFLAGS and LIBS.
339 2003-11-17 Joe Shaw <joe@ximian.com>
341 * configure.in: Add in the --enable-libgpg-error flag from the 2.0
344 * acinclude.m4: Include the gpg-error macros.
346 2003-11-17 Rodrigo Moya <rodrigo@ximian.com>
348 * libsoup/soup-soap-message.[ch]: new class to make it easier to
351 * libsoup/Makefile.am: added new files.
353 * configure.in: increased version number.
355 2003-10-24 Joe Shaw <joe@ximian.com>
357 * libsoup/soup-address.c (update_address_from_entry): Call
358 soup_dns_entry_get_hostent() on the SoupAddress passed in, not the
359 one in addr->priv->lookup. Fixes a crash on synchronous DNS
362 * libsoup/soup-server.c (soup_server_new): We need to ref the
363 address we're binding to, because soup_socket_get_local_address()
366 2003-10-23 Dan Winship <danw@ximian.com>
368 * libsoup/soup-socket.c (init): Initialize flags to default
371 2003-09-23 Dan Winship <danw@ximian.com>
373 * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but
374 note whether or not the CA file has been loaded.
375 (SoupGNUTLSChannel): add a "hostname" field.
376 (verify_certificate): Remove the comment about not being able to
377 verify the hostname because of soup problems. Now it's because of
378 GNUTLS problems instead.
379 (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel,
380 and takes a hostname and a creds argument now.
381 (soup_ssl_get_client_credentials,
382 soup_ssl_get_server_credentials): Return client/server credentials
384 (soup_ssl_free_client_credentials,
385 soup_ssl_free_server_credentials): and free them.
387 * libsoup/soup-session.c (class_init, set_property, get_property):
388 add ssl_ca_file property
389 (get_host_for_message): when returning an SSL host for the first
390 time, create a client credentials structure for the session.
391 (run_queue): Pass the ssl creds to the new connection. Also fix an
392 unrelated bug that caused infinite loops on "bad hostname".
394 * libsoup/soup-server.c: Use GObject properties, including
395 ssl_cert_file and ssl_key_file properties.
396 (soup_server_new): Remove "protocol" argument; if the cert file
397 and key file properties were set, create a server credential
398 structure from them and pass that to soup_socket_server_new.
400 * libsoup/soup-connection.c (SoupConnectionPrivate): Rename
401 dest_uri to origin_uri to match RFC 2616 terminology. Add an
403 (class_init, set_property, get_property): add SSL_CREDS property
404 (soup_connection_connect_async, soup_connection_connect_sync):
405 Pass ssl_creds to soup_socket_client_new calls.
407 * libsoup/soup-socket.c: Use GObject properties, including an
409 (soup_socket_set_flags): Gone (replaced with boolean properties)
410 (soup_socket_new): Make this take a list of properties
411 (listen_watch): copy ssl creds from listener to new socket
412 (soup_socket_start_ssl): Pass remote hostname and socket creds
413 structure to soup_ssl_wrap_iochannel.
414 (soup_socket_client_new_async, soup_socket_client_new_sync,
415 soup_socket_server_new): Replace the SSL boolean with an ssl_creds
418 * libsoup/soup-misc.c (soup_set_ssl_ca_file,
419 soup_set_ssl_cert_files, soup_get_ssl_ca_file,
420 soup_get_ssl_cert_files): Gone. SSL state is now per-session or
423 * tests/get.c: add a "-c CAfile" argument, for loading a CA
424 certificate file to validate https connections against
426 * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile"
427 arguments for loading an SSL server certificate. Only start an SSL
428 server if those arguments were used.
430 * tests/test-cert.pem:
431 * tests/test-key.pem: SSL certificate for testing simple-httpd
433 * tests/revserver.c: Update for API changes
434 * tests/simple-proxy.c: Likewise
436 2003-09-22 Dan Winship <danw@ximian.com>
438 * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
441 * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
442 (soup_set_security_policy, soup_get_security_policy): Remove,
443 since the GNUTLS backend doesn't actually implement it.
444 (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
446 * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
449 * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
452 * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
453 soup_ssl_get_server_iochannel into a single function that takes a
456 * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
457 (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
458 (soup_gnutls_set_security_policy): Gone
460 * libsoup/soup-gnutls.h
461 * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
464 * libsoup/soup-socket.c: Move soup_sockaddr_max
465 #define here from soup-private.h
466 (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
469 * libsoup/soup-private.h: Gone
471 * libsoup/soup-address.c: Fix #includes for soup-private.h and
473 * libsoup/soup-auth-digest.c: Likewise
474 * libsoup/soup-auth.c: Likewise
475 * libsoup/soup-connection-ntlm.c: Likewise
476 * libsoup/soup-connection.c: Likewise
477 * libsoup/soup-dns.c: Likewise
478 * libsoup/soup-gnutls.c: Likewise
479 * libsoup/soup-headers.c: Likewise
480 * libsoup/soup-message-client-io.c: Likewise
481 * libsoup/soup-message-handlers.c: Likewise
482 * libsoup/soup-message-io.c: Likewise
483 * libsoup/soup-message-server-io.c: Likewise
484 * libsoup/soup-message.c: Likewise
485 * libsoup/soup-server-message.c: Likewise
486 * libsoup/soup-server.c: Likewise
487 * libsoup/soup-session.c: Likewise
488 * libsoup/soup-socket.c: Likewise
489 * tests/auth-test.c: Likewise
491 2003-09-19 Dan Winship <danw@ximian.com>
493 * libsoup/soup-address.c (update_address_from_entry): free the
496 * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't leak
499 * libsoup/soup-gnutls.c (soup_gnutls_get_iochannel): Add some more
500 iochannel initialization. Not sure how this worked before...
502 * libsoup/soup-message.c (soup_message_cleanup_response): Renamed
503 from soup_message_prepare (and a few things removed).
505 * libsoup/soup-message-client-io.c (soup_message_send_request):
506 s/soup_message_prepare/soup_message_cleanup_response/
508 * libsoup/soup-message-io.c (io_read): Replace the final "\r\n"
509 with "\0" on the headers before passing them to the parse
511 (io_read): Call soup_message_cleanup_response after returning an
512 informational response so the data doesn't leak.
514 * libsoup/soup-headers.c (soup_headers_parse): Update for
515 soup-message-io.c:io_read change
517 * libsoup/soup-server.c (soup_server_new,
518 soup_server_new_with_host): Don't leak the SoupAddress.
520 * libsoup/soup-session.c (class_init): Make PROP_PROXY_URI not
522 (set_property): If the proxy uri changes, call
523 soup_session_abort() and cleanup_hosts().
524 (request_finished, final_finished): Fix a bug when requeuing
527 * tests/libsoup.supp: valgrind suppression file for soup tests
529 * tests/Makefile.am (EXTRA_DIST): dist it.
530 (noinst_PROGRAMS): move the former check_PROGRAMS to
531 noinst_PROGRAMS instead.
533 2003-09-18 Dan Winship <danw@ximian.com>
535 * libsoup/soup-message.c: Add wrote_informational and
536 got_informational signals.
538 * libsoup/soup-message-client-io.c (get_request_headers): Set the
539 EXPECT_CONTINUE flag on the message if that header is set.
541 * libsoup/soup-message-server-io.c (parse_request_headers):
544 * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
545 when blocking on an expect-continue. Emit wrote_informational
546 instead of wrote_headers in the 1xx case.
547 (io_read): Set read_state to BLOCKING, not NOT_STARTED after
548 reading a 100 Continue response. Emit got_informational instead of
549 got_headers in the 1xx case.
551 * libsoup/soup-session.c (soup_session_send_message): Reorder
552 things to deal with the fact that the message could finish right
553 away if there is a connection available and the server is very
556 * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
557 SOUP_STATUS_CLASS_TRANSPORT_ERROR.
559 2003-09-17 Dan Winship <danw@ximian.com>
561 * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
562 (one that pruned too little, one that pruned too much).
563 (queue_message): When requeuing, don't run the queue;
564 final_finished will take care of that later.
565 (soup_session_abort): New, to cancel all pending requests.
567 * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
568 the socket while waiting for the address to resolve
570 2003-09-17 Dan Winship <danw@ximian.com>
572 * libsoup/soup-connection.c (soup_connection_new): Replaces the
573 three previous soup_connection_new* functions and uses gobject
574 properties to set the destination and proxy uris.
575 (class_init): set up two more signals, authenticate and
577 (soup_connection_send_request): virtualize
578 (send_request): Default implementation
580 * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
581 also handles NTLM authentication. Includes all of the NTLM code
582 formerly in soup-auth-ntlm.c.
584 * libsoup/soup-auth-ntlm.[ch]: Gone.
586 * libsoup/soup-auth.c: Remove NTLM refs
588 * libsoup/soup-session.c (class_init): Add gobject properties for
589 proxy, max_conns, use_ntlm. Change the "authenticate" and
590 "reauthenticate" signal prototypes to not pass a SoupAuth (so they
591 can be used for authenticating SoupConnectionNTLM as well, which
592 doesn't use a SoupAuth).
593 (soup_session_new): Renamed from soup_session_new_default.
594 (soup_session_new_with_options): Replaces
595 soup_session_new_with_proxy and soup_session_new_full. Takes
597 (run_queue): Create a new connection of type SoupConnection or
598 SoupConnectionNTLM depending on our "use_ntlm" property. Connect
599 to its authenticate and reauthenticate signals.
600 (connection_authenticate, connection_reauthenticate): proxy these
603 * libsoup/soup-address.c (update_address_from_entry): Fix a
604 crasher when failing to resolve the address.
606 * libsoup/soup-dns.c (check_hostent): Fix some "how was this
607 working before" bugs.
609 * libsoup/soup-message-client-io.c (soup_message_send_request):
610 call soup_message_prepare() to clean up the existing response
613 * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
614 when processing an OK EOF.
616 * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
617 these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
619 * tests/auth-test.c (authenticate, reauthenticate): Update for new
621 (main): Use soup_session_new.
622 * tests/get.c (main): Likewise.
623 * tests/simple-proxy.c (main): Likewise.
625 2003-09-10 Dan Winship <danw@ximian.com>
627 * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
629 (invalidate_auth): Remove the call to soup_auth_invalidate.
630 (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
631 contain authentication, then emit "authenticate" or
632 "reauthenticate" (depending on whether or not this is the first
633 time we've asked for a password for this auth).
634 (update_auth_internal): If the server rejects our
635 username/password, don't bail out immediately. Try doing a
636 "reauthenticate" first.
638 * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
640 * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
642 (soup_auth_invalidate): Remove this; it doesn't actually do
643 anything useful for us.
645 * libsoup/soup-auth-basic.c (invalidate): Remove
646 * libsoup/soup-auth-digest.c: (invalidate): Remove
647 * libsoup/soup-auth-ntlm.c: (invalidate): Remove
649 * libsoup/soup-uri.c: Remove all references to "authmech".
650 (soup_uri_set_auth): Remove this too.
652 * tests/auth-test.c: Update to use the "authenticate" and
653 "reauthenticate" signals instead of encoding usernames and
654 passwords in the URIs. Add a few more test cases.
656 2003-09-10 Dan Winship <danw@ximian.com>
658 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
659 "status" field from here, since it's mostly used by SoupSession,
660 which shouldn't need access to SoupMessagePrivate.
662 * libsoup/soup-message.h (SoupMessage): Move it here.
663 (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
664 (soup_message_set_uri): also moved from soup-message-private.h
666 * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
668 * libsoup/soup-message-handlers.c:
669 s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
671 * libsoup/soup-message-io.c (soup_message_io_client,
672 soup_message_io_server, soup_message_io_unpause): Don't set up an
673 idle handler, just jump right in to reading/writing; if this is a
674 synchronous socket, then the caller wants to block, and if it's
675 not, then we'll quickly get an EAGAIN anyway.
677 * libsoup/soup-session.c: (queue_message): Likewise.
678 (*) Update for SoupMessageStatus move and remove
679 soup-message-private.h include.
681 * libsoup/soup-server-message.c: Remove soup-message-private.h
684 * libsoup/soup-server.c: Likewise.
686 * libsoup/soup-connection.c (soup_connection_is_connected,
687 soup_connection_is_new): Remove these, since they weren't being
690 * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
691 avoid namespace pollution.
693 * libsoup/soup-auth-digest.c: Update for that.
694 * libsoup/soup-server-auth.c: Likewise
696 * tests/auth-test.c: Remove soup-message-private.h include
698 2003-09-09 Dan Winship <danw@ximian.com>
700 Beginnings of improved synchronous API support
702 * libsoup/soup-dns.c: Simplify this by making it not automatically
703 return the result: force the caller to poll. (This isn't really a
704 performance issue: the results should come back quickly anyway.)
705 Also, make the cache thread-safe.
706 (soup_dns_entry_from_name): Was soup_gethostbyname
707 (soup_dns_entry_from_addr): Was soup_gethostbyaddr
708 (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
709 (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
710 blocks if it's not resolved yet).
712 * libsoup/soup-address.c: Update for soup-dns changes.
713 (soup_address_new): Don't automatically start resolving the
714 hostname now, since we don't know if the caller is going to want
715 it resolved synchronously or asynchronously.
716 (soup_address_resolve_async): Renamed from soup_address_resolve.
717 (soup_address_resolve_sync): New routine to do blocking
720 * libsoup/soup-socket.c (soup_socket_connect): Now returns a
721 status value directly when connecting synchronously.
722 (soup_socket_client_new_async, soup_socket_client_new_sync):
723 Separate async/sync client socket functions.
724 (soup_socket_get_iochannel): Made static since it was not used
727 * libsoup/soup-connection.c (soup_connection_new,
728 soup_connection_new_proxy, soup_connection_new_tunnel): Just set
729 up the data, don't actually start connecting.
730 (soup_connection_connect_async, soup_connection_connect_sync): New
731 async and sync SoupConnection connecting routines.
732 (soup_connection_get_socket): Remove this since it wasn't being
735 * libsoup/soup-session.c (final_finished): Run the queue since a
736 connection is now freed up.
737 (run_queue): Update for soup_connection_new* changes.
739 * libsoup/soup-misc.c (soup_substring_index): Remove, since it
740 wasn't being used any more.
742 * libsoup/soup-private.h: Remove some prototypes for functions
743 that no longer exist.
745 * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
746 (copies the protocol, host, and port of a SoupUri).
750 * tests/simple-proxy.c: belatedly update for soup-session change
752 * tests/revserver.c: Handle each new connection in its own thread,
753 using synchronous SoupSocket calls.
755 2003-09-05 Dan Winship <danw@ximian.com>
757 * libsoup/soup-session.c: Move a bunch of logic here from
758 soup-context. Now the session keeps track of hosts (instead of
759 having a global soup_hosts hash) and their connections.
760 (soup_session_new_with_proxy, soup_session_new_full): New session
761 constructors to specify a proxy or a proxy and connection limits
762 (send_request): Add Authorization and Proxy-Authorization headers
763 before sending off the request.
764 (soup_session_queue_message, et al): Improve the way this works.
765 There's no need to use timeouts to wait for connections to become
766 free; we *know* when they become free.
768 * libsoup/soup-private.h: Remove SoupHost and some other
769 no-longer-used stuff.
771 * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
772 soup_set_connection_limit, soup_set_connection_limit): Gone. These
773 are all per-session now.
775 * libsoup/soup-message.c: Remove all SoupContext references
776 (mostly replaced with SoupUri references)
777 (cleanup_message): priv->connect_tag and priv->connection are gone
778 now, so this was just soup_message_io_cancel(). So remove
779 cleanup_message and replace it with that everywhere.
780 (soup_message_disconnect): Gone.
781 (soup_message_set_uri): Replaces soup_message_set_context.
782 (soup_message_set_connection, soup_message_get_connection): Gone
784 * libsoup/soup-message-server-io.c (parse_request_headers):
785 s/soup_message_set_context/soup_message_set_uri/
787 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
788 connect_tag, context, and connection.
790 * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
792 * libsoup/soup-context.c: Gone
794 * tests/auth-test.c (identify_auth): update for session/context
797 2003-09-03 Dan Winship <danw@ximian.com>
799 * libsoup/soup-status.h: Renamed from soup-error.h, with types
800 and defines renamed accordingly.
802 * libsoup/soup-message.h (SoupMessage): Rename errorcode to
803 status_code and errorphrase to reason_phrase. Remove errorclass.
804 (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
805 as being either "errors" or "not errors", so its semantics are
806 guaranteed to be wrong sometimes.
808 * libsoup/soup-message.c (soup_message_set_status,
809 soup_message_set_status_full): Renamed
811 * libsoup/soup-message-handlers.c
812 (soup_message_add_status_code_handler,
813 soup_message_add_status_class_handler): Rename.
815 * libsoup/soup-session.c (soup_session_send_message): Make this
816 return a status code rather than a status class.
818 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
819 unrelated unused fields (retries, callback, user_data).
823 2003-09-02 Dan Winship <danw@ximian.com>
825 * libsoup/soup-session.c: First draft at the new object to
826 maintain formerly-global state. (Not yet complete; still need to
827 get rid of SoupContext).
829 * libsoup/soup-message-queue.c: Data structure used by SoupSession
831 * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
832 some bits went into soup-connection.
834 * libsoup/soup-connection.c (soup_connection_send_request): New,
835 to send a request on a connection. The connection updates its
836 internal state and then hands off to soup_message_send_request.
837 (request_done): Callback set up by soup_connection_send_request.
838 Marks the connection as no-longer-in-use, and disconnects it if
840 (soup_connection_set_in_use, soup_connection_mark_old): No longer
841 needed; the connection takes care of this itself now.
842 (soup_connection_new_proxy): New, to create a new connection that
843 is explicitly marked as being through an HTTP proxy.
844 (soup_connection_new_tunnel): New, to create a new HTTPS
845 connection through a proxy. (Includes the code to send the
848 * libsoup/soup-context.c (try_existing_connections): Don't need to
849 call soup_connection_set_in_use.
850 (try_create_connection): Use soup_connection_new,
851 soup_connection_new_proxy, or soup_connection_new_tunnel as
854 * libsoup/soup-message.c (soup_message_prepare): Replaces
856 (soup_message_queue, soup_message_requeue, soup_message_prepare):
857 Gone. This must be done via a SoupSession now.
858 (soup_message_set_connection): don't need to mark in_use/not
859 in_use. Also, msg->priv->socket is gone now.
860 (soup_message_get_socket): Gone.
862 * libsoup/soup-message-handlers.c (soup_message_run_handlers):
863 Remove references to global handlers.
864 (redirect_handler, authorize_handler): Moved to soup-session.c.
866 * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
867 session to shut down now.
869 * libsoup/soup.h: add soup-session.h
871 * libsoup/Makefile.am: updates
873 * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
876 2003-08-29 Dan Winship <danw@ximian.com>
878 * libsoup/soup-message-io.c: Major rewrite. There is now only a
879 single IO state object (instead of one for reading and one for
880 writing), and the IO code handles switching back and forth between
881 reading and writing as appropriate (including handling the extra
882 switches needed for "Expect: 100-continue").
883 (soup_message_io_client, soup_message_io_server): The new entry
885 (soup_message_io_cancel): If the caller cancels the IO when we
886 were expecting to read more data, disconnect the socket.
888 * libsoup/soup-message.h (SoupMessageFlags): add
889 SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
890 do the special expect-continue handling.
892 * libsoup/soup-message.c: Move all the signal stuff here. Remove
893 the "done_reading" and "done_writing" signals and replace them
894 with a single "finished" signal. (A single signal. Say that 10
896 (soup_message_got_headers, etc): Functions to emit signals.
897 (got_headers, got_chunk, got_body): Default signal methods that
898 call soup_message_run_handlers.
899 (finished): Default signal method that replaces
900 soup_message_issue_callback.
901 ([various]): s/soup_message_issue_callback/soup_message_finished/
902 (soup_message_requeue): There's no soup_message_set_read_callbacks
903 any more, so if the caller requeues while it's still reading, just
905 (soup_message_add_chunk, soup_message_add_final_chunk,
906 soup_message_pop_chunk): Moved here from soup-server-message,
907 although we don't actually quite support using chunked encoding
910 * libsoup/soup-server-message.c (soup_server_message_new): No
911 longer takes a socket argument.
912 (soup_server_message_add_chunk, soup_server_message_get_chunk):
913 Moved into SoupMessage.
915 * libsoup/soup-message-handlers.c (global_handlers): Make these
916 POST_BODY rather than PRE_BODY, so they won't mess up the IO
917 channel when the requeue the message.
918 (soup_message_run_handlers): Don't need to issue the message
919 callback from here any more.
920 (authorize_handler): Just leave the error as 401 or 407 (see
923 * libsoup/soup-message-client-io.c (soup_message_send_request):
924 Replaces soup_message_write_request and
925 soup_message_read_response.
927 * libsoup/soup-message-server-io.c: Parallel to
928 soup-message-client-io.c, this defines the server-side header
930 (soup_message_read_request): Its entry point.
932 * libsoup/soup-server.c: Lots of code moved into
933 soup-message-server-io.c. Update for other changes.
935 * libsoup/soup-queue.c: Update for changes
937 * libsoup/soup-socket.c (read_from_network, soup_socket_write):
938 Don't call soup_socket_disconnect() on an error, just return
939 SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
940 signals that will mess up the caller of the read/write function.
942 * libsoup/soup-connection.c (soup_connection_disconnect): When
943 disconnecting the socket, disconnect from its signals first to
944 prevent bad reentrancy.
946 * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
947 SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
948 anything that SOUP_ERROR_UNATHORIZED and
949 SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
950 "transport" errors actually are transport-related.)
952 * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
954 * tests/simple-proxy.c: Complicate this a bunch. In particular,
955 use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
956 pass the data back to the client in chunked format.
958 2003-08-27 Dan Winship <danw@ximian.com>
960 * libsoup/soup-types.h: New header with typedefs, to avoid
961 #include loops among other headers.
963 * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
965 * libsoup/*.[ch], tests/*.c: Update for soup-types.h
967 2003-08-26 Dan Winship <danw@ximian.com>
969 * libsoup/soup-message-client-io.c (soup_message_write_request,
970 soup_message_read_response): Higher-than-soup-message-io-level
971 functions to do client-side IO. (Code that used to be in
973 (get_request_header_cb): Fix a bug in the generation of the Host:
974 header; need to include the port number if it's not the default.
976 * libsoup/soup-message-io.c (soup_message_write,
977 soup_message_write_simple): Take separate user_datas for the get_*
978 callbacks and the done callbacks.
980 * libsoup/soup-queue.c: Update to use soup_message_write_request
981 and soup_message_read_response.
983 * libsoup/soup-connection.c (soup_connection_new): Change the
984 prototype to take a SoupUri and a callback.
986 * libsoup/soup-context.c (try_create_connection,
987 soup_context_connect_cb): Update for soup_connection_new change.
989 * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
990 for soup_message_write changes
992 * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
995 2003-08-26 Dan Winship <danw@ximian.com>
997 * libsoup/soup-message-private.h: Define SoupMessage signal stuff
998 (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
999 WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
1001 * libsoup/soup-message.c (class_init): set up signals
1002 (requeue_read_finished): Update for changes.
1004 * libsoup/soup-message-io.c (soup_message_read): Split out
1005 parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
1006 arg to say where to store the message body. Set up
1007 read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
1009 (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
1010 (read_body_chunk): emit READ_CHUNK.
1011 (issue_final_callback): Set r->body. emit READ_BODY.
1012 (failed_read): emit READ_ERROR.
1013 (soup_message_read_set_callbacks): Disconnect old signal handlers,
1015 (soup_message_read_cancel): Disconnect signal handlers.
1016 (soup_message_write, soup_message_write_simple): Set up
1017 wrote_body_cb and error_cb as signal handlers.
1018 (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
1019 nothing currently ever listens for them. emit WROTE_BODY when
1021 (failed_write): emit WRITE_ERROR
1023 * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
1024 soup_queue_read_headers_cb): Split this into two unequal chunks.
1025 (read_header_cb only runs the pre-body handlers).
1026 (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
1028 (soup_queue_write_done_cb): Update call to soup_message_read
1030 * libsoup/soup-server.c (parse_headers_cb): Renamed from
1032 (read_done_cb): Update prototype
1033 (start_request): Update soup_message_read call.
1035 2003-08-25 Dan Winship <danw@ximian.com>
1037 * libsoup/soup-message-io.c (soup_message_read,
1038 soup_message_write, soup_message_write_simple): Add a "user_data"
1039 arg, pass it to the callbacks.
1041 * libsoup/soup-message.c (soup_message_requeue,
1042 requeue_read_finished, requeue_read_error): Update for that
1044 * libsoup/soup-queue.c: Likewise
1046 * libsoup/soup-server.c: Likewise
1048 2003-08-25 Dan Winship <danw@ximian.com>
1050 * libsoup/soup-message.c (soup_message_new): Take a uri string
1051 instead of a context. Also, swap the args (so the method comes
1052 before the URI, just like in the protocol).
1053 (soup_message_new_from_uri): Like soup_messgae_new, but takes a
1054 SoupUri instead of a string
1055 (soup_message_set_request, soup_message_set_response): Replace
1056 soup_message_new_full.
1057 (cleanup_message): Was soup_message_cleanup, but is static now.
1058 (queue_message): Do the pre-queuing message cleanup here instead
1059 of in soup_queue_message.
1060 (soup_message_queue): Set the callback and user_data, then call
1062 (requeue_read_error, requeue_read_finished, soup_message_requeue):
1064 (soup_message_get_uri): Replaces soup_message_get_context.
1066 * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
1067 part of SoupMessagePrivate now)
1069 * libsoup/soup-context.c: #include soup-message-private
1070 (soup_context_from_uri): constify the uri arg.
1072 * libsoup/soup-queue.c: Various context/uri fixes
1073 (proxy_https_connect): Use soup_message_new_from_uri.
1074 (soup_queue_message): Drastically simplified since most of the
1075 work is in soup-messsage.c:queue_message() now
1077 * libsoup/soup-auth-digest.c (compute_response,
1078 get_authorization): Use soup_message_get_uri.
1080 * libsoup/soup-server-auth.c (parse_digest): Likewise
1082 * libsoup/soup-server.c (call_handler): Likewise
1084 * tests/simple-httpd.c (server_callback): Likewise.
1086 * tests/simple-proxy.c (server_callback): Likewise
1088 * tests/get.c (got_url): Likewise.
1089 (get_url): Update soup_message_new usage.
1091 * tests/auth-test.c: #include soup-message-private. Update for
1092 context changes and soup_message_new change.
1094 2003-08-22 Dan Winship <danw@ximian.com>
1096 * libsoup/soup-message-private.h: New file containing
1097 SoupMessagePrivate and some other soup-message-internal
1098 types/functions. Also includes the new, expanded SoupMessageStatus
1101 * libsoup/soup-message-io.c: Replaces what used to be in
1102 soup-transfer, but now all the interfaces take SoupMessages
1103 instead of SoupReader/SoupWriter and deal with maintaining
1104 msg->priv->{read,write}_state themselves. Fixes up all the
1105 refcounting madness.
1107 * libsoup/soup-message-handlers.c: Move the handler code here,
1108 mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
1109 to make the distinction from SoupHandlerKind clearer.)
1111 * libsoup/soup-message.c: Update for soup-message-io and new
1112 SoupMessageStatus values. Remove handler code.
1113 (soup_message_cleanup): Remove the hack to try to preserve the
1114 connection if the message gets cleaned up before it finishes
1115 reading. soup_message_requeue handles this in the requeuing case,
1116 and there's no especially compelling reason to bother doing it in
1117 any other case. (And the soup-message-io api doesn't support
1118 having a read operation that's not connected to any message.)
1120 * libsoup/soup-private.h: remove SoupMessagePrivate
1122 * libsoup/soup-queue.c: Update for soup-message-io and new
1123 SoupMessageStatus values.
1125 * libsoup/soup-server-message.c: Likewise
1127 * libsoup/soup-server.c: Likewise
1129 * libsoup/soup-transfer.c: Gone (yay)
1131 * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
1133 2003-08-20 Dan Winship <danw@ximian.com>
1135 * libsoup/soup-message.c: Make this a GObject. (Note that since
1136 SoupMessage was not refcounted before, it's not really refcounted
1138 (soup_message_free): Gone, replaced by g_object_unref
1139 (soup_message_copy, soup_message_foreach_remove_header): Remove
1140 these, since neither was currently functional.
1141 (soup_message_is_keepalive): New utility function to look at
1142 HTTP version and request/response headers to decide if a message
1143 indicates the connection should be kept alive.
1144 (soup_message_set_connection, soup_message_get_connection): New
1145 (soup_message_get_socket): New
1147 * libsoup/soup-server-message.c: Make this a subclass of
1149 (soup_server_message_new): Now takes a SoupServer and SoupSocket
1150 (soup_server_message_get_server): New
1151 (soup_server_message_set_encoding,
1152 soup_server_message_get_encoding): Get/set whether the message
1153 should be sent with content-length or chunked encoding
1154 (soup_server_message_is_started, soup_server_message_is_finished):
1155 Private member accessors.
1156 (soup_server_message_add_chunk): Renamed from add_data
1157 (soup_server_message_get_chunk): Pops a chunk from the list.
1158 (soup_server_message_get_source): Gone
1160 * libsoup/soup-server.c: Update for SoupServerMessage changes.
1161 (error_cb, write_done_cb): All the cleanup stuff that used to be
1162 here happens automatically by unreffing the message now.
1163 (get_response_header): Remove some erroneous leftover CGI stuff
1164 (issue_bad_request): add "Connection: close" to the response.
1165 (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
1166 with no Host header as per RFC 2616.
1168 * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
1169 (soup_connection_set_in_use): Let the caller set the connection to
1170 "not in use" even after the socket has been disconnected.
1172 * libsoup/soup-context.c: Use soup_message_get_connection
1174 * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
1175 check on request length, since it was rejecting
1176 "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
1178 * libsoup/soup-queue.c: Use soup_message_get_connection and
1179 soup_message_get_socket.
1180 (soup_queue_read_done_cb): Use soup_message_is_keepalive
1181 (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
1182 soup_connection_start_ssl
1184 * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
1185 handlers if the socket hasn't been disconnected yet.
1187 * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
1188 reader_read): Fix these so that reader_read will exit properly if
1189 the read is cancelled.
1191 * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
1193 * tests/simple-httpd.c (server_callback): set the message to
1194 content-length encoding.
1195 * tests/simple-proxy.c (server_callback): Likewise
1197 2003-08-19 Dan Winship <danw@ximian.com>
1199 * libsoup/soup-socket.c (soup_socket_read,
1200 soup_socket_read_until, soup_socket_write): New API for doing
1201 socket IO. Works both synchronously and asynchronously, and
1202 buffers data to prevent the "100 Continue" problem.
1203 (soup_socket_set_flag): Replaces formerly-private
1204 soup_set_sockopts. (primarily to let the caller turn off
1205 SOUP_SOCKET_FLAG_NONBLOCKING).
1207 * libsoup/soup-transfer.c (soup_transfer_read,
1208 soup_transfer_write, soup_transfer_write_simple): Take a
1209 SoupSocket instead of a GIOChannel. Use the new socket IO api.
1210 Changed the prototypes of some of the callbacks to be less
1213 * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
1214 soup_connection_get_iochannel.
1216 * libsoup/soup-message.c: Fix up for soup-transfer changes
1218 * libsoup/soup-queue.c: Likewise
1220 * libsoup/soup-server.c: Likewise
1222 * tests/revserver.c: A slightly more complicated replacement for
1223 timeserver. (Does both reads and writes)
1225 2003-08-19 Dan Winship <danw@ximian.com>
1227 * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
1228 configure it, and no one has complained, and it looks like the
1229 SOCKS5 auth code doesn't actually work anyway...
1231 * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
1233 * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
1234 SOUP_PROTOCOL_SOCKS5
1236 * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
1238 * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
1241 2003-08-19 Dan Winship <danw@ximian.com>
1243 * libsoup/soup-server.c: Make this a GObject. Remove
1244 SoupServerMessage code (to soup-server-message.c). Remove CGI
1245 server code (for now?)
1246 (soup_server_add_handler, soup_server_remove_handler): Rename
1247 (from register/unregister) to make it clearer what they do.
1249 * libsoup/soup-server-message.c: Moved out of soup-server.c
1251 * libsoup/soup-private.h: Remove SoupServer def
1253 * libsoup/Makefile.am (libsoupinclude_HEADERS,
1254 libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
1256 * tests/simple-httpd.c:
1257 * tests/simple-proxy.c: Update for SoupServer changes
1259 2003-08-18 Dan Winship <danw@ximian.com>
1261 * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
1262 a struct sockaddr again (like it used to be). In particular, add
1263 back the "port" field. Add a bunch of macros to try (and fail) to
1264 simplify some of the code.
1265 (soup_address_new): Now returns a SoupAddress directly rather than
1266 a random handle, and the caller can just use g_object_unref to
1267 cancel the lookup. Also, the callback now uses a
1268 SoupKnownErrorCode rather than a special-purpose address-lookup
1270 (soup_address_new_cancel): No longer needed.
1271 (soup_address_new_sync): Removed
1272 (soup_address_new_any): Replaces soup_address_ipv4_any and
1273 soup_address_ipv6_any.
1274 (soup_address_get_name, etc): Gone. Use soup_address_resolve()
1276 (soup_address_get_physical): Renamed from
1277 soup_address_get_canonical_name.
1278 (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
1280 * libsoup/soup-socket.c: Update for SoupAddress changes and make
1281 similar changes here.
1282 (soup_socket_new): Just creates a generic SoupSocket now.
1283 (soup_socket_connect): Client setup
1284 (soup_socket_listen): Server setup. Now also sets up an iochannel
1285 listening for connects and emits a "new_connection" signal as they
1287 (soup_socket_start_ssl): Turns on SSL.
1288 (soup_socket_client_new, soup_socket_server_new): Utility
1289 functions that wrap the above.
1290 (soup_socket_new_cancel, soup_socket_new_sync): Gone
1291 (soup_socket_server_accept, soup_socket_server_try_accept): No
1293 (soup_socket_get_iochannel): No longer adds a ref when returning
1294 the iochannel. Also, we set it to "close_on_unref" so that if a
1295 caller adds a ref to it, the connection will actually remain open
1296 even after the SoupSocket is destroyed.
1297 (soup_socket_get_local_address, soup_socket_get_remote_address):
1298 Let the caller get both of these.
1300 * libsoup/soup-connection.c: Don't keep a private copy of the
1302 (soup_connection_new): Don't need to set socket options here.
1304 (soup_connection_start_ssl): Just call soup_socket_start_ssl.
1305 (soup_connection_get_iochannel): Just return the socket's
1306 iochannel (and don't ref it)
1308 * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
1309 SOUP_ERROR_CANT_RESOLVE_PROXY
1311 * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
1312 Remove the "FIXME add a CANT_RESOLVE error" and return
1313 SOUP_ERROR_CANT_RESOLVE instead.
1315 * libsoup/soup-server.c: Update for socket/address changes. Don't
1316 poke into SoupSocket's private fields.
1317 (soup_server_run_async): Just connect to the socket's
1318 "new_connection" signal.
1320 * libsoup/soup-context.c (try_create_connection,
1321 soup_context_connect_cb): Update for socket changes. Replace
1322 SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
1324 * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
1325 to connect to a signal handler and connect another function to
1326 clean up the first signal handler after its first invocation.
1327 (Lets us use signals to replace one-off callbacks.)
1329 * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
1330 actually private now.
1331 (struct _SoupServer): Remove accept_tag.
1333 * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
1334 Don't unref the iochannel.
1335 (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
1337 * libsoup/soup-socks.c: Update for socket/address changes
1339 * tests/simple-httpd.c (main):
1340 s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
1341 * tests/simple-proxy.c (main): Likewise
1343 * tests/timeserver.c: Update for SoupSocket's "new_connection"
1344 signal, and for SoupAddress changes.
1346 2003-08-14 Dan Winship <danw@ximian.com>
1348 * libsoup/soup-connection.c: New, split out from soup-context and
1349 made into a GObject.
1350 (soup_connection_disconnect): Disconnects the connection and emits
1351 a signal. (Replaces the old "keep_alive" flag.)
1352 (soup_connection_is_connected): Checks if the connection is still
1354 (connection_died): Just disconnect, rather than freeing the
1355 connection. This way if anyone else is still referencing it they
1356 won't end up with an invalid pointer.
1358 * libsoup/soup-context.c: Make this a GObject, remove all the
1359 SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
1360 SoupContext can keep track of connection auth stuff there without
1361 SoupConnection needing to care. Various other updates.
1363 * libsoup/soup-private.h: Remove SoupContext and SoupConnection
1366 * libsoup/*.c, tests/get.c: Update for context/connection changes
1368 * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
1369 definition to deal with the fact that there's no
1370 soup_connection_get_context any more.
1372 * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
1373 with connection persistence here.
1374 (soup_queue_read_done_cb): Do it here instead. Disconnect the
1375 connection when appropriate.
1376 (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
1377 Reference-count the connection properly. (I think.)
1379 * libsoup/soup-marshal.list: New, for SoupConnection's
1380 "disconnected" signal.
1382 * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
1384 * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
1385 GLIB_GENMARSHAL gets set too.
1387 2003-08-14 Dan Winship <danw@ximian.com>
1389 * libsoup/soup-error.c: Fix a spelling mistake.
1391 * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
1393 2003-08-12 Dan Winship <danw@ximian.com>
1395 * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
1396 of the interfaces around a little bit.
1398 * libsoup/soup-auth-basic.c: subclass for Basic auth
1400 * libsoup/soup-auth-digest.c: subclass for Digest auth
1402 * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
1403 the code from soup-ntlm.c here, and make it private.
1405 * libsoup/soup-ntlm.c: gone
1407 * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
1408 here, and change the signature of SoupAuthorizeFn.
1410 * libsoup/soup-context.c: Use g_object_unref to free auths, use
1411 methods instead of directly access private fields.
1413 * libsoup/soup-queue.c: Likewise
1415 * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
1416 NTLM references. We have no plans to implement server-side NTLM
1419 * tests/auth-test.c (identify_auth): Update for auth api changes
1421 2003-08-12 Dan Winship <danw@ximian.com>
1423 * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
1426 * libsoup/soup-address.c: Make this a GObject.
1427 (soup_address_ref, soup_address_unref): Gone.
1428 (soup_address_copy): Gone. Wasn't being used anyway.
1430 * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
1431 here from soup-address.c, so that soup-address doesn't need to
1432 worry about trying to cache zero-ref addresses.
1434 * libsoup/soup-socket.c: Make this a GObject. Use "guint"
1435 consistently for port numbers.
1436 (soup_socket_ref, soup_socket_unref): Gone.
1438 * libsoup/soup-private.h: Change the SoupSocket definition to be
1439 SoupSocketPrivate. (Still need to keep this here since soup-server
1440 pokes around in its internals.)
1441 (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
1443 * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
1444 reader/writer rather than leaking them.
1446 * libsoup/*: Use GObject methods for socket/address refcounting
1448 * tests/auth-test.c (main)
1449 * tests/timeserver.c (main): Call g_type_init.
1451 * tests/get.c (main): Call g_type_init.
1452 (get_url, got_url): Fix some bugs that could make -r mode get into
1453 infinite loops downloading the same files over and over. Plug some
1454 memory leaks to make this more useful for valgrinding libsoup.
1456 * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
1457 handler for SIGINT so we can exit cleanly, since valgrind won't
1458 give a leak report if you don't. Plug a few memory leaks.
1460 * tests/simple-proxy.c (main): Likewise
1462 2003-08-12 Dan Winship <danw@ximian.com>
1464 Pull over some new test programs from the soup-refactoring branch,
1465 along with the SoupUri changes they depend on.
1467 * tests/simple-httpd.c: A really simple HTTP server, to test the
1470 * tests/simple-proxy.c: An even simpler HTTP proxy
1472 * tests/get.c: Add "-r" flag to recursively get files (thereby
1473 testing multiple-connections-at-once code). Also good for setting
1474 up a tree to use with simple-httpd.
1476 * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
1479 * tests/uri-parsing.c: Regression test for the new soup-uri.c
1481 * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
1482 pull in some optimizations from camel-url. Also, make SoupProtocol
1483 a GQuark so we can still compare them with ==, but we can also
1484 recognize any protocol.
1485 (soup_uri_new_with_base): New, to merge base and relative URIs
1486 (soup_uri_to_string): Update this. Change the "show_password" flag
1487 (which we always passed FALSE for) to "just_path", for places that
1488 want the path+query without the protocol, host, etc.
1490 * libsoup/soup-queue.c (soup_get_request_header): Just use
1491 soup_uri_to_string to generate the request URI.
1493 * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
1494 "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
1495 the URI by hand badly.
1496 * libsoup/soup-server-auth.c (parse_digest): Likewise
1498 * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
1499 switch() to an series of if()s since SOUP_PROTOCOL_* aren't
1502 * libsoup/soup-context.c (soup_context_uri_hash,
1503 soup_context_uri_equal): s/querystring/query/
1505 2003-08-12 Dan Winship <danw@ximian.com>
1507 * configure.in: Bump API version to 2.2 and package version to
1508 2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
1509 libgnutls-config to find GNUTLS.
1511 * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
1513 * Makefile.am: Update for pc file rename
1515 * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
1516 and libsoup-ssl-proxy stuff.
1518 * libsoup/soup-ssl-proxy.c
1519 * libsoup/soup-nss.[ch]
1520 * libsoup/soup-openssl.[ch]: gone
1522 * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
1524 * tests/Makefile.am (get_LDADD, timeserver_LDADD,
1525 auth_test_LDADD): Update libsoup version
1527 2003-08-07 Dan Winship <danw@ximian.com>
1529 * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
1530 soup_auth_invalidate): These are all really SoupContext functions,
1531 so move them to soup-context.c (and rename them appropriately).
1532 (soup_auth_get_protection_space): New method to get the
1533 "protection space" of an auth (paths where it is valid).
1534 (soup_auth_invalidate): New method to try to un-authenticate an
1535 auth (so we can keep the domain info cached even if the auth info
1537 (basic_pspace_func): Basic protection space is all directories
1538 below the current one.
1539 (basic_invalidate_func): Clear the encoded username/password
1540 (digest_pspace_func): Digest protection space is either the whole
1541 server, or "what the domain parameter says" (though we don't deal
1542 with cross-host domains).
1543 (digest_invalidate_func): Return FALSE; bad digest auth info isn't
1545 (digest_parse_func, digest_free): Set/free domain parameter
1546 (ntlm_pspace): NTLM protection space is always the whole server.
1547 (ntlm_invalidate): Clear the auth state.
1548 (soup_auth_new_ntlm): Make this non-static
1549 (SoupAuth): Replace the quad-state "status" field with an
1550 "authenticated" boolean.
1552 * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
1553 hash with separate "auth_realms" (path->realm) and "auths"
1554 (realm->auth) hashes. Also add a "use_ntlm" flag.
1556 * libsoup/soup-context.c (soup_context_unref): Update SoupHost
1558 (connection_free): Don't the connection's auth, just free it.
1559 (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
1560 does two-stage lookup (path->realm then realm->auth) and also
1561 deals with NTLM hacks.
1562 (soup_context_update_auth): Mostly formerly soup_auth_set_context,
1563 but also large parts of authorize_handler. Updates the auth hashes
1564 based on information from a 401 or 407 response. Does a better job
1565 than authorize_handler did of not throwing away good information.
1566 (soup_context_preauthenticate): New; fakes up auth info so that
1567 requests will end up using authentication without the server
1568 needing to return an error first.
1569 (soup_context_authenticate_auth): Moved out of authorize_handler
1570 so it can be used at request-sending time too, if we know that we
1571 need it. (That way we can avoid requeuing the request if it isn't
1572 going to be able to be authenticated.)
1573 (soup_context_invalidate_auth): Sort of like the old
1574 soup_auth_invalidate, but only destroys the auth data, while still
1575 remembering the path->realm mapping.
1577 * libsoup/soup-message.c (authorize_handler): Mostly moved into
1578 soup_context_update_auth.
1579 (maybe_validate_auth): Remove this; it was only useful because of
1580 bugs elsewhere in the auth handling.
1582 * libsoup/soup-queue.c (soup_encode_http_auth): Update for
1583 soup_context_lookup_auth. If the returned auth isn't
1584 authenticated, call soup_context_authenticate_auth() on it.
1586 * tests/auth-test.c: New (from soup-refactoring branch). Tests
1587 that the Basic/Digest auth code does the right thing. (TODO: find
1588 a good way to add NTLM tests too.)
1590 * tests/Makefile.am (check_PROGRAMS): add auth-test
1592 2003-07-29 Dan Winship <danw@ximian.com>
1594 * configure.in: 1.99.25 ("Potato and Leek Soup")
1596 * libsoup/soup-message.c (requeue_read_finished,
1597 release_connection): Free the passed-in body data. Otherwise the
1598 response body ends up getting leaked on most 3xx and 4xx
1600 (soup_message_cleanup): Remove a piece of code that didn't
1601 actually do anything and its associated confused comment.
1603 * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
1605 * libsoup/soup-context.c (connection_free): plug a non-occasional
1608 2003-06-26 Joe Shaw <joe@ximian.com>
1610 * configure.in: Version 1.99.24
1612 2003-06-24 Dan Winship <danw@ximian.com>
1614 * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
1615 it, and (b) depends on lots of new things sometimes (like on RH9).
1617 * libsoup/soup-openssl.c:
1618 * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
1619 just #ifdef HAVE_OPENSSL since the header check doesn't get run in
1622 2003-06-19 Dan Winship <danw@ximian.com>
1624 * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
1625 old read_tag before changing/clearing it.
1626 (soup_queue_write_done_cb): Likewise with the write_tag.
1628 * libsoup/soup-transfer.c (issue_final_callback): ref the reader
1629 around the stop+callback.
1630 (soup_transfer_write_cb): Likewise.
1632 2003-06-12 Dan Winship <danw@ximian.com>
1634 * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
1636 (soup_transfer_read, create_writer): Set initial ref_count to 2
1637 (one for soup-transfer, one for the caller).
1638 (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
1640 (soup_transfer_read_stop): Clears the GIOChannel callbacks and
1641 drops soup-transfer's ref.
1642 (soup_transfer_read_cancel): Now just a stop+unref
1643 (soup_transfer_write_ref, soup_transfer_write_unref,
1644 soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
1646 * libsoup/soup-message.c (soup_message_cleanup): when setting up
1647 the "finish reading" callbacks, unref the reader so it will be
1648 destroyed once it's done reading.
1649 (soup_message_requeue): Likewise.
1651 * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
1652 prototype change (no longer returns a SoupTransferDone).
1653 (soup_queue_read_chunk_cb): Likewise.
1655 * libsoup/soup-server.c (read_headers_cb): Likewise
1657 2003-06-11 Dan Winship <danw@ximian.com>
1659 * libsoup/soup-transfer.c: Change all functions to take a
1660 SoupReader * or SoupWriter * instead of a guint.
1662 * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
1663 write_tag pointers instead of guints.
1665 2003-06-02 Chris Toshok <toshok@ximian.com>
1667 * libsoup/soup-ssl.c: remove #include for soup-nss.h
1669 2003-06-02 Chris Toshok <toshok@ximian.com>
1671 * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
1672 (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
1673 (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
1675 2003-06-02 Chris Toshok <toshok@ximian.com>
1677 * configure.in: Bump version to 1.99.23.
1679 2003-05-30 Chris Toshok <toshok@ximian.com>
1681 * libsoup/soup-queue.c (soup_queue_error_cb): always force a
1682 reconnect when there's an error with ssl connection. This fixes
1683 #43387, but it runs the risk of sending requests multiple times to
1684 the exchange server, and it results in lots of shorter lived
1685 connections and more forking (in the ssl proxy case), depending on
1686 the length of the operation.
1688 2003-05-21 Dan Winship <danw@ximian.com>
1690 * configure.in: 1.99.22 (codename: French Onion Soup)
1692 2003-05-20 Dan Winship <danw@ximian.com>
1694 * libsoup/soup-message.c (soup_message_requeue): Clear the
1695 write_tag as well so we don't double-cancel it. #43395.
1697 * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
1698 be destroyed by the end of the func, so we have to call
1699 soup_connection_set_used at the beginning.
1701 * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
1702 Call g_set_error() so that we don't SEGV immediately after
1703 returning G_IO_STATUS_ERROR.
1705 2003-05-08 Joe Shaw <joe@ximian.com>
1707 * configure.in: Bump version to 1.99.21
1709 * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
1710 tunnelling fails, the other message which shares our same
1711 connection will free it first, so set ours to NULL.
1713 2003-05-08 Dan Winship <danw@ximian.com>
1715 * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
1716 return an NTLM request string. Otherwise return the "response"
1717 field (which should include the NTLM authenticate message)
1718 (ntlm_init): Don't bother setting "response" to the NTLM request
1719 string. Just leave it NULL in that case.
1721 * libsoup/soup-message.c (authorize_handler): Never try to reuse
1722 an NTLM auth returned from soup_auth_lookup. Only set the auth on
1723 the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
1724 call soup_auth_set_context() on it just like for non-NTLM auth.
1725 The net effect of all of this is that now we record when a context
1726 needs NTLM auth just like with non-NTLM auth, so that that info
1727 gets preserved across connections.
1728 (soup_message_requeue): No longer need the hackery here to
1729 preserve the connection auth state.
1731 2003-05-07 Dan Winship <danw@ximian.com>
1733 * libsoup/soup-context.c (soup_connection_set_in_use): New, to
1734 toggle the connection's in_use flag, and set up the death watch
1735 when it's not in use.
1736 (connection_death): This is only hooked up when the connection is
1737 not in use now, so don't need to check that. Should fix the
1738 infinite connection_death loop.
1739 (soup_connection_is_new): Keep a distinct "new" flag rather than
1740 defining "new" as "has been released at least once".
1741 (soup_connection_set_used): Mark a connection no-longer new.
1742 (soup_context_connect_cb): Mark the connection as new. Don't set
1743 up the death watch since it's in_use.
1744 (try_existing_connections): Use soup_connection_set_in_use.
1745 (soup_connection_release): Likewise
1747 * libsoup/soup-message.c (requeue_read_finished): Call
1748 soup_connection_set_used so that the connection isn't still
1749 considered new when we send the message the second time.
1751 * libsoup/soup-queue.c (soup_queue_error_cb): Call
1752 soup_connection_set_used (assuming we don't close the connection)
1753 (soup_queue_read_done_cb): Likewise.
1755 * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
1756 nothing, call soup_transfer_read_error_cb rather than just
1757 cancelling, or else it will get cancelled again later.
1759 2003-05-07 Dan Winship <danw@ximian.com>
1761 * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
1762 library doesn't depend on them, only the proxy does. #42473
1764 2003-05-06 Dan Winship <danw@ximian.com>
1766 * src/libsoup/soup-message.c (global_handlers): Change the
1767 redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
1768 SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
1769 for "Location" to get around the non-64-bit-clean union
1770 initialization pointed out by Jeremy Katz <katzj@redhat.com>.
1771 (redirect_handler): Update for that.
1773 2003-04-28 Dan Winship <danw@ximian.com>
1775 * configure.in: 1.99.20
1777 * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
1778 we always call UNIGNORE_CANCEL. Might fix #41971
1780 2003-04-25 Dan Winship <danw@ximian.com>
1782 * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
1783 suddenly gets an io error while reading or writing, assume it's a
1784 timeout or something, close the connection, and requeue the
1787 2003-04-23 Dan Winship <danw@ximian.com>
1789 * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
1790 soup-transfer callbacks to keep reading off the connection unless
1791 we're actually going to keep the connection around afterward.
1792 Otherwise we can just close it.
1794 * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
1795 thingy so that it's possible to cancel a read from inside a
1796 callback so that the above change actually works instead of just
1799 2003-04-20 Rodney Dawes <dobey@ximian.com>
1801 * configure.in: Up version to 1.99.18
1802 * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
1804 2003-04-11 Dan Winship <danw@ximian.com>
1806 * libsoup/soup-context.c (soup_connection_purge_idle): New
1807 function to close all idle connections. (Needed for #41117 or else
1808 there's no way to force-discard NTLM authentication.)
1810 * libsoup/soup-queue.c (soup_queue_shutdown): Use it
1812 2003-04-10 Joe Shaw <joe@ximian.com>
1814 * libsoup/soup-queue.c (proxy_https_connect):
1815 proxy_https_connect_cb() might not get called if connecting to the
1816 proxy fails, and it causes us to double-free the connection.
1817 Always set the message's connection to NULL before freeing it.
1819 2003-04-09 Dan Winship <danw@ximian.com>
1821 * configure.in: 1.99.17
1823 2003-04-07 Dan Winship <danw@ximian.com>
1825 * libsoup/soup-context.c (connection_death): Revert Joe's changes.
1826 We can't release the connection there because there may be
1827 SoupMessages still pointing to it. (Needs to be revisited.)
1829 2003-04-03 JP Rosevear <jpr@ximian.com>
1831 * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
1832 error during waitpid
1834 * libsoup/soup-address.c: ditto
1836 2003-04-02 Joe Shaw <joe@ximian.com>
1838 * libsoup/soup-context.c (connection_death): Only drop the
1839 connection if we get an error condition on the channel. Fixes a
1842 2003-04-02 Joe Shaw <joe@ximian.com>
1844 * libsoup/soup-context.c (connection_death): Just call
1845 soup_connection_release() from here and return whether the
1846 connection is in use.
1848 2003-03-31 Ian Peters <itp@ximian.com>
1850 * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
1851 case of EAGAIN or EINTR, since shutting down an SSL connection
1852 requires more than just closing a socket.
1854 2003-03-28 Dan Winship <danw@ximian.com>
1856 * libsoup/soup-message.c (soup_message_set_context): If the new
1857 context points to a different server from the old context, call
1858 soup_message_cleanup. Otherwise it tries to reuse the old
1861 2003-03-25 Joe Shaw <joe@ximian.com>
1863 * configure.in: Bump up to 1.99.16
1865 2003-03-24 Joe Shaw <joe@ximian.com>
1867 * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
1868 slightly better error message on various SSL failures than the
1871 * soup-queue.c (soup_queue_error_cb): Throw the
1872 SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
1874 2003-03-21 Joe Shaw <joe@ximian.com>
1876 * soup-server.c: Use non-deprecated g_main_loop_* calls
1878 (soup_server_unref): Don't unref the main loop if it's NULL.
1879 Fixes a glib warning.
1881 2003-03-18 Dan Winship <danw@ximian.com>
1883 * configure.in: comment out NSS checks. The NSS code doesn't work
1884 and there are no current plans to fix it.
1886 * README (Features): Mention GnuTLS, remove NSS and the rest of
1887 the "Planned Features" section.
1889 * MAINTAINERS: remove Alex
1891 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
1892 timeout to 10 seconds (and get rid of the 3 tries) so we don't
1893 fail to connect just because the server is slow/far away.
1895 2003-03-17 Joe Shaw <joe@ximian.com>
1897 * configure.in: Bump up to 1.99.15.
1899 2003-03-12 Ian Peters <itp@ximian.com>
1901 * libsoup/soup-gnutls.c: because creating client credentials is
1902 expensive, keep the same one around as long as possible, only
1903 recreating it if the ssl_ca_file changes. Wrap
1904 gnutls_certificate_credentials in a refcounted struct to avoid
1905 freeing it while another established connection may potentially
1906 need it (say, to rehandshake).
1908 2003-03-11 Frank Belew <frb@ximian.com>
1910 * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't
1913 2003-03-10 Joe Shaw <joe@ximian.com>
1915 * configure.in: Bump up to 1.99.14.
1917 * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
1918 libsoup/soup-ssl.c: Add support for GnuTLS. Patch from Ian
1921 2003-03-07 Joe Shaw <joe@ximian.com>
1923 * configure.in: Bump up to 1.99.13.
1925 * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
1926 the list of conditions to watch. If the remote end hangs up the
1927 connection, we'll get a successful read of 0 bytes, not a HUP.
1928 The connection will have to be released by the point we check for
1929 it in connection_death().
1931 * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
1932 (apparently) errant resetting of the read and write tags. I think
1933 this might have been causing some reentrancy and crashes.
1935 * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
1936 channel to NULL encoding and not buffered.
1938 * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
1941 2003-02-28 Joe Shaw <joe@ximian.com>
1943 * configure.in: Bump up to 1.99.12.
1945 * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
1946 header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
1947 this case we probably don't want to call the error callback, we
1948 just want to act like our transfer was cancelled.
1950 2003-02-27 Joe Shaw <joe@ximian.com>
1952 Try to apply some order to the iochannel refcounting...
1954 * configure.in: Bump up to 1.99.11.
1956 * libsoup/soup-context.c (soup_connection_get_iochannel): The
1957 connections needs to own a reference to the iochannel! If we're
1958 using HTTPS, release the ref we get from soup_socket_get_iochannel
1959 and replace it with the ref we get from soup_ssl_get_iochannel().
1960 Then, always ref the channel that we return (ugh, but that's the
1962 (connection_free): Release the connection's ref to the iochannel.
1964 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1965 iochannel. The reference we pass back will be owned by the
1967 (soup_ssl_hup_waitpid): Release our ref.
1969 2003-02-27 Joe Shaw <joe@ximian.com>
1971 * configure.in: Bump up to 1.99.10.
1973 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1974 iochannel, return to the status quo. Sigh.
1976 2003-02-26 Joe Shaw <joe@ximian.com>
1978 * configure.in: Bump up to 1.99.9.
1980 * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
1981 it's causing problems with HTTPS and proxies; the iochannel
1982 refcounting is waaaaaay horked.
1984 2003-02-26 Frank Belew <frb@ximian.com>
1986 * libsoup/Makefile.am: added workaround to link ssl-proxy statically
1988 2003-02-11 Joe Shaw <joe@ximian.com>
1990 * configure.in: Bump up to 1.99.8 for snaps.
1992 * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
1993 It returns the address to the resulting hostent or NULL on failure,
1994 unlike Linux which returns an error code.
1996 2003-02-11 Joe Shaw <joe@ximian.com>
1998 * configure.in: Bump up to 1.99.7 for snaps.
2000 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
2001 the error string from OpenSSL if we can't establish a connection.
2003 2003-02-04 Joe Shaw <joe@ximian.com>
2005 * configure.in: Bump up to 1.99.6 for snaps.
2007 * libsoup/soup-server.c (destroy_message): We already assigned
2008 chan, so don't reassign it, and unref it in all cases.
2009 (issue_bad_request): Always unref after a call to
2010 soup_socket_get_iochannel(), because it refs it.
2011 (conn_accept): Fix some funky GIOChannel reffing here.
2013 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
2014 g_io_channel_ref() on the socket. This is the exact opposite of
2015 what we want to do. Create a temporary structure containing the
2016 parent pid and the old socket and unref the socket when our
2017 callback is called. This should fix GIOChannels being leaked on
2020 * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
2023 2003-01-22 Joe Shaw <joe@ximian.com>
2025 * configure.in: Bump up to 1.99.5 for the snaps.
2027 * libsoup/soup-address.c (soup_address_new): If we found the
2028 address in our hash, we need to return NULL or else Soup will
2029 think we're doing an async lookup and do some cancellation on
2030 us. Besides, we were returning the wrong type anyway and it
2031 was crashing things.
2033 2003-01-17 Joe Shaw <joe@ximian.com>
2035 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
2036 uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
2037 out, so keep trying until we succeed.
2039 2003-01-10 Joe Shaw <joe@ximian.com>
2041 * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
2042 strings and print out the error when the cert can't verify.
2044 2003-01-09 Dan Winship <danw@ximian.com>
2046 * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
2047 overrun noticed by valgrind
2049 2002-12-20 Joe Shaw <joe@ximian.com>
2051 * libsoup/soup-server.c (soup_server_new_with_host): Added.
2052 Starts a server only on the interface specified, instead of all
2055 2002-12-16 Jeremy Katz <katzj@redhat.com>
2057 * configure.in: use $libdir instead of /usr/lib when looking for
2060 2002-12-11 Joe Shaw <joe@ximian.com>
2062 * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
2063 Don't set a variable to NULL and then immediately try to
2066 2002-12-09 Joe Shaw <joe@ximian.com>
2068 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
2069 timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
2070 we don't hang forever if we don't get more data.
2072 * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
2073 or else we'll hang forever in SSL_connect() if the other side
2076 * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
2077 release the connection on message free, even if the connection was
2080 2002-12-03 Joe Shaw <joe@ximian.com>
2082 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
2083 g_io_channel_set_close_on_unref() on the second half of the socket
2084 pair so we don't leak file descriptors.
2086 2002-12-03 Frank Belew <frb@ximian.com>
2088 * libsoup/soup-address.c: add signal.h to the list of headers to
2091 2002-11-25 Joe Shaw <joe@ximian.com>
2093 * Makefile.am: Build the tests directory again
2095 2002-11-21 Rodney Dawes <dobey@ximian.com>
2097 * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
2099 2002-11-20 Michael Meeks <michael@ximian.com>
2101 * configure.in: require autoconf 2.52 not 2.53.
2103 2002-11-18 Dan Winship <danw@ximian.com>
2105 * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
2106 since it's apparently non-portable. Use s6_addr instead.
2107 (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
2109 * libsoup/soup-error.c: Fix spelling of
2110 SOUP_ERROR_MOVED_PERMANENTLY and its description.
2112 * libsoup/soup-message.c (soup_message_get_request_header, etc):
2113 Remove long-deprecated API.
2115 * libsoup/soup-socket.c (soup_socket_connect): remove unused
2118 * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
2119 * libsoup/soup-server.c (cgi_read): Likewise
2120 * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
2122 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
2123 * libsoup/soup-transfer.c (soup_transfer_read_cb,
2124 soup_transfer_write_cb): Likewise.
2126 * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
2127 instead of IPv4. (Tested on OS X.)
2129 2002-11-15 Dan Winship <danw@ximian.com>
2131 * libsoup/*: Change old Helix Code refs to Ximian (and update
2134 2002-11-15 Frank Belew <frb@ximian.com>
2136 * tests/Makefile.am: uncomment lines to make timeserver build
2139 2002-11-14 Joe Shaw <joe@ximian.com>
2141 * libsoup/soup-address.c (soup_address_new): When we get an
2142 address from the hash, call our address lookup callback or else
2143 the connection will hang.
2145 2002-11-13 Dan Winship <danw@ximian.com>
2147 * tests/timeserver.c: Oops, commit this.
2149 * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
2151 2002-11-13 Joe Shaw <joe@ximian.com>
2153 * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
2154 (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
2157 * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
2158 to properly shut down the SSL connection before closing the
2161 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
2162 iochannels before quitting the main loop.
2164 * tests/Makefile.am: disable building timeserver, the source file
2167 2002-11-12 Dan Winship <danw@ximian.com>
2169 * configure.in: Check for IPv6 support in networking headers.
2171 * libsoup/soup-address.c: Make the internal structure of
2172 SoupAddress entirely private, and make SoupAddress be more like a
2173 hostent and less like a sockaddr. (Ie, make it not have a port
2174 associated with it.) Document undocumented functions. Add
2175 completely-untested support for IPv6.
2176 (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
2177 SoupAddress and a port.
2178 (soup_address_ipv4_any, soup_address_ipv6_any): Return static
2179 addresses corresponding to the IPv6 and IPv6 "any" addresses.
2180 (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
2181 (soup_address_make_sockaddr): Now constructs a new sockaddr, which
2182 may be a sockaddr_in or sockaddr_in6.
2183 (soup_address_gethostname, soup_address_gethostaddr): Remove
2184 these. They aren't reliable, especially on multihomed hosts.
2185 (soup_gethostbyname, soup_gethostbyaddr): support IPv6
2186 (soup_address_new): Keep pending lookups in a separate hash table
2187 from completed lookups. Fix a bug when canceling a lookup when
2188 there was more one outstanding request for it.
2189 (soup_address_lookup_in_cache): Removed.
2191 * libsoup/soup-socket.c: Add a port field to SoupSocket (since
2192 it's not in SoupAddress any more).
2193 (soup_socket_connect): Simplify this. Don't use
2194 soup_address_lookup_in_cache, just call soup_address_new, since we
2195 already know the code can deal with the callback being invoked
2197 (soup_socket_new_sync, soup_socket_new): Take a port argument.
2198 (soup_socket_server_new): Take a SoupAddress to use as the local
2199 address to bind to. This lets the caller choose between the IPv4
2200 and IPv6 "any" addresses, and also lets you bind to a single
2201 interface of a multi-homed machine.
2202 (soup_socket_server_accept, soup_socket_server_try_accept): Merge
2205 * libsoup/soup-server.c (soup_server_new): Pass
2206 soup_address_ipv4_any() to soup_socket_server_new().
2208 * libsoup/soup-socks.c (soup_connect_socks_proxy,
2209 soup_socks_write): Fix up for the API changes, but it won't work
2212 * tests/timeserver.c: Another really simple test, for the server
2215 * tests/Makefile.am: build timeserver
2217 2002-11-11 Dan Winship <danw@ximian.com>
2219 * libsoup/soup-address.c: Move the SoupAddress code from
2220 soup-socket.c and soup-socket-unix.c to here.
2222 * libsoup/soup-socket.c: Move the remaining code from
2223 soup-socket-unix.c here.
2225 * libsoup/soup-socket-unix.c: Gone
2227 * tests/get.c: really really trivial test program
2229 * configure.in (AC_OUTPUT):
2230 * Makefile.am (SUBDIRS): add tests/
2232 2002-11-05 Dan Winship <danw@ximian.com>
2234 * Split libsoup out of soup. ChangeLog.old contains the original
2237 * Makefile.am, etc: Fix things up to work with the new directory
2238 layout. Disable docs until we fix them.
2240 * autogen.sh: Use gnome-autogen.sh
2242 * configure.in: Require autoconf 2.53. Remove stuff that was only
2243 needed for httpd or wsdl code. Remove glib1 support. Bump version
2246 * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
2247 in ${includedir}/soup-2.0
2249 * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
2250 SOAP-specific stuff, Windows support, and other things that
2251 weren't being maintained.
2253 * soup-config.in, soupConf.sh: Kill these. We only support