980418935de241bfd7a4b4c58c8ca175135e8212
[platform/upstream/libsoup.git] / ChangeLog
1 2003-08-19  Dan Winship  <danw@ximian.com>
2
3         * libsoup/soup-server.c: Make this a GObject. Remove
4         SoupServerMessage code (to soup-server-message.c). Remove CGI
5         server code (for now?)
6         (soup_server_add_handler, soup_server_remove_handler): Rename
7         (from register/unregister) to make it clearer what they do.
8
9         * libsoup/soup-server-message.c: Moved out of soup-server.c
10
11         * libsoup/soup-private.h: Remove SoupServer def
12
13         * libsoup/Makefile.am (libsoupinclude_HEADERS,
14         libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
15
16         * tests/simple-httpd.c: 
17         * tests/simple-proxy.c: Update for SoupServer changes
18
19 2003-08-18  Dan Winship  <danw@ximian.com>
20
21         * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
22         a struct sockaddr again (like it used to be). In particular, add
23         back the "port" field. Add a bunch of macros to try (and fail) to
24         simplify some of the code.
25         (soup_address_new): Now returns a SoupAddress directly rather than
26         a random handle, and the caller can just use g_object_unref to
27         cancel the lookup. Also, the callback now uses a
28         SoupKnownErrorCode rather than a special-purpose address-lookup
29         error code.
30         (soup_address_new_cancel): No longer needed.
31         (soup_address_new_sync): Removed
32         (soup_address_new_any): Replaces soup_address_ipv4_any and
33         soup_address_ipv6_any.
34         (soup_address_get_name, etc): Gone. Use soup_address_resolve()
35         now.
36         (soup_address_get_physical): Renamed from
37         soup_address_get_canonical_name.
38         (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
39
40         * libsoup/soup-socket.c: Update for SoupAddress changes and make
41         similar changes here.
42         (soup_socket_new): Just creates a generic SoupSocket now.
43         (soup_socket_connect): Client setup
44         (soup_socket_listen): Server setup. Now also sets up an iochannel
45         listening for connects and emits a "new_connection" signal as they
46         come in.
47         (soup_socket_start_ssl): Turns on SSL.
48         (soup_socket_client_new, soup_socket_server_new): Utility
49         functions that wrap the above.
50         (soup_socket_new_cancel, soup_socket_new_sync): Gone
51         (soup_socket_server_accept, soup_socket_server_try_accept): No
52         longer needed.
53         (soup_socket_get_iochannel): No longer adds a ref when returning
54         the iochannel. Also, we set it to "close_on_unref" so that if a
55         caller adds a ref to it, the connection will actually remain open
56         even after the SoupSocket is destroyed.
57         (soup_socket_get_local_address, soup_socket_get_remote_address):
58         Let the caller get both of these.
59
60         * libsoup/soup-connection.c: Don't keep a private copy of the
61         socket's iochannel.
62         (soup_connection_new): Don't need to set socket options here.
63         SoupSocket does it.
64         (soup_connection_start_ssl): Just call soup_socket_start_ssl.
65         (soup_connection_get_iochannel): Just return the socket's
66         iochannel (and don't ref it)
67
68         * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
69         SOUP_ERROR_CANT_RESOLVE_PROXY
70
71         * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
72         Remove the "FIXME add a CANT_RESOLVE error" and return
73         SOUP_ERROR_CANT_RESOLVE instead.
74
75         * libsoup/soup-server.c: Update for socket/address changes. Don't
76         poke into SoupSocket's private fields.
77         (soup_server_run_async): Just connect to the socket's
78         "new_connection" signal.
79
80         * libsoup/soup-context.c (try_create_connection,
81         soup_context_connect_cb): Update for socket changes. Replace
82         SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
83
84         * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
85         to connect to a signal handler and connect another function to
86         clean up the first signal handler after its first invocation.
87         (Lets us use signals to replace one-off callbacks.)
88
89         * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
90         actually private now.
91         (struct _SoupServer): Remove accept_tag.
92
93         * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
94         Don't unref the iochannel.
95         (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
96
97         * libsoup/soup-socks.c: Update for socket/address changes
98
99         * tests/simple-httpd.c (main):
100         s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
101         * tests/simple-proxy.c (main): Likewise
102
103         * tests/timeserver.c: Update for SoupSocket's "new_connection"
104         signal, and for SoupAddress changes.
105
106 2003-08-14  Dan Winship  <danw@ximian.com>
107
108         * libsoup/soup-connection.c: New, split out from soup-context and
109         made into a GObject.
110         (soup_connection_disconnect): Disconnects the connection and emits
111         a signal. (Replaces the old "keep_alive" flag.)
112         (soup_connection_is_connected): Checks if the connection is still
113         connected
114         (connection_died): Just disconnect, rather than freeing the
115         connection. This way if anyone else is still referencing it they
116         won't end up with an invalid pointer.
117
118         * libsoup/soup-context.c: Make this a GObject, remove all the
119         SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
120         SoupContext can keep track of connection auth stuff there without
121         SoupConnection needing to care. Various other updates.
122
123         * libsoup/soup-private.h: Remove SoupContext and SoupConnection
124         definitions.
125
126         * libsoup/*.c, tests/get.c: Update for context/connection changes
127
128         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
129         definition to deal with the fact that there's no
130         soup_connection_get_context any more.
131
132         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
133         with connection persistence here.
134         (soup_queue_read_done_cb): Do it here instead. Disconnect the
135         connection when appropriate.
136         (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
137         Reference-count the connection properly. (I think.)
138
139         * libsoup/soup-marshal.list: New, for SoupConnection's
140         "disconnected" signal.
141
142         * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
143
144         * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
145         GLIB_GENMARSHAL gets set too.
146
147 2003-08-14  Dan Winship  <danw@ximian.com>
148
149         * libsoup/soup-error.c: Fix a spelling mistake.
150
151         * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
152
153 2003-08-12  Dan Winship  <danw@ximian.com>
154
155         * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
156         of the interfaces around a little bit.
157
158         * libsoup/soup-auth-basic.c: subclass for Basic auth
159
160         * libsoup/soup-auth-digest.c: subclass for Digest auth
161
162         * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
163         the code from soup-ntlm.c here, and make it private.
164
165         * libsoup/soup-ntlm.c: gone
166
167         * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
168         here, and change the signature of SoupAuthorizeFn.
169
170         * libsoup/soup-context.c: Use g_object_unref to free auths, use
171         methods instead of directly access private fields.
172
173         * libsoup/soup-queue.c: Likewise
174
175         * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
176         NTLM references. We have no plans to implement server-side NTLM
177         auth.
178
179         * tests/auth-test.c (identify_auth): Update for auth api changes
180
181 2003-08-12  Dan Winship  <danw@ximian.com>
182
183         * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
184         call
185
186         * libsoup/soup-address.c: Make this a GObject.
187         (soup_address_ref, soup_address_unref): Gone.
188         (soup_address_copy): Gone. Wasn't being used anyway.
189
190         * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
191         here from soup-address.c, so that soup-address doesn't need to
192         worry about trying to cache zero-ref addresses.
193
194         * libsoup/soup-socket.c: Make this a GObject. Use "guint"
195         consistently for port numbers.
196         (soup_socket_ref, soup_socket_unref): Gone.
197
198         * libsoup/soup-private.h: Change the SoupSocket definition to be
199         SoupSocketPrivate. (Still need to keep this here since soup-server
200         pokes around in its internals.)
201         (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
202
203         * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
204         reader/writer rather than leaking them.
205
206         * libsoup/*: Use GObject methods for socket/address refcounting
207         
208         * tests/auth-test.c (main)
209         * tests/timeserver.c (main): Call g_type_init.
210
211         * tests/get.c (main): Call g_type_init.
212         (get_url, got_url): Fix some bugs that could make -r mode get into
213         infinite loops downloading the same files over and over. Plug some
214         memory leaks to make this more useful for valgrinding libsoup.
215
216         * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
217         handler for SIGINT so we can exit cleanly, since valgrind won't
218         give a leak report if you don't. Plug a few memory leaks.
219
220         * tests/simple-proxy.c (main): Likewise 
221
222 2003-08-12  Dan Winship  <danw@ximian.com>
223
224         Pull over some new test programs from the soup-refactoring branch,
225         along with the SoupUri changes they depend on.
226
227         * tests/simple-httpd.c: A really simple HTTP server, to test the
228         server code.
229
230         * tests/simple-proxy.c: An even simpler HTTP proxy
231
232         * tests/get.c: Add "-r" flag to recursively get files (thereby
233         testing multiple-connections-at-once code). Also good for setting
234         up a tree to use with simple-httpd.
235
236         * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
237         normal case)
238
239         * tests/uri-parsing.c: Regression test for the new soup-uri.c
240
241         * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
242         pull in some optimizations from camel-url. Also, make SoupProtocol
243         a GQuark so we can still compare them with ==, but we can also
244         recognize any protocol.
245         (soup_uri_new_with_base): New, to merge base and relative URIs
246         (soup_uri_to_string): Update this. Change the "show_password" flag
247         (which we always passed FALSE for) to "just_path", for places that
248         want the path+query without the protocol, host, etc.
249
250         * libsoup/soup-queue.c (soup_get_request_header): Just use
251         soup_uri_to_string to generate the request URI.
252
253         * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
254         "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
255         the URI by hand badly.
256         * libsoup/soup-server-auth.c (parse_digest): Likewise
257
258         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
259         switch() to an series of if()s since SOUP_PROTOCOL_* aren't
260         constants any more.
261
262         * libsoup/soup-context.c (soup_context_uri_hash,
263         soup_context_uri_equal): s/querystring/query/
264
265 2003-08-12  Dan Winship  <danw@ximian.com>
266
267         * configure.in: Bump API version to 2.2 and package version to
268         2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
269         libgnutls-config to find GNUTLS.
270
271         * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
272
273         * Makefile.am: Update for pc file rename
274
275         * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
276         and libsoup-ssl-proxy stuff.
277
278         * libsoup/soup-ssl-proxy.c
279         * libsoup/soup-nss.[ch]
280         * libsoup/soup-openssl.[ch]: gone
281
282         * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
283
284         * tests/Makefile.am (get_LDADD, timeserver_LDADD,
285         auth_test_LDADD): Update libsoup version
286
287 2003-08-07  Dan Winship  <danw@ximian.com>
288
289         * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
290         soup_auth_invalidate): These are all really SoupContext functions,
291         so move them to soup-context.c (and rename them appropriately).
292         (soup_auth_get_protection_space): New method to get the
293         "protection space" of an auth (paths where it is valid).
294         (soup_auth_invalidate): New method to try to un-authenticate an
295         auth (so we can keep the domain info cached even if the auth info
296         is wrong).
297         (basic_pspace_func): Basic protection space is all directories
298         below the current one.
299         (basic_invalidate_func): Clear the encoded username/password
300         (digest_pspace_func): Digest protection space is either the whole
301         server, or "what the domain parameter says" (though we don't deal
302         with cross-host domains).
303         (digest_invalidate_func): Return FALSE; bad digest auth info isn't
304         cacheable.
305         (digest_parse_func, digest_free): Set/free domain parameter
306         (ntlm_pspace): NTLM protection space is always the whole server.
307         (ntlm_invalidate): Clear the auth state.
308         (soup_auth_new_ntlm): Make this non-static
309         (SoupAuth): Replace the quad-state "status" field with an
310         "authenticated" boolean.
311         
312         * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
313         hash with separate "auth_realms" (path->realm) and "auths"
314         (realm->auth) hashes. Also add a "use_ntlm" flag.
315
316         * libsoup/soup-context.c (soup_context_unref): Update SoupHost
317         freeing code.
318         (connection_free): Don't the connection's auth, just free it.
319         (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
320         does two-stage lookup (path->realm then realm->auth) and also
321         deals with NTLM hacks.
322         (soup_context_update_auth): Mostly formerly soup_auth_set_context,
323         but also large parts of authorize_handler. Updates the auth hashes
324         based on information from a 401 or 407 response. Does a better job
325         than authorize_handler did of not throwing away good information.
326         (soup_context_preauthenticate): New; fakes up auth info so that
327         requests will end up using authentication without the server
328         needing to return an error first.
329         (soup_context_authenticate_auth): Moved out of authorize_handler
330         so it can be used at request-sending time too, if we know that we
331         need it. (That way we can avoid requeuing the request if it isn't
332         going to be able to be authenticated.)
333         (soup_context_invalidate_auth): Sort of like the old
334         soup_auth_invalidate, but only destroys the auth data, while still
335         remembering the path->realm mapping.
336
337         * libsoup/soup-message.c (authorize_handler): Mostly moved into
338         soup_context_update_auth.
339         (maybe_validate_auth): Remove this; it was only useful because of
340         bugs elsewhere in the auth handling.
341         
342         * libsoup/soup-queue.c (soup_encode_http_auth): Update for
343         soup_context_lookup_auth. If the returned auth isn't
344         authenticated, call soup_context_authenticate_auth() on it.
345
346         * tests/auth-test.c: New (from soup-refactoring branch). Tests
347         that the Basic/Digest auth code does the right thing. (TODO: find
348         a good way to add NTLM tests too.)
349
350         * tests/Makefile.am (check_PROGRAMS): add auth-test
351
352 2003-07-29  Dan Winship  <danw@ximian.com>
353
354         * configure.in: 1.99.25 ("Potato and Leek Soup")
355
356         * libsoup/soup-message.c (requeue_read_finished,
357         release_connection): Free the passed-in body data. Otherwise the
358         response body ends up getting leaked on most 3xx and 4xx
359         responses.
360         (soup_message_cleanup): Remove a piece of code that didn't
361         actually do anything and its associated confused comment.
362
363         * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
364
365         * libsoup/soup-context.c (connection_free): plug a non-occasional
366         NTLM auth leak.
367
368 2003-06-26  Joe Shaw  <joe@ximian.com>
369
370         * configure.in: Version 1.99.24
371
372 2003-06-24  Dan Winship  <danw@ximian.com>
373
374         * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
375         it, and (b) depends on lots of new things sometimes (like on RH9).
376
377         * libsoup/soup-openssl.c: 
378         * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
379         just #ifdef HAVE_OPENSSL since the header check doesn't get run in
380         the pkgconfig case
381
382 2003-06-19  Dan Winship  <danw@ximian.com>
383
384         * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
385         old read_tag before changing/clearing it.
386         (soup_queue_write_done_cb): Likewise with the write_tag.
387
388         * libsoup/soup-transfer.c (issue_final_callback): ref the reader
389         around the stop+callback.
390         (soup_transfer_write_cb): Likewise.
391
392 2003-06-12  Dan Winship  <danw@ximian.com>
393
394         * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
395         ref_count field.
396         (soup_transfer_read, create_writer): Set initial ref_count to 2
397         (one for soup-transfer, one for the caller).
398         (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
399         reader
400         (soup_transfer_read_stop): Clears the GIOChannel callbacks and
401         drops soup-transfer's ref.
402         (soup_transfer_read_cancel): Now just a stop+unref
403         (soup_transfer_write_ref, soup_transfer_write_unref,
404         soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
405
406         * libsoup/soup-message.c (soup_message_cleanup): when setting up
407         the "finish reading" callbacks, unref the reader so it will be
408         destroyed once it's done reading.
409         (soup_message_requeue): Likewise.
410
411         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
412         prototype change (no longer returns a SoupTransferDone).
413         (soup_queue_read_chunk_cb): Likewise.
414
415         * libsoup/soup-server.c (read_headers_cb): Likewise
416
417 2003-06-11  Dan Winship  <danw@ximian.com>
418
419         * libsoup/soup-transfer.c: Change all functions to take a
420         SoupReader * or SoupWriter * instead of a guint.
421
422         * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
423         write_tag pointers instead of guints.
424
425 2003-06-02  Chris Toshok  <toshok@ximian.com>
426
427         * libsoup/soup-ssl.c: remove #include for soup-nss.h
428
429 2003-06-02  Chris Toshok  <toshok@ximian.com>
430
431         * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
432         (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
433         (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
434
435 2003-06-02  Chris Toshok  <toshok@ximian.com>
436
437         * configure.in: Bump version to 1.99.23.
438
439 2003-05-30  Chris Toshok  <toshok@ximian.com>
440
441         * libsoup/soup-queue.c (soup_queue_error_cb): always force a
442         reconnect when there's an error with ssl connection.  This fixes
443         #43387, but it runs the risk of sending requests multiple times to
444         the exchange server, and it results in lots of shorter lived
445         connections and more forking (in the ssl proxy case), depending on
446         the length of the operation.
447
448 2003-05-21  Dan Winship  <danw@ximian.com>
449
450         * configure.in: 1.99.22 (codename: French Onion Soup)
451
452 2003-05-20  Dan Winship  <danw@ximian.com>
453
454         * libsoup/soup-message.c (soup_message_requeue): Clear the
455         write_tag as well so we don't double-cancel it. #43395.
456
457         * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
458         be destroyed by the end of the func, so we have to call
459         soup_connection_set_used at the beginning.
460
461         * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
462         Call g_set_error() so that we don't SEGV immediately after
463         returning G_IO_STATUS_ERROR.
464
465 2003-05-08  Joe Shaw  <joe@ximian.com>
466
467         * configure.in: Bump version to 1.99.21
468
469         * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
470         tunnelling fails, the other message which shares our same
471         connection will free it first, so set ours to NULL.
472
473 2003-05-08  Dan Winship  <danw@ximian.com>
474
475         * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
476         return an NTLM request string. Otherwise return the "response"
477         field (which should include the NTLM authenticate message)
478         (ntlm_init): Don't bother setting "response" to the NTLM request
479         string. Just leave it NULL in that case.
480
481         * libsoup/soup-message.c (authorize_handler): Never try to reuse
482         an NTLM auth returned from soup_auth_lookup. Only set the auth on
483         the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
484         call soup_auth_set_context() on it just like for non-NTLM auth.
485         The net effect of all of this is that now we record when a context
486         needs NTLM auth just like with non-NTLM auth, so that that info
487         gets preserved across connections.
488         (soup_message_requeue): No longer need the hackery here to
489         preserve the connection auth state.
490
491 2003-05-07  Dan Winship  <danw@ximian.com>
492
493         * libsoup/soup-context.c (soup_connection_set_in_use): New, to
494         toggle the connection's in_use flag, and set up the death watch
495         when it's not in use.
496         (connection_death): This is only hooked up when the connection is
497         not in use now, so don't need to check that. Should fix the
498         infinite connection_death loop.
499         (soup_connection_is_new): Keep a distinct "new" flag rather than
500         defining "new" as "has been released at least once".
501         (soup_connection_set_used): Mark a connection no-longer new.
502         (soup_context_connect_cb): Mark the connection as new. Don't set
503         up the death watch since it's in_use.
504         (try_existing_connections): Use soup_connection_set_in_use.
505         (soup_connection_release): Likewise
506
507         * libsoup/soup-message.c (requeue_read_finished): Call
508         soup_connection_set_used so that the connection isn't still
509         considered new when we send the message the second time.
510
511         * libsoup/soup-queue.c (soup_queue_error_cb): Call
512         soup_connection_set_used (assuming we don't close the connection)
513         (soup_queue_read_done_cb): Likewise.
514
515         * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
516         nothing, call soup_transfer_read_error_cb rather than just
517         cancelling, or else it will get cancelled again later.
518
519 2003-05-07  Dan Winship  <danw@ximian.com>
520
521         * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
522         library doesn't depend on them, only the proxy does. #42473
523
524 2003-05-06  Dan Winship  <danw@ximian.com>
525
526         * src/libsoup/soup-message.c (global_handlers): Change the
527         redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
528         SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
529         for "Location" to get around the non-64-bit-clean union
530         initialization pointed out by Jeremy Katz <katzj@redhat.com>.
531         (redirect_handler): Update for that.
532
533 2003-04-28  Dan Winship  <danw@ximian.com>
534
535         * configure.in: 1.99.20
536
537         * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
538         we always call UNIGNORE_CANCEL. Might fix #41971
539
540 2003-04-25  Dan Winship  <danw@ximian.com>
541
542         * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
543         suddenly gets an io error while reading or writing, assume it's a
544         timeout or something, close the connection, and requeue the
545         message.
546
547 2003-04-23  Dan Winship  <danw@ximian.com>
548
549         * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
550         soup-transfer callbacks to keep reading off the connection unless
551         we're actually going to keep the connection around afterward.
552         Otherwise we can just close it.
553
554         * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
555         thingy so that it's possible to cancel a read from inside a
556         callback so that the above change actually works instead of just
557         crashing.
558
559 2003-04-20  Rodney Dawes  <dobey@ximian.com>
560
561         * configure.in: Up version to 1.99.18
562         * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
563         
564 2003-04-11  Dan Winship  <danw@ximian.com>
565
566         * libsoup/soup-context.c (soup_connection_purge_idle): New
567         function to close all idle connections. (Needed for #41117 or else
568         there's no way to force-discard NTLM authentication.)
569
570         * libsoup/soup-queue.c (soup_queue_shutdown): Use it
571
572 2003-04-10  Joe Shaw  <joe@ximian.com>
573
574         * libsoup/soup-queue.c (proxy_https_connect):
575         proxy_https_connect_cb() might not get called if connecting to the
576         proxy fails, and it causes us to double-free the connection.
577         Always set the message's connection to NULL before freeing it.
578
579 2003-04-09  Dan Winship  <danw@ximian.com>
580
581         * configure.in: 1.99.17
582
583 2003-04-07  Dan Winship  <danw@ximian.com>
584
585         * libsoup/soup-context.c (connection_death): Revert Joe's changes.
586         We can't release the connection there because there may be
587         SoupMessages still pointing to it. (Needs to be revisited.)
588
589 2003-04-03  JP Rosevear  <jpr@ximian.com>
590
591         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
592         error during waitpid
593
594         * libsoup/soup-address.c: ditto
595
596 2003-04-02  Joe Shaw  <joe@ximian.com>
597
598         * libsoup/soup-context.c (connection_death): Only drop the
599         connection if we get an error condition on the channel.  Fixes a
600         double-free.
601
602 2003-04-02  Joe Shaw  <joe@ximian.com>
603
604         * libsoup/soup-context.c (connection_death): Just call
605         soup_connection_release() from here and return whether the
606         connection is in use.
607
608 2003-03-31  Ian Peters  <itp@ximian.com>
609
610         * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
611         case of EAGAIN or EINTR, since shutting down an SSL connection
612         requires more than just closing a socket.
613
614 2003-03-28  Dan Winship  <danw@ximian.com>
615
616         * libsoup/soup-message.c (soup_message_set_context): If the new
617         context points to a different server from the old context, call
618         soup_message_cleanup. Otherwise it tries to reuse the old
619         connection...
620
621 2003-03-25  Joe Shaw  <joe@ximian.com>
622
623         * configure.in: Bump up to 1.99.16
624
625 2003-03-24  Joe Shaw  <joe@ximian.com>
626
627         * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
628         slightly better error message on various SSL failures than the
629         previous message.
630
631         * soup-queue.c (soup_queue_error_cb): Throw the
632         SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
633
634 2003-03-21  Joe Shaw  <joe@ximian.com>
635
636         * soup-server.c: Use non-deprecated g_main_loop_* calls
637         throughout.
638         (soup_server_unref): Don't unref the main loop if it's NULL.
639         Fixes a glib warning.
640
641 2003-03-18  Dan Winship  <danw@ximian.com>
642
643         * configure.in: comment out NSS checks. The NSS code doesn't work
644         and there are no current plans to fix it.
645
646         * README (Features): Mention GnuTLS, remove NSS and the rest of
647         the "Planned Features" section.
648
649         * MAINTAINERS: remove Alex
650
651         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
652         timeout to 10 seconds (and get rid of the 3 tries) so we don't
653         fail to connect just because the server is slow/far away.
654
655 2003-03-17  Joe Shaw  <joe@ximian.com>
656
657         * configure.in: Bump up to 1.99.15.
658
659 2003-03-12  Ian Peters  <itp@ximian.com>
660
661         * libsoup/soup-gnutls.c: because creating client credentials is
662         expensive, keep the same one around as long as possible, only
663         recreating it if the ssl_ca_file changes.  Wrap
664         gnutls_certificate_credentials in a refcounted struct to avoid
665         freeing it while another established connection may potentially
666         need it (say, to rehandshake).
667
668 2003-03-11  Frank Belew  <frb@ximian.com>
669
670         * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't 
671         use pkgconfig
672
673 2003-03-10  Joe Shaw  <joe@ximian.com>
674
675         * configure.in: Bump up to 1.99.14.
676
677         * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
678         libsoup/soup-ssl.c: Add support for GnuTLS.  Patch from Ian
679         Peters.
680
681 2003-03-07  Joe Shaw  <joe@ximian.com>
682
683         * configure.in: Bump up to 1.99.13.
684
685         * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
686         the list of conditions to watch.  If the remote end hangs up the
687         connection, we'll get a successful read of 0 bytes, not a HUP.
688         The connection will have to be released by the point we check for
689         it in connection_death().
690
691         * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
692         (apparently) errant resetting of the read and write tags.  I think
693         this might have been causing some reentrancy and crashes.
694
695         * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
696         channel to NULL encoding and not buffered.
697
698         * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
699         incorrect comments.
700
701 2003-02-28  Joe Shaw  <joe@ximian.com>
702
703         * configure.in: Bump up to 1.99.12.
704
705         * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
706         header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
707         this case we probably don't want to call the error callback, we
708         just want to act like our transfer was cancelled.
709
710 2003-02-27  Joe Shaw  <joe@ximian.com>
711
712         Try to apply some order to the iochannel refcounting...
713
714         * configure.in: Bump up to 1.99.11.
715
716         * libsoup/soup-context.c (soup_connection_get_iochannel): The
717         connections needs to own a reference to the iochannel!  If we're
718         using HTTPS, release the ref we get from soup_socket_get_iochannel
719         and replace it with the ref we get from soup_ssl_get_iochannel().
720         Then, always ref the channel that we return (ugh, but that's the
721         soup way).
722         (connection_free): Release the connection's ref to the iochannel.
723
724         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
725         iochannel. The reference we pass back will be owned by the
726         connection.
727         (soup_ssl_hup_waitpid): Release our ref.
728
729 2003-02-27  Joe Shaw  <joe@ximian.com>
730
731         * configure.in: Bump up to 1.99.10.
732
733         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
734         iochannel, return to the status quo.  Sigh.
735
736 2003-02-26  Joe Shaw  <joe@ximian.com>
737
738         * configure.in: Bump up to 1.99.9.
739
740         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
741         it's causing problems with HTTPS and proxies; the iochannel
742         refcounting is waaaaaay horked.
743
744 2003-02-26  Frank Belew  <frb@ximian.com>
745
746         * libsoup/Makefile.am: added workaround to link ssl-proxy statically
747
748 2003-02-11  Joe Shaw  <joe@ximian.com>
749
750         * configure.in: Bump up to 1.99.8 for snaps.
751
752         * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
753         It returns the address to the resulting hostent or NULL on failure,
754         unlike Linux which returns an error code.
755
756 2003-02-11  Joe Shaw  <joe@ximian.com>
757
758         * configure.in: Bump up to 1.99.7 for snaps.
759
760         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
761         the error string from OpenSSL if we can't establish a connection.
762
763 2003-02-04  Joe Shaw  <joe@ximian.com>
764
765         * configure.in: Bump up to 1.99.6 for snaps.
766
767         * libsoup/soup-server.c (destroy_message): We already assigned
768         chan, so don't reassign it, and unref it in all cases.
769         (issue_bad_request): Always unref after a call to
770         soup_socket_get_iochannel(), because it refs it.
771         (conn_accept): Fix some funky GIOChannel reffing here.
772
773         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
774         g_io_channel_ref() on the socket.  This is the exact opposite of
775         what we want to do.  Create a temporary structure containing the
776         parent pid and the old socket and unref the socket when our
777         callback is called.  This should fix GIOChannels being leaked on
778         SSL connections.
779
780         * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
781         main loop quits.
782
783 2003-01-22  Joe Shaw  <joe@ximian.com>
784
785         * configure.in: Bump up to 1.99.5 for the snaps.
786
787         * libsoup/soup-address.c (soup_address_new): If we found the
788         address in our hash, we need to return NULL or else Soup will
789         think we're doing an async lookup and do some cancellation on
790         us.  Besides, we were returning the wrong type anyway and it
791         was crashing things.
792
793 2003-01-17  Joe Shaw  <joe@ximian.com>
794
795         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
796         uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
797         out, so keep trying until we succeed.
798
799 2003-01-10  Joe Shaw  <joe@ximian.com>
800
801         * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
802         strings and print out the error when the cert can't verify.
803
804 2003-01-09  Dan Winship  <danw@ximian.com>
805
806         * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
807         overrun noticed by valgrind
808
809 2002-12-20  Joe Shaw  <joe@ximian.com>
810
811         * libsoup/soup-server.c (soup_server_new_with_host): Added.
812         Starts a server only on the interface specified, instead of all
813         network interfaces.
814
815 2002-12-16  Jeremy Katz  <katzj@redhat.com>
816
817         * configure.in: use $libdir instead of /usr/lib when looking for
818         libraries
819
820 2002-12-11  Joe Shaw  <joe@ximian.com>
821
822         * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
823         Don't set a variable to NULL and then immediately try to
824         dereference it.
825
826 2002-12-09  Joe Shaw  <joe@ximian.com>
827
828         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
829         timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
830         we don't hang forever if we don't get more data.
831
832         * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
833         or else we'll hang forever in SSL_connect() if the other side
834         hangs up.
835
836         * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
837         release the connection on message free, even if the connection was
838         unsuccessful.
839
840 2002-12-03  Joe Shaw  <joe@ximian.com>
841
842         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
843         g_io_channel_set_close_on_unref() on the second half of the socket
844         pair so we don't leak file descriptors.
845
846 2002-12-03  Frank Belew  <frb@ximian.com>
847
848         * libsoup/soup-address.c: add signal.h to the list of headers to 
849         pick up SIGKILL
850         
851 2002-11-25  Joe Shaw  <joe@ximian.com>
852
853         * Makefile.am: Build the tests directory again
854
855 2002-11-21  Rodney Dawes  <dobey@ximian.com>
856
857         * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
858         
859 2002-11-20  Michael Meeks  <michael@ximian.com>
860
861         * configure.in: require autoconf 2.52 not 2.53.
862
863 2002-11-18  Dan Winship  <danw@ximian.com>
864
865         * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
866         since it's apparently non-portable. Use s6_addr instead.
867         (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
868
869         * libsoup/soup-error.c: Fix spelling of
870         SOUP_ERROR_MOVED_PERMANENTLY and its description.
871
872         * libsoup/soup-message.c (soup_message_get_request_header, etc):
873         Remove long-deprecated API.
874
875         * libsoup/soup-socket.c (soup_socket_connect): remove unused
876         variable.
877
878         * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
879         * libsoup/soup-server.c (cgi_read): Likewise
880         * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
881         Likewise.
882         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
883         * libsoup/soup-transfer.c (soup_transfer_read_cb,
884         soup_transfer_write_cb): Likewise.
885
886         * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
887         instead of IPv4. (Tested on OS X.)
888
889 2002-11-15  Dan Winship  <danw@ximian.com>
890
891         * libsoup/*: Change old Helix Code refs to Ximian (and update
892         copyright dates).
893
894 2002-11-15  Frank Belew  <frb@ximian.com>
895
896         * tests/Makefile.am: uncomment lines to make timeserver build 
897         correctly
898         
899 2002-11-14  Joe Shaw  <joe@ximian.com>
900
901         * libsoup/soup-address.c (soup_address_new): When we get an
902         address from the hash, call our address lookup callback or else
903         the connection will hang.
904
905 2002-11-13  Dan Winship  <danw@ximian.com>
906
907         * tests/timeserver.c: Oops, commit this.
908
909         * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
910
911 2002-11-13  Joe Shaw  <joe@ximian.com>
912
913         * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
914         (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
915         instead of bindir.
916
917         * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
918         to properly shut down the SSL connection before closing the
919         socket.
920
921         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
922         iochannels before quitting the main loop.
923
924         * tests/Makefile.am: disable building timeserver, the source file
925         wasn't added.
926
927 2002-11-12  Dan Winship  <danw@ximian.com>
928
929         * configure.in: Check for IPv6 support in networking headers.
930
931         * libsoup/soup-address.c: Make the internal structure of
932         SoupAddress entirely private, and make SoupAddress be more like a
933         hostent and less like a sockaddr. (Ie, make it not have a port
934         associated with it.) Document undocumented functions. Add
935         completely-untested support for IPv6.
936         (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
937         SoupAddress and a port.
938         (soup_address_ipv4_any, soup_address_ipv6_any): Return static
939         addresses corresponding to the IPv6 and IPv6 "any" addresses.
940         (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
941         (soup_address_make_sockaddr): Now constructs a new sockaddr, which
942         may be a sockaddr_in or sockaddr_in6.
943         (soup_address_gethostname, soup_address_gethostaddr): Remove
944         these. They aren't reliable, especially on multihomed hosts.
945         (soup_gethostbyname, soup_gethostbyaddr): support IPv6
946         (soup_address_new): Keep pending lookups in a separate hash table
947         from completed lookups. Fix a bug when canceling a lookup when
948         there was more one outstanding request for it.
949         (soup_address_lookup_in_cache): Removed.
950
951         * libsoup/soup-socket.c: Add a port field to SoupSocket (since
952         it's not in SoupAddress any more).
953         (soup_socket_connect): Simplify this. Don't use
954         soup_address_lookup_in_cache, just call soup_address_new, since we
955         already know the code can deal with the callback being invoked
956         immediately.
957         (soup_socket_new_sync, soup_socket_new): Take a port argument.
958         (soup_socket_server_new): Take a SoupAddress to use as the local
959         address to bind to. This lets the caller choose between the IPv4
960         and IPv6 "any" addresses, and also lets you bind to a single
961         interface of a multi-homed machine.
962         (soup_socket_server_accept, soup_socket_server_try_accept): Merge
963         the common code.
964
965         * libsoup/soup-server.c (soup_server_new): Pass
966         soup_address_ipv4_any() to soup_socket_server_new().
967
968         * libsoup/soup-socks.c (soup_connect_socks_proxy,
969         soup_socks_write): Fix up for the API changes, but it won't work
970         with IPv6 yet.
971
972         * tests/timeserver.c: Another really simple test, for the server
973         socket code.
974
975         * tests/Makefile.am: build timeserver
976
977 2002-11-11  Dan Winship  <danw@ximian.com>
978
979         * libsoup/soup-address.c: Move the SoupAddress code from
980         soup-socket.c and soup-socket-unix.c to here.
981
982         * libsoup/soup-socket.c: Move the remaining code from
983         soup-socket-unix.c here.
984
985         * libsoup/soup-socket-unix.c: Gone
986
987         * tests/get.c: really really trivial test program
988
989         * configure.in (AC_OUTPUT):
990         * Makefile.am (SUBDIRS): add tests/
991
992 2002-11-05  Dan Winship  <danw@ximian.com>
993
994         * Split libsoup out of soup. ChangeLog.old contains the original
995         soup ChangeLog.
996
997         * Makefile.am, etc: Fix things up to work with the new directory
998         layout. Disable docs until we fix them.
999
1000         * autogen.sh: Use gnome-autogen.sh
1001
1002         * configure.in: Require autoconf 2.53. Remove stuff that was only
1003         needed for httpd or wsdl code. Remove glib1 support. Bump version
1004         to 2.0.
1005
1006         * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
1007         in ${includedir}/soup-2.0
1008         
1009         * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
1010         SOAP-specific stuff, Windows support, and other things that
1011         weren't being maintained.
1012
1013         * soup-config.in, soupConf.sh: Kill these. We only support
1014         pkg-config now.