3fc2fe6617a20d700bddd08e10b5d0bd9a8a71f3
[platform/upstream/libsoup.git] / ChangeLog
1 2004-07-06  Dan Winship  <danw@novell.com>
2
3         * libsoup/soup-uri.c (soup_uri_new_with_base): if the protocol is
4         http or https, require a hostname. For #61049
5
6         * tests/uri-parsing.c (rel_tests, do_uri): Update for that
7
8 2004-06-03  JP Rosevear <jpr@novell.com>
9
10         * configure.in: bump version to 2.1.11, libtool number
11
12 2004-06-01  Dan Winship  <danw@novell.com>
13
14         * libsoup/soup-address.c: Redo the various IPv4/IPv6-abstracting
15         macros to not use ?: expressions as lvalues, since that's
16         apparently a GNU extension.
17         (soup_address_resolve_async): Use a timeout rather than an idle
18         handler to poll the dns result. (soup-dns really should be
19         rewritten to not require polling, but this is easier for now.)
20         #59240
21
22         * libsoup/soup-server.c (call_handler): Don't use GNU-only
23         non-constant structure initialization
24
25         * tests/dns.c: Simple test of the dns code
26
27         * tests/Makefile.am (noinst_PROGRAMS): build it
28
29 2004-05-19  JP Rosevear  <jpr@novell.com>
30
31         * configure.in (SOUP_API_VERSION): bump version, libtool numbers
32
33 2004-05-18  Dan Winship  <danw@novell.com>
34
35         * libsoup/soup-ssl.h:
36         * libsoup/soup-nossl.c: define some GError codes and stuff
37
38         * libsoup/soup-gnutls.c: add missing #include <gnutls/x509.h>
39         (do_handshake): when returning G_IO_STATUS_AGAIN, set the GError
40         to SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ or _NEEDS_WRITE
41         appropriately.
42
43         * libsoup/soup-socket.c (soup_socket_write): Handle
44         SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ, by setting an io watch for
45         G_IO_IN instead of G_IO_OUT. Fixes the rcd-sucking-up-all-cpu bug
46         (#58434)
47         (read_from_network): Handle the reverse case (which would cause
48         hanging rather than spinning, and might be the cause of some
49         connector 1.5 slowness?)
50
51 2004-05-11  Dan Winship  <danw@novell.com>
52
53         * libsoup/soup-misc.c (soup_signal_connect_once): Do this less
54         kludgefully, using the magic of GClosure, to fix x86_64 problems
55         reported by snorp.
56
57 2004-05-04  Sivaiah Nallagatla <snallagatla@novell.com>
58
59         * libsoup/soup-soap-message.c (finalize) : free
60         the elements of priv structure before freeing priv
61
62 2004-04-20  Dan Winship  <danw@ximian.com>
63
64         * libsoup/soup-connection-ntlm.c (ntlm_authorize_post): if
65         re-sending the message, call soup_message_restarted()
66         (send_request): Connect to "restarted" signal, and remove the 401
67         handlers from there; doing it here didn't work because if the
68         connection was closed, the message would be re-sent on a new
69         connection, but would still have the handlers from the old
70         connection attached to it, which would make authentication fail.
71
72         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
73         Copy the handler list before starting, to protect against handlers
74         that modify the handler list.
75
76 2004-04-15  Dan Winship  <danw@ximian.com>
77
78         * libsoup/soup-connection.c (soup_connection_connect_sync):
79         Connect to the socket's "disconnect" signal. (We were only doing
80         this from the async version before, which meant that synchronous
81         SoupConnections could outlive their sockets and start causing
82         errors.) #57004
83
84         * libsoup/soup-connection-ntlm.c (send_request): Remove the old
85         Authorization header before adding a new one.
86
87 2004-04-02  JP Rosevear  <jpr@ximian.com>
88
89         * configure.in: bump version, libtool number
90
91 2004-03-15  Dan Winship  <danw@ximian.com>
92
93         * libsoup/soup-soap-message.c (soup_soap_message_persist): Fix up
94         types to kill a warning with -Wall -O2
95
96 2004-03-05  JP Rosevear <jpr@ximian.com>
97
98         * configure.in: bump version, libtool number
99
100 2004-03-02  Dan Winship  <danw@ximian.com>
101
102         * libsoup/soup-dns.c (check_hostent): Only loop on EINTR if
103         bytes_read is -1, since the value of errno is irrelevant when
104         bytes_read is 0. Probably #54960.
105
106 2004-03-01  Rodrigo Moya <rodrigo@ximian.com>
107
108         * libsoup/soup-soap-response.h: removed not-implemented function's
109         prototype.
110
111 2004-02-27  Rodney Dawes  <dobey@ximian.com>
112
113         * configure.in:
114         * libsoup/Makefile.am: Use a different variable for linking to the
115         static version of gnutls, so we don't pull the .a files into the .pc
116
117         Fixes #53346
118
119 2004-02-20  Dan Winship  <danw@ximian.com>
120
121         * libsoup/soup-message-io.c (read_metadata, read_body_chunk,
122         write_data): Pass gsize *, not guint *, to soup_socket_read/write,
123         to make this work on 64-bit platforms. (Grr. C type checking
124         sucks.) #54631
125         
126         * tests/revserver.c: Likewise
127
128 2004-02-18  Rodrigo Moya <rodrigo@ximian.com>
129
130         Fixes #54512
131
132         * libsoup/soup-soap-response.c (soup_soap_parameter_get_int_value):
133         don't leak the value returned from xmlNodeGetContent().
134         (soup_soap_parameter_get_string_value,
135         soup_soap_parameter_get_property): return a g_strdup'ed
136         string, not the value returned by xmlNodeGetContent, so that
137         callers can use g_free, and not xmlFree.
138
139         * libsoup/soup-soap-response.h: made soup_parameter_get_property
140         not return const.
141
142 2004-02-17  Dan Winship  <danw@ximian.com>
143
144         * libsoup/soup-soap-message.h (SOUP_IS_SOAP_MESSAGE_CLASS): Fix a
145         typo. #54433, from Mariano Suarez-Alvarez.
146
147         * libsoup/soup-soap-response.h (SOUP_IS_SOAP_RESPONSE_CLASS):
148         Likewise
149
150 2004-02-17  Rodney Dawes  <dobey@ximian.com>
151
152         * libsoup/soup-message.c (soup_message_new): HTTP connections require
153         a hostname, and we also hash on the host for message queueing in the
154         session, if the host is NULL we free the SoupUri and return NULL
155
156 2004-02-14  Dan Winship  <danw@ximian.com>
157
158         * configure.in: Use POSIX-compliant "test $foo = bar", rather than
159         GNU-only "test $foo == bar". #54354, from Julio M. Merino Vidal.
160
161 2004-02-12  Joe Shaw  <joe@ximian.com>
162
163         * libsoup/soup-dns.c (check_hostent): Call read() in a do-while
164         loop to prevent DNS errors from short reads.
165
166 2004-02-11  Joe Shaw  <joe@ximian.com>
167
168         * configure.in: Bumped version number to 2.1.7 and libtool
169         current. 
170
171 2004-02-11  Dan Winship  <danw@ximian.com>
172
173         * libsoup/soup-connection.c (soup_connection_disconnect): Update
174         Joe's comment here with a gory explanation of exactly what's going
175         on. (It's not just an SSL bug either, it affects all connections.)
176
177 2004-02-10  Joe Shaw  <joe@ximian.com>
178
179         * libsoup/soup-connection.c (soup_connection_disconnect): Add a
180         workaround for SSL connections which time-out but don't close the
181         socket until we try sending data again later.
182
183         * libsoup/soup-socket.c (soup_socket_connect, soup_socket_listen):
184         Don't free the sockaddr from soup_address_get_sockaddr(); we don't
185         own it, the SoupAddress does.
186
187 2004-02-09  JP Rosevear  <jpr@ximian.com>
188
189         * configure.in: Bump libtool numbers
190
191 2004-02-05  Dan Winship  <danw@ximian.com>
192
193         * libsoup/soup-session.c (soup_session_add_filter): Ref the filter
194         when adding it.
195         (soup_session_remove_filter): And unref it here (we were already
196         unreffing it in dispose().)
197
198 2004-02-05  Joe Shaw  <joe@ximian.com>
199
200         * libsoup/soup-dns.c (soup_dns_entry_unref): Don't try to free the
201         hostent if it's NULL.
202         (soup_dns_entry_check_lookup): If the entry is resolved, but the
203         hostent is NULL, uncache it.
204
205 2004-02-04  Dan Winship  <danw@ximian.com>
206
207         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Always
208         remove the WWW-Authenticate headers before returning, so the
209         session won't fall back to Basic auth. Also, leave the connection
210         in the "authenticating" state rather than setting it to
211         "authenticated".
212         (ntlm_authorize_post): Only requeue the message if it's in the
213         "authenticating" state (and set it to "authenticated"). Fixes an
214         "unepectedly disconnected" error if authentication fails.
215
216 2004-02-03  Dan Winship  <danw@ximian.com>
217
218         * libsoup/soup-message-io.c (io_cleanup): Call
219         soup_message_io_stop so we don't get a callback on the io after
220         it's been cleaned up.
221
222         * libsoup/soup-session.c (add_auth): Only remove the Authorization
223         header if we have another one to add. (Otherwise it messes up
224         SoupConnectionNTLM.)
225
226         * libsoup/soup-socket.c (read_from_buf): Use memmove rather than
227         memcpy here, since the source and destination will overlap if
228         *nread is small and read_buf->len is large. (Noticed by valgrind,
229         #53625.)
230
231 2004-02-02  Joe Shaw  <joe@ximian.com>
232
233         * libsoup/soup-gnutls.c (soup_gnutls_close): Call gnutls_bye()
234         with the GNUTLS_SHUT_WR flag (instead of RDWR) and check only for
235         GNUTLS_E_INTERRUPTED.  GNUTLS_E_AGAIN will be returned by recv()
236         when there are no messages on the wire on a non-blocking socket.
237         This sends a SSL hangup message and then allows us to immediately
238         close the socket.
239
240 2004-01-30  Rodrigo Moya <rodrigo@ximian.com>
241
242         * configure.in: bumped version number to 2.1.6.
243
244 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
245
246         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_property):
247         new function.
248
249 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
250
251         * libsoup/soup-soap-response.[ch]
252         (soup_soap_parameter_get_string_value): removed 'const' from return
253         type.
254
255 2004-01-29  Joe Shaw  <joe@ximian.com>
256
257         * libsoup/soup-gnutls.c (verify_certificate): Initialize the
258         certificate before we try to use it.  Ahem.
259
260 2004-01-23  Joe Shaw  <joe@ximian.com>
261
262         * configure.in: Bump version to 2.1.5 and SOUP_RELEASE to 2
263
264 2004-01-21  Joe Shaw  <joe@ximian.com>
265
266         * configure.in: Require at least GnuTLS 1.0.0.
267
268         * libsoup/soup-gnutls.c: Fix the use of deprecated GnuTLS
269         functions.
270         (verify_certificate): Use gnutls_x509_crt_import() and
271         gnutls_x509_crt_check_hostname() instead of
272         gnutls_x509_check_certificates_hostname().
273         (init_dh_params): Use gnutls_dh_params_generate2() instead of
274         gnutls_dh_params_generate() and gnutls_dh_params_set().
275
276 2004-01-20  Joe Shaw  <joe@ximian.com>
277
278         * libsoup/soup-gnutls.c (soup_gnutls_close): gnutls_bye() doesn't
279         close the socket itself, so we need to do it or else our
280         connections stay in CLOSE_WAIT forever.
281
282 2004-01-16  Jason Leach  <leach@wam.umd.edu>
283
284         * libsoup/Makefile.am: builddir != srcdir fixes.
285
286 2004-01-14  Joe Shaw  <joe@ximian.com>
287
288         * libsoup/soup-gnutls.c (verify_certificate): Remove the
289         check for GNUTLS_CERT_CORRUPTED, it's not in 1.0.x.
290
291 2004-01-12  JP Rosevear  <jpr@ximian.com>
292
293         * configure.in: bump version and libtool revision
294
295 2004-01-12  Dan Winship  <danw@ximian.com>
296
297         * tests/simple-httpd.c (main): Add a g_thread_init() so this works
298         again.
299
300 2004-01-10  Larry Ewing  <lewing@ximian.com>
301
302         * libsoup-2.2.pc.in (Libs): use LIBGNUTLS_LIBS in the substitution
303         string.
304
305 2004-01-09  Joe Shaw  <joe@ximian.com>
306
307         * acinclude.m4: Include the libgnutls.m4 file.
308
309         * configure.in: Remove manual checking for libgnutls-config and
310         use the AM_PATH_LIBGNUTLS so we can pass in a minimum required
311         version, which is 0.9.7 for now.
312
313         * libsoup/Makefile.am: Some changes for the above change.
314
315         * libsoup/soup-gnutls.c: Check for HAVE_SSL, not
316         HAVE_GNUTLS_GNUTLS_H.
317         (verify_certificate): Uncomment the SSL certificate hostname
318         check.
319
320         * libsoup/soup-session.c (set_property): Be smart about flushing
321         our SSL credentials only when the CA file is set to something
322         different than it was before.
323
324 2004-01-09  Harish K <kharish@novell.com>
325         * libsoup/soup-soap-response.c (soup_soap_response_from_string): 
326         added code to ignore Header element, if present, while creating 
327         response objects.  
328         
329 2004-01-05  Dan Winship  <danw@ximian.com>
330
331         * configure.in: Remove no-longer-relevant socklen_t check
332
333         * libsoup/soup-address.c: Reorder #includes for FreeBSD (From Joe
334         Marcus Clarke, #52566)
335
336         * libsoup/soup-dns.c: Likewise
337
338 2003-12-29  JP Rosevear <jpr@ximian.com>
339
340         * configure.in: bump version and libtool numbers
341
342 2003-12-22  Dan Winship  <danw@ximian.com>
343
344         * README, TODO: Update these
345
346 2003-12-22  Dan Winship  <danw@ximian.com>
347
348         * libsoup/soup-socket.c: Lots of thread-safety stuff, primarly so
349         you can disconnect a socket from one thread while doing I/O in
350         another.
351
352         * libsoup/soup-message-io.c (soup_message_io_cancel): Split into
353         soup_message_io_stop() and io_cleanup(), to separate out the "stop
354         reading/writing" and "free data" phases to allow thread-safe
355         synchronous cancellation.
356         (soup_message_io_finished): call both soup_message_io_stop() and
357         io_cleanup()
358         (io_error): Only set SOUP_STATUS_IO_ERROR on the message if it
359         doesn't already have a transport error status (eg, CANCELLED).
360         (new_iostate): Call io_cleanup() if needed.
361
362         * libsoup/soup-status.h: add "SOUP_STATUS_NONE" for 0, to make it
363         clearer that it's not a status.
364
365         * libsoup/soup-message.c (finalize, restarted, finished,
366         soup_message_set_uri): s/soup_message_io_cancel/soup_message_io_stop/
367         (soup_message_cleanup_response): s/0/SOUP_STATUS_NONE/
368
369         * libsoup/soup-connection.c (send_request): Remove
370         soup_message_io_cancel call.
371
372         * libsoup/soup-session-sync.c (send_message): Connect to the
373         connection's "disconnected" signal rather than using a weak ref,
374         since that's what we really care about, and it's possible that the
375         connection may have an extra ref on it somewhere that would keep
376         it from being destroyed even if it was disconnected.
377
378 2003-12-20  Joe Shaw  <joe@ximian.com>
379
380         * libsoup/soup-session.c (lookup_auth): If const_path is NULL un
381         the non-proxy case, then use the root ("/").
382
383 2003-12-19  Dan Winship  <danw@ximian.com>
384
385         * libsoup/soup-message-filter.c: New. An interface for objects
386         that want to act on every message passing through a session.
387         (Initially being used for authentication, but could also be used
388         for cache handling, cookie management, etc.)
389
390         * libsoup/soup-connection.c (class_init, etc): Add a message
391         filter property.
392         (send_request): If the connection has a message filter set, run
393         it on the message before sending it.
394         (soup_connection_connect_async, etc): When setting up a tunnel, if
395         we get back a 407 and the session tries to requeue the message,
396         either re-send it, or return SOUP_STATUS_TRY_AGAIN (depending on
397         whether or not the proxy closed the connection).
398         (soup_connection_connect_sync): Likewise
399         (send_request, request_done): Ref/unref the connection
400
401         * libsoup/soup-session.c (soup_session_get_type): Implement the
402         SoupMessageFilter interface.
403         (soup_session_get_connection): Use the session as the connection's
404         message filter
405         (soup_session_add_filter, soup_session_remove_filter): Add/remove
406         filters from the session
407         (setup_message): do auth handling, and call each of the session's
408         filters' setup_message methods as well.
409         (soup_session_send_message_via): No longer needed.
410         (connect_result): Handle SOUP_STATUS_TRY_AGAIN.
411
412         * libsoup/soup-session-async.c (run_queue): Use
413         soup_connection_send_request, since soup_session_send_message_via
414         is gone now.
415
416         * libsoup/soup-session-sync.c (send_message): Likewise
417
418         * libsoup/soup-message.c (soup_message_is_keepalive): A successful
419         response to a CONNECT is always keepalive, even if it's HTTP/1.0
420         with no Connection header.
421
422         * libsoup/soup-status.h: add SOUP_STATUS_TRY_AGAIN
423
424         * libsoup/soup-types.h: Add SoupMessageFilter, and macros for
425         gobject interface types.
426
427         * tests/get.c (main): Add a -p flag to specify a proxy
428
429         * tests/simple-proxy.c: Fix #includes
430
431 2003-12-18  Dan Winship  <danw@ximian.com>
432
433         * libsoup/soup-connection.c (soup_connection_disconnect): Actually
434         disconnect the socket rather than just unreffing it, since the IO
435         code may be holding an extra ref on it.
436         (send_request): connect to the "restarted" signal too
437         (request_restarted): Deal with "Connection: close"
438
439         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this
440         not go into an infinite loop if the server only supports Basic.
441
442 2003-12-17  Rodrigo Moya <rodrigo@ximian.com>
443
444         * libsoup/Makefile.am: install soup-message-queue.h with the rest
445         of the headers.
446
447 2003-12-17  Dan Winship  <danw@ximian.com>
448
449         * configure.in: Add gthread to glib check
450
451         * libsoup/soup-session.c: Make this an abstract class.
452
453         * libsoup/soup-session-async.c: A SoupSession class for
454         asynchronous gmain-based operation; replaces the old SoupSession.
455
456         * libsoup/soup-session-sync.c: A SoupSession class for synchronous
457         blocking operation for use with threaded apps.
458
459         * libsoup/soup-types.h, libsoup/soup.h: add the new session
460         subclasses
461
462         * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
463         try to unref the socket if the socket creation fails.
464         (soup_connection_reserve): New, to explicitly mark a connection as
465         being in use without queueing a message on it.
466
467         * libsoup/soup-dns.c (check_hostent): Oof. Fix the logic of the
468         "block" flag to not be reversed.
469
470         * libsoup/soup-message.c (finished): set status to FINISHED here.
471         (soup_message_cancel): Gone; needs to be done at the session
472         level.
473
474         * libsoup/soup-message-queue.c: Add a mutex and make all of the
475         operations thread-safe.
476
477         * libsoup/soup-socket.c (disconnect_internal): Make this
478         thread-safe.
479         (soup_socket_connect): Make the sync case work correctly.
480
481         * libsoup/Makefile.am: add the SoupSession subclasses
482
483         * tests/Makefile.am: libsoup depends on libgthread now, so
484         revserver doesn't need to explicitly.
485
486         * tests/get.c, tests/auth-test.c, tests/simple-proxy.c: Use
487         soup_session_async_new().
488
489 2003-12-16  Rodrigo Moya <rodrigo@ximian.com>
490
491         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_int_value):
492         new function.
493
494 2003-12-16  Joe Shaw  <joe@ximian.com>
495
496         * libsoup/soup-connection.c (socket_connect_result,
497         soup_connection_connect_sync): Only set up a tunnel if the
498         destination protocol is HTTPS.
499
500         * libsoup/soup-message.c (class_init): Add a default handler for
501         wrote_body.
502         (wrote_body): Run the SOUP_HANDLER_POST_REQUEST handlers here.
503         (soup_message_cancel): Don't set the status to
504         SOUP_STATUS_CANCELLED and call soup_message_finished() if the
505         status is already SOUP_MESSAGE_STATUS_FINISHED.
506
507         * libsoup/soup-session.c (set_property): Don't cancel the session
508         if the proxy URI set as a property isn't different from the old
509         one.
510         (get_host_for_message): Refactor some code so that we can easily
511         get the right SoupSessionHost for proxies as well as from the
512         message.
513         (authenticate_auth): Take a gboolean proxy parameter.  Check it to
514         see which URI (message URI or proxy URI) to use for
515         authentication.  Add a long comment about lack of clarity in RFC
516         2617 with respect to proxies and protection spaces.
517
518 2003-12-15  Dan Winship  <danw@ximian.com>
519
520         * libsoup/soup-socket.h (soup_socket_read, soup_socket_read_until,
521         soup_socket_write): s/guint/gsize/ to match the definitions in
522         soup-socket.c. #52167.
523
524 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
525
526         * libsoup/soup-soap-message.c: removed debugging of the messages here.
527
528 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
529
530         * libsoup/soup-soap-message.c (soup_soap_message_start_envelope):
531         added information for SOAP-ENV namespace.
532
533 2003-12-10  Dan Winship  <danw@ximian.com>
534
535         * libsoup/soup-message-client-io.c (parse_response_headers): if we
536         receive an HTTP/1.0 response to an HTTP/1.1 request, downgrade the
537         message's http_version so the keep-alive handling is correct.
538         Fixes a problem noticed almost simultaneously by Rodrigo and Joe.
539
540         * libsoup/soup-message.c (soup_message_restarted, etc): Add a
541         "restarted" signal as suggested by Joe.
542
543         * libsoup/soup-message-io.c (soup_message_io_finished): emit
544         either "restarted" or "finished" as appropriate
545
546         * libsoup/soup-session.c (soup_session_queue_message): Connect to
547         "restarted" and run the queue if a message gets restarted
548
549         * libsoup/soup-status.h: Remove a stray comma that gtk-doc doesn't
550         like.
551
552 2003-12-10  Tambet Ingo  <tambet@ximian.com>
553
554         * configure.in: Use autoconfig to check for socklen_t ...
555
556         * libsoup/soup-address.c: ... and remove it from here ...
557
558         * libsoup/soup-dns.c: ... and here.
559
560 2003-12-09  Rodrigo Moya <rodrigo@ximian.com>
561
562         * libsoup/soup-soap-message.c (soup_soap_message_persist):
563         (soup_soap_message_parse_response): print out request/response's
564         contents, if in debug mode.
565
566 2003-12-07  JP Rosevear  <jpr@ximian.com>
567
568         * configure.in: Bump version
569
570 2003-11-28  Rodrigo Moya <rodrigo@ximian.com>
571
572         * libsoup/soup-soap-response.[ch]
573         (soup_soap_parameter_get_first_child,
574         soup_soap_parameter_get_first_child_by_name,
575         soup_soap_parameter_get_next_child,
576         soup_soap_parameter_get_next_child_by_name): new functions to
577         manage SoupSoapParameter's children.
578         (soup_soap_response_get_first_parameter): dont return a GList, but
579         a SoupSoapParameter contained in the GList.
580
581 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
582
583         * libsoup/soup-soap-response.[ch]
584         (soup_soap_parameter_get_string_value): new function.
585
586 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
587
588         * libsoup/soup-soap-response.[ch]: added SoupSoapParameter
589         structure, to "hide" the usage of xmlNode's.
590         (soup_soap_parameter_get_name): functions to manage SOAP
591         response parameters.
592         (soup_soap_response_get_first_parameter,
593         soup_soap_response_get_first_parameter_by_name,
594         soup_soap_response_get_next_parameter,
595         soup_soap_response_get_next_parameter_by_name):
596         new functions for an easy access to the response's parameters.
597         (soup_soap_response_from_string): removed warnings.
598
599 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
600
601         * libsoup/soup-soap-response.c (soup_soap_response_set_method_name):
602         fixed typo.
603
604 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
605
606         * libsoup/soup-soap-response.[ch] (soup_soap_response_get_method_name,
607         soup_soap_response_set_method_name, soup_soap_message_get_parameters):
608         new functions.
609         (finalize): NULL out new private fields.
610         (soup_soap_response_from_string): added validation code.
611
612 2003-11-23  Rodrigo Moya <rodrigo@ximian.com>
613
614         * libsoup/soup-soap-response.[ch]: new class for managing SOAP
615         responses.
616
617         * libsoup/soup-soap-message.[ch] (soup_soap_message_parse_response):
618         new function.
619
620         * libsoup/Makefile.am: added new files.
621
622 2003-11-18  Rodney Dawes  <dobey@ximian.com>
623
624         * gtk-doc.make: Add gtk-doc.make to cvs for systems without gtk-doc
625
626 2003-11-18  Rodney Dawes  <dobey@ximian.com>
627
628         * acinclude.m4: Add GTK_DOC_CHECK
629
630 2003-11-18  Dan Winship  <danw@ximian.com>
631
632         * configure.in: Replace old gtk-doc test with GTK_DOC_CHECK()
633         (AC_OUTPUT): add docs/Makefile, docs/reference/Makefile
634
635         * autogen.sh (REQUIRED_AUTOMAKE_VERSION): 1.6, for gtk-doc.make
636
637         * Makefile.am: updates for gtk-doc
638         (SUBDIRS): add back "docs"
639
640         * docs/Makefile.am (EXTRA_DIST): remove, since those old docs
641         aren't around any more
642
643         * docs/reference/*: set up gtk-doc
644
645         * libsoup/Makefile.am (INCLUDES): Change G_LOG_DOMAIN to
646         "libsoup". Remove unused defines.
647
648         * libsoup/soup-connection.c: Fix doc comments
649         * libsoup/soup-message.c: Likewise
650         * libsoup/soup-misc.c: Likewise
651         * libsoup/soup-socket.c: Likewise
652         * libsoup/soup-uri.c: Likewise
653
654         * libsoup/soup-address.h: Fixes to please gtk-doc
655         * libsoup/soup-connection.h: Likewise
656         * libsoup/soup-message.h: Likewise
657         * libsoup/soup-message-private.h: Likewise
658         * libsoup/soup-misc.h: Likewise
659         * libsoup/soup-server-auth.h: Likewise
660         * libsoup/soup-socket.h: Likewise
661         * libsoup/soup-status.h: Likewise
662
663 2003-11-18  Dan Winship  <danw@ximian.com>
664
665         * configure.in: Fix up the SSL checks some. Remove some useless
666         old header checks.
667
668         * libsoup/soup-misc.h: declare soup_ssl_supported.
669
670         * libsoup/soup-gnutls.c: add soup_ssl_supported declaration.
671
672         * libsoup/soup-nossl.c: Not an SSL implementation, built if
673         HAVE_SSL is not defined.
674
675         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): add soup-nossl.c
676
677         * libsoup/soup-socket.c (soup_socket_start_ssl): Return success or
678         failure.
679         (listen_watch): Deal with soup_socket_start_ssl failing.
680
681         * libsoup/soup-connection.c (tunnel_connect_finished,
682         socket_connect_result, soup_connection_connect_sync): Deal with
683         the soup_socket_start_ssl failing.
684
685         * libsoup/soup-server.c (soup_server_new): Deal with
686         soup_ssl_get_server_credentials failing
687
688 2003-11-18  Rodrigo Moya <rodrigo@ximian.com>
689
690         * libsoup/soup-soap-message.[ch] (soup_soap_message_start_fault,
691         soup_soap_message_end_fault, soup_soap_message_start_fault_detail,
692         soup_soap_message_end_fault_detail, soup_soap_message_start_header,
693         soup_soap_message_end_header,
694         soup_soap_message_start_header_element,
695         soup_soap_message_end_header_element, soup_soap_message_write_int,
696         soup_soap_message_write_double, soup_soap_message_write_base64,
697         soup_soap_message_write_time, soup_soap_message_write_string,
698         soup_soap_message_write_buffer, soup_soap_message_set_element_type,
699         soup_soap_message_set_null, soup_soap_message_add_attribute,
700         soup_soap_message_add_namespace,
701         soup_soap_message_set_default_namespace,
702         soup_soap_message_get_namespace_prefix,
703         soup_soap_message_set_encoding_style, soup_soap_message_reset,
704         soup_soap_message_persist): new functions from old SoupSerializer.
705
706 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
707
708         * libsoup/soup-soap-message.[ch] (soup_soap_message_new,
709         soup_soap_message_new_from_uri): added a bunch of initialization
710         parameters.
711         (soup_soap_message_get_xml_doc, soup_soap_message_start_envelope,
712         soup_soap_message_end_envelope, soup_soap_message_start_body,
713         soup_soap_message_end_body, soup_soap_message_start_element,
714         soup_soap_message_end_element):
715         new functions.
716
717         * configure.in: depend on libxml-2.0 for the SOAP code.
718
719         * libsoup/Makefile.am: use XML CFLAGS and LIBS.
720
721 2003-11-17  Joe Shaw  <joe@ximian.com>
722
723         * configure.in: Add in the --enable-libgpg-error flag from the 2.0
724         branch.
725
726         * acinclude.m4: Include the gpg-error macros.
727
728 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
729
730         * libsoup/soup-soap-message.[ch]: new class to make it easier to
731         build SOAP messages.
732
733         * libsoup/Makefile.am: added new files.
734
735         * configure.in: increased version number.
736
737 2003-10-24  Joe Shaw  <joe@ximian.com>
738
739         * libsoup/soup-address.c (update_address_from_entry): Call
740         soup_dns_entry_get_hostent() on the SoupAddress passed in, not the
741         one in addr->priv->lookup.  Fixes a crash on synchronous DNS
742         lookups.
743
744         * libsoup/soup-server.c (soup_server_new): We need to ref the
745         address we're binding to, because soup_socket_get_local_address()
746         doesn't ref for us.
747
748 2003-10-23  Dan Winship  <danw@ximian.com>
749
750         * libsoup/soup-socket.c (init): Initialize flags to default
751         values.
752
753 2003-09-23  Dan Winship  <danw@ximian.com>
754
755         * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but
756         note whether or not the CA file has been loaded.
757         (SoupGNUTLSChannel): add a "hostname" field.
758         (verify_certificate): Remove the comment about not being able to
759         verify the hostname because of soup problems. Now it's because of
760         GNUTLS problems instead.
761         (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel,
762         and takes a hostname and a creds argument now.
763         (soup_ssl_get_client_credentials,
764         soup_ssl_get_server_credentials): Return client/server credentials
765         structures.
766         (soup_ssl_free_client_credentials,
767         soup_ssl_free_server_credentials): and free them.
768
769         * libsoup/soup-session.c (class_init, set_property, get_property):
770         add ssl_ca_file property
771         (get_host_for_message): when returning an SSL host for the first
772         time, create a client credentials structure for the session.
773         (run_queue): Pass the ssl creds to the new connection. Also fix an
774         unrelated bug that caused infinite loops on "bad hostname".
775
776         * libsoup/soup-server.c: Use GObject properties, including
777         ssl_cert_file and ssl_key_file properties.
778         (soup_server_new): Remove "protocol" argument; if the cert file
779         and key file properties were set, create a server credential
780         structure from them and pass that to soup_socket_server_new.
781
782         * libsoup/soup-connection.c (SoupConnectionPrivate): Rename
783         dest_uri to origin_uri to match RFC 2616 terminology. Add an
784         "ssl_creds" field.
785         (class_init, set_property, get_property): add SSL_CREDS property
786         (soup_connection_connect_async, soup_connection_connect_sync):
787         Pass ssl_creds to soup_socket_client_new calls.
788
789         * libsoup/soup-socket.c: Use GObject properties, including an
790         ssl_creds property
791         (soup_socket_set_flags): Gone (replaced with boolean properties)
792         (soup_socket_new): Make this take a list of properties
793         (listen_watch): copy ssl creds from listener to new socket
794         (soup_socket_start_ssl): Pass remote hostname and socket creds
795         structure to soup_ssl_wrap_iochannel.
796         (soup_socket_client_new_async, soup_socket_client_new_sync,
797         soup_socket_server_new): Replace the SSL boolean with an ssl_creds
798         structure.
799
800         * libsoup/soup-misc.c (soup_set_ssl_ca_file,
801         soup_set_ssl_cert_files, soup_get_ssl_ca_file,
802         soup_get_ssl_cert_files): Gone. SSL state is now per-session or
803         per-server.
804
805         * tests/get.c: add a "-c CAfile" argument, for loading a CA
806         certificate file to validate https connections against
807
808         * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile"
809         arguments for loading an SSL server certificate. Only start an SSL
810         server if those arguments were used.
811
812         * tests/test-cert.pem: 
813         * tests/test-key.pem: SSL certificate for testing simple-httpd
814
815         * tests/revserver.c: Update for API changes
816         * tests/simple-proxy.c: Likewise
817
818 2003-09-22  Dan Winship  <danw@ximian.com>
819
820         * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
821         from soup-private.h
822
823         * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
824         (soup_set_security_policy, soup_get_security_policy): Remove,
825         since the GNUTLS backend doesn't actually implement it.
826         (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
827
828         * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
829         stuff.
830
831         * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
832         soup-private.h
833
834         * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
835         soup_ssl_get_server_iochannel into a single function that takes a
836         SoupSSLType.
837
838         * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
839         (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
840         (soup_gnutls_set_security_policy): Gone
841
842         * libsoup/soup-gnutls.h
843         * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
844         soup-gnutls.c now
845
846         * libsoup/soup-socket.c: Move soup_sockaddr_max
847         #define here from soup-private.h
848         (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
849         prototype.
850
851         * libsoup/soup-private.h: Gone
852         
853         * libsoup/soup-address.c: Fix #includes for soup-private.h and
854         soup-misc.h changes
855         * libsoup/soup-auth-digest.c: Likewise
856         * libsoup/soup-auth.c: Likewise
857         * libsoup/soup-connection-ntlm.c: Likewise
858         * libsoup/soup-connection.c: Likewise
859         * libsoup/soup-dns.c: Likewise
860         * libsoup/soup-gnutls.c: Likewise
861         * libsoup/soup-headers.c: Likewise
862         * libsoup/soup-message-client-io.c: Likewise
863         * libsoup/soup-message-handlers.c: Likewise
864         * libsoup/soup-message-io.c: Likewise
865         * libsoup/soup-message-server-io.c: Likewise
866         * libsoup/soup-message.c: Likewise
867         * libsoup/soup-server-message.c: Likewise
868         * libsoup/soup-server.c: Likewise
869         * libsoup/soup-session.c: Likewise
870         * libsoup/soup-socket.c: Likewise
871         * tests/auth-test.c: Likewise
872
873 2003-09-19  Dan Winship  <danw@ximian.com>
874
875         * libsoup/soup-address.c (update_address_from_entry): free the
876         hostent.
877
878         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't leak
879         the domain
880
881         * libsoup/soup-gnutls.c (soup_gnutls_get_iochannel): Add some more
882         iochannel initialization. Not sure how this worked before...
883
884         * libsoup/soup-message.c (soup_message_cleanup_response): Renamed
885         from soup_message_prepare (and a few things removed).
886
887         * libsoup/soup-message-client-io.c (soup_message_send_request):
888         s/soup_message_prepare/soup_message_cleanup_response/
889
890         * libsoup/soup-message-io.c (io_read): Replace the final "\r\n"
891         with "\0" on the headers before passing them to the parse
892         function.
893         (io_read): Call soup_message_cleanup_response after returning an
894         informational response so the data doesn't leak.
895
896         * libsoup/soup-headers.c (soup_headers_parse): Update for
897         soup-message-io.c:io_read change
898
899         * libsoup/soup-server.c (soup_server_new,
900         soup_server_new_with_host): Don't leak the SoupAddress.
901
902         * libsoup/soup-session.c (class_init): Make PROP_PROXY_URI not
903         CONSTRUCT_ONLY.
904         (set_property): If the proxy uri changes, call
905         soup_session_abort() and cleanup_hosts().
906         (request_finished, final_finished): Fix a bug when requeuing
907         messages.
908
909         * tests/libsoup.supp: valgrind suppression file for soup tests
910
911         * tests/Makefile.am (EXTRA_DIST): dist it.
912         (noinst_PROGRAMS): move the former check_PROGRAMS to
913         noinst_PROGRAMS instead.
914
915 2003-09-18  Dan Winship  <danw@ximian.com>
916
917         * libsoup/soup-message.c: Add wrote_informational and
918         got_informational signals.
919
920         * libsoup/soup-message-client-io.c (get_request_headers): Set the
921         EXPECT_CONTINUE flag on the message if that header is set.
922
923         * libsoup/soup-message-server-io.c (parse_request_headers):
924         Likewise
925
926         * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
927         when blocking on an expect-continue. Emit wrote_informational
928         instead of wrote_headers in the 1xx case.
929         (io_read): Set read_state to BLOCKING, not NOT_STARTED after
930         reading a 100 Continue response. Emit got_informational instead of
931         got_headers in the 1xx case.
932
933         * libsoup/soup-session.c (soup_session_send_message): Reorder
934         things to deal with the fact that the message could finish right
935         away if there is a connection available and the server is very
936         close.
937
938         * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
939         SOUP_STATUS_CLASS_TRANSPORT_ERROR.
940
941 2003-09-17  Dan Winship  <danw@ximian.com>
942
943         * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
944         (one that pruned too little, one that pruned too much).
945         (queue_message): When requeuing, don't run the queue;
946         final_finished will take care of that later.
947         (soup_session_abort): New, to cancel all pending requests.
948
949         * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
950         the socket while waiting for the address to resolve
951
952 2003-09-17  Dan Winship  <danw@ximian.com>
953
954         * libsoup/soup-connection.c (soup_connection_new): Replaces the
955         three previous soup_connection_new* functions and uses gobject
956         properties to set the destination and proxy uris.
957         (class_init): set up two more signals, authenticate and
958         reauthenticate.
959         (soup_connection_send_request): virtualize
960         (send_request): Default implementation
961
962         * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
963         also handles NTLM authentication. Includes all of the NTLM code
964         formerly in soup-auth-ntlm.c.
965
966         * libsoup/soup-auth-ntlm.[ch]: Gone.
967
968         * libsoup/soup-auth.c: Remove NTLM refs
969
970         * libsoup/soup-session.c (class_init): Add gobject properties for
971         proxy, max_conns, use_ntlm. Change the "authenticate" and
972         "reauthenticate" signal prototypes to not pass a SoupAuth (so they
973         can be used for authenticating SoupConnectionNTLM as well, which
974         doesn't use a SoupAuth).
975         (soup_session_new): Renamed from soup_session_new_default.
976         (soup_session_new_with_options): Replaces
977         soup_session_new_with_proxy and soup_session_new_full. Takes
978         gobject properties.
979         (run_queue): Create a new connection of type SoupConnection or
980         SoupConnectionNTLM depending on our "use_ntlm" property. Connect
981         to its authenticate and reauthenticate signals.
982         (connection_authenticate, connection_reauthenticate): proxy these
983         signals.
984
985         * libsoup/soup-address.c (update_address_from_entry): Fix a
986         crasher when failing to resolve the address.
987
988         * libsoup/soup-dns.c (check_hostent): Fix some "how was this
989         working before" bugs.
990
991         * libsoup/soup-message-client-io.c (soup_message_send_request):
992         call soup_message_prepare() to clean up the existing response
993         state.
994
995         * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
996         when processing an OK EOF.
997
998         * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
999         these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
1000
1001         * tests/auth-test.c (authenticate, reauthenticate): Update for new
1002         prototypes.
1003         (main): Use soup_session_new.
1004         * tests/get.c (main): Likewise.
1005         * tests/simple-proxy.c (main): Likewise.
1006
1007 2003-09-10  Dan Winship  <danw@ximian.com>
1008
1009         * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
1010         signals.
1011         (invalidate_auth): Remove the call to soup_auth_invalidate.
1012         (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
1013         contain authentication, then emit "authenticate" or
1014         "reauthenticate" (depending on whether or not this is the first
1015         time we've asked for a password for this auth).
1016         (update_auth_internal): If the server rejects our
1017         username/password, don't bail out immediately. Try doing a
1018         "reauthenticate" first.
1019
1020         * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
1021
1022         * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
1023         "pref" arg.
1024         (soup_auth_invalidate): Remove this; it doesn't actually do
1025         anything useful for us.
1026
1027         * libsoup/soup-auth-basic.c (invalidate): Remove
1028         * libsoup/soup-auth-digest.c: (invalidate): Remove
1029         * libsoup/soup-auth-ntlm.c: (invalidate): Remove
1030
1031         * libsoup/soup-uri.c: Remove all references to "authmech".
1032         (soup_uri_set_auth): Remove this too.
1033
1034         * tests/auth-test.c: Update to use the "authenticate" and
1035         "reauthenticate" signals instead of encoding usernames and
1036         passwords in the URIs. Add a few more test cases.
1037
1038 2003-09-10  Dan Winship  <danw@ximian.com>
1039
1040         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
1041         "status" field from here, since it's mostly used by SoupSession,
1042         which shouldn't need access to SoupMessagePrivate.
1043
1044         * libsoup/soup-message.h (SoupMessage): Move it here.
1045         (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
1046         (soup_message_set_uri): also moved from soup-message-private.h
1047
1048         * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
1049
1050         * libsoup/soup-message-handlers.c:
1051         s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
1052
1053         * libsoup/soup-message-io.c (soup_message_io_client,
1054         soup_message_io_server, soup_message_io_unpause): Don't set up an
1055         idle handler, just jump right in to reading/writing; if this is a
1056         synchronous socket, then the caller wants to block, and if it's
1057         not, then we'll quickly get an EAGAIN anyway.
1058
1059         * libsoup/soup-session.c: (queue_message): Likewise.
1060         (*) Update for SoupMessageStatus move and remove
1061         soup-message-private.h include.
1062
1063         * libsoup/soup-server-message.c: Remove soup-message-private.h
1064         include.
1065
1066         * libsoup/soup-server.c: Likewise.
1067
1068         * libsoup/soup-connection.c (soup_connection_is_connected,
1069         soup_connection_is_new): Remove these, since they weren't being
1070         used.
1071
1072         * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
1073         avoid namespace pollution.
1074
1075         * libsoup/soup-auth-digest.c: Update for that.
1076         * libsoup/soup-server-auth.c: Likewise
1077
1078         * tests/auth-test.c: Remove soup-message-private.h include
1079
1080 2003-09-09  Dan Winship  <danw@ximian.com>
1081
1082         Beginnings of improved synchronous API support
1083
1084         * libsoup/soup-dns.c: Simplify this by making it not automatically
1085         return the result: force the caller to poll. (This isn't really a
1086         performance issue: the results should come back quickly anyway.)
1087         Also, make the cache thread-safe.
1088         (soup_dns_entry_from_name): Was soup_gethostbyname
1089         (soup_dns_entry_from_addr): Was soup_gethostbyaddr
1090         (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
1091         (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
1092         blocks if it's not resolved yet).
1093
1094         * libsoup/soup-address.c: Update for soup-dns changes.
1095         (soup_address_new): Don't automatically start resolving the
1096         hostname now, since we don't know if the caller is going to want
1097         it resolved synchronously or asynchronously.
1098         (soup_address_resolve_async): Renamed from soup_address_resolve.
1099         (soup_address_resolve_sync): New routine to do blocking
1100         synchronous DNS.
1101
1102         * libsoup/soup-socket.c (soup_socket_connect): Now returns a
1103         status value directly when connecting synchronously.
1104         (soup_socket_client_new_async, soup_socket_client_new_sync):
1105         Separate async/sync client socket functions.
1106         (soup_socket_get_iochannel): Made static since it was not used
1107         outside soup-socket.
1108
1109         * libsoup/soup-connection.c (soup_connection_new,
1110         soup_connection_new_proxy, soup_connection_new_tunnel): Just set
1111         up the data, don't actually start connecting.
1112         (soup_connection_connect_async, soup_connection_connect_sync): New
1113         async and sync SoupConnection connecting routines.
1114         (soup_connection_get_socket): Remove this since it wasn't being
1115         used.
1116
1117         * libsoup/soup-session.c (final_finished): Run the queue since a
1118         connection is now freed up.
1119         (run_queue): Update for soup_connection_new* changes.
1120
1121         * libsoup/soup-misc.c (soup_substring_index): Remove, since it
1122         wasn't being used any more.
1123
1124         * libsoup/soup-private.h: Remove some prototypes for functions
1125         that no longer exist.
1126
1127         * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
1128         (copies the protocol, host, and port of a SoupUri).
1129
1130         * tests/auth-test.c:
1131         * tests/get.c:
1132         * tests/simple-proxy.c: belatedly update for soup-session change
1133
1134         * tests/revserver.c: Handle each new connection in its own thread,
1135         using synchronous SoupSocket calls.
1136
1137 2003-09-05  Dan Winship  <danw@ximian.com>
1138
1139         * libsoup/soup-session.c: Move a bunch of logic here from
1140         soup-context. Now the session keeps track of hosts (instead of
1141         having a global soup_hosts hash) and their connections.
1142         (soup_session_new_with_proxy, soup_session_new_full): New session
1143         constructors to specify a proxy or a proxy and connection limits
1144         (send_request): Add Authorization and Proxy-Authorization headers
1145         before sending off the request.
1146         (soup_session_queue_message, et al): Improve the way this works.
1147         There's no need to use timeouts to wait for connections to become
1148         free; we *know* when they become free.
1149
1150         * libsoup/soup-private.h: Remove SoupHost and some other
1151         no-longer-used stuff.
1152
1153         * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
1154         soup_set_connection_limit, soup_set_connection_limit): Gone. These
1155         are all per-session now.
1156
1157         * libsoup/soup-message.c: Remove all SoupContext references
1158         (mostly replaced with SoupUri references)
1159         (cleanup_message): priv->connect_tag and priv->connection are gone
1160         now, so this was just soup_message_io_cancel(). So remove
1161         cleanup_message and replace it with that everywhere.
1162         (soup_message_disconnect): Gone.
1163         (soup_message_set_uri): Replaces soup_message_set_context.
1164         (soup_message_set_connection, soup_message_get_connection): Gone
1165
1166         * libsoup/soup-message-server-io.c (parse_request_headers):
1167         s/soup_message_set_context/soup_message_set_uri/
1168
1169         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
1170         connect_tag, context, and connection.
1171
1172         * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
1173
1174         * libsoup/soup-context.c: Gone
1175
1176         * tests/auth-test.c (identify_auth): update for session/context
1177         changes
1178
1179 2003-09-03  Dan Winship  <danw@ximian.com>
1180
1181         * libsoup/soup-status.h: Renamed from soup-error.h, with types
1182         and defines renamed accordingly.
1183
1184         * libsoup/soup-message.h (SoupMessage): Rename errorcode to
1185         status_code and errorphrase to reason_phrase. Remove errorclass.
1186         (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
1187         as being either "errors" or "not errors", so its semantics are
1188         guaranteed to be wrong sometimes.
1189
1190         * libsoup/soup-message.c (soup_message_set_status,
1191         soup_message_set_status_full): Renamed
1192
1193         * libsoup/soup-message-handlers.c
1194         (soup_message_add_status_code_handler,
1195         soup_message_add_status_class_handler): Rename.
1196
1197         * libsoup/soup-session.c (soup_session_send_message): Make this
1198         return a status code rather than a status class.
1199
1200         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
1201         unrelated unused fields (retries, callback, user_data).
1202
1203         * ...: Updates
1204
1205 2003-09-02  Dan Winship  <danw@ximian.com>
1206
1207         * libsoup/soup-session.c: First draft at the new object to
1208         maintain formerly-global state. (Not yet complete; still need to
1209         get rid of SoupContext).
1210
1211         * libsoup/soup-message-queue.c: Data structure used by SoupSession
1212
1213         * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
1214         some bits went into soup-connection.
1215
1216         * libsoup/soup-connection.c (soup_connection_send_request): New,
1217         to send a request on a connection. The connection updates its
1218         internal state and then hands off to soup_message_send_request.
1219         (request_done): Callback set up by soup_connection_send_request.
1220         Marks the connection as no-longer-in-use, and disconnects it if
1221         the message says to.
1222         (soup_connection_set_in_use, soup_connection_mark_old): No longer
1223         needed; the connection takes care of this itself now.
1224         (soup_connection_new_proxy): New, to create a new connection that
1225         is explicitly marked as being through an HTTP proxy.
1226         (soup_connection_new_tunnel): New, to create a new HTTPS
1227         connection through a proxy. (Includes the code to send the
1228         CONNECT.)
1229
1230         * libsoup/soup-context.c (try_existing_connections): Don't need to
1231         call soup_connection_set_in_use.
1232         (try_create_connection): Use soup_connection_new,
1233         soup_connection_new_proxy, or soup_connection_new_tunnel as
1234         appropriate.
1235
1236         * libsoup/soup-message.c (soup_message_prepare): Replaces
1237         queue_message.
1238         (soup_message_queue, soup_message_requeue, soup_message_prepare):
1239         Gone. This must be done via a SoupSession now.
1240         (soup_message_set_connection): don't need to mark in_use/not
1241         in_use. Also, msg->priv->socket is gone now.
1242         (soup_message_get_socket): Gone.
1243
1244         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
1245         Remove references to global handlers.
1246         (redirect_handler, authorize_handler): Moved to soup-session.c.
1247
1248         * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
1249         session to shut down now.
1250
1251         * libsoup/soup.h: add soup-session.h
1252
1253         * libsoup/Makefile.am: updates
1254
1255         * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
1256         SoupSession.
1257
1258 2003-08-29  Dan Winship  <danw@ximian.com>
1259
1260         * libsoup/soup-message-io.c: Major rewrite. There is now only a
1261         single IO state object (instead of one for reading and one for
1262         writing), and the IO code handles switching back and forth between
1263         reading and writing as appropriate (including handling the extra
1264         switches needed for "Expect: 100-continue").
1265         (soup_message_io_client, soup_message_io_server): The new entry
1266         points.
1267         (soup_message_io_cancel): If the caller cancels the IO when we
1268         were expecting to read more data, disconnect the socket.
1269
1270         * libsoup/soup-message.h (SoupMessageFlags): add
1271         SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
1272         do the special expect-continue handling.
1273
1274         * libsoup/soup-message.c: Move all the signal stuff here. Remove
1275         the "done_reading" and "done_writing" signals and replace them
1276         with a single "finished" signal. (A single signal. Say that 10
1277         times fast!)
1278         (soup_message_got_headers, etc): Functions to emit signals.
1279         (got_headers, got_chunk, got_body): Default signal methods that
1280         call soup_message_run_handlers.
1281         (finished): Default signal method that replaces
1282         soup_message_issue_callback.
1283         ([various]): s/soup_message_issue_callback/soup_message_finished/
1284         (soup_message_requeue): There's no soup_message_set_read_callbacks
1285         any more, so if the caller requeues while it's still reading, just
1286         cancel the read.
1287         (soup_message_add_chunk, soup_message_add_final_chunk,
1288         soup_message_pop_chunk): Moved here from soup-server-message,
1289         although we don't actually quite support using chunked encoding
1290         for requests yet.
1291
1292         * libsoup/soup-server-message.c (soup_server_message_new): No
1293         longer takes a socket argument.
1294         (soup_server_message_add_chunk, soup_server_message_get_chunk):
1295         Moved into SoupMessage.
1296
1297         * libsoup/soup-message-handlers.c (global_handlers): Make these
1298         POST_BODY rather than PRE_BODY, so they won't mess up the IO
1299         channel when the requeue the message.
1300         (soup_message_run_handlers): Don't need to issue the message
1301         callback from here any more.
1302         (authorize_handler): Just leave the error as 401 or 407 (see
1303         soup-error.h change)
1304
1305         * libsoup/soup-message-client-io.c (soup_message_send_request):
1306         Replaces soup_message_write_request and
1307         soup_message_read_response.
1308
1309         * libsoup/soup-message-server-io.c: Parallel to
1310         soup-message-client-io.c, this defines the server-side header
1311         handling.
1312         (soup_message_read_request): Its entry point.
1313
1314         * libsoup/soup-server.c: Lots of code moved into
1315         soup-message-server-io.c. Update for other changes.
1316
1317         * libsoup/soup-queue.c: Update for changes
1318
1319         * libsoup/soup-socket.c (read_from_network, soup_socket_write):
1320         Don't call soup_socket_disconnect() on an error, just return
1321         SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
1322         signals that will mess up the caller of the read/write function.
1323
1324         * libsoup/soup-connection.c (soup_connection_disconnect): When
1325         disconnecting the socket, disconnect from its signals first to
1326         prevent bad reentrancy.
1327
1328         * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
1329         SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
1330         anything that SOUP_ERROR_UNATHORIZED and
1331         SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
1332         "transport" errors actually are transport-related.)
1333
1334         * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
1335
1336         * tests/simple-proxy.c: Complicate this a bunch. In particular,
1337         use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
1338         pass the data back to the client in chunked format.
1339
1340 2003-08-27  Dan Winship  <danw@ximian.com>
1341
1342         * libsoup/soup-types.h: New header with typedefs, to avoid
1343         #include loops among other headers.
1344
1345         * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
1346
1347         * libsoup/*.[ch], tests/*.c: Update for soup-types.h
1348         
1349 2003-08-26  Dan Winship  <danw@ximian.com>
1350
1351         * libsoup/soup-message-client-io.c (soup_message_write_request,
1352         soup_message_read_response): Higher-than-soup-message-io-level
1353         functions to do client-side IO. (Code that used to be in
1354         soup-queue.c)
1355         (get_request_header_cb): Fix a bug in the generation of the Host:
1356         header; need to include the port number if it's not the default.
1357
1358         * libsoup/soup-message-io.c (soup_message_write,
1359         soup_message_write_simple): Take separate user_datas for the get_*
1360         callbacks and the done callbacks.
1361
1362         * libsoup/soup-queue.c: Update to use soup_message_write_request
1363         and soup_message_read_response.
1364
1365         * libsoup/soup-connection.c (soup_connection_new): Change the
1366         prototype to take a SoupUri and a callback.
1367
1368         * libsoup/soup-context.c (try_create_connection,
1369         soup_context_connect_cb): Update for soup_connection_new change.
1370
1371         * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
1372         for soup_message_write changes
1373
1374         * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
1375         function
1376
1377 2003-08-26  Dan Winship  <danw@ximian.com>
1378
1379         * libsoup/soup-message-private.h: Define SoupMessage signal stuff
1380         (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
1381         WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
1382
1383         * libsoup/soup-message.c (class_init): set up signals
1384         (requeue_read_finished): Update for changes.
1385
1386         * libsoup/soup-message-io.c (soup_message_read): Split out
1387         parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
1388         arg to say where to store the message body. Set up
1389         read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
1390         signal handlers.
1391         (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
1392         (read_body_chunk): emit READ_CHUNK.
1393         (issue_final_callback): Set r->body. emit READ_BODY.
1394         (failed_read): emit READ_ERROR.
1395         (soup_message_read_set_callbacks): Disconnect old signal handlers,
1396         connect new ones.
1397         (soup_message_read_cancel): Disconnect signal handlers.
1398         (soup_message_write, soup_message_write_simple): Set up
1399         wrote_body_cb and error_cb as signal handlers.
1400         (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
1401         nothing currently ever listens for them. emit WROTE_BODY when
1402         done.
1403         (failed_write): emit WRITE_ERROR
1404
1405         * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
1406         soup_queue_read_headers_cb): Split this into two unequal chunks.
1407         (read_header_cb only runs the pre-body handlers).
1408         (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
1409         prototypes.
1410         (soup_queue_write_done_cb): Update call to soup_message_read
1411
1412         * libsoup/soup-server.c (parse_headers_cb): Renamed from
1413         read_headers_cb
1414         (read_done_cb): Update prototype
1415         (start_request): Update soup_message_read call.
1416
1417 2003-08-25  Dan Winship  <danw@ximian.com>
1418
1419         * libsoup/soup-message-io.c (soup_message_read,
1420         soup_message_write, soup_message_write_simple): Add a "user_data"
1421         arg, pass it to the callbacks.
1422
1423         * libsoup/soup-message.c (soup_message_requeue,
1424         requeue_read_finished, requeue_read_error): Update for that
1425
1426         * libsoup/soup-queue.c: Likewise
1427
1428         * libsoup/soup-server.c: Likewise
1429
1430 2003-08-25  Dan Winship  <danw@ximian.com>
1431
1432         * libsoup/soup-message.c (soup_message_new): Take a uri string
1433         instead of a context. Also, swap the args (so the method comes
1434         before the URI, just like in the protocol).
1435         (soup_message_new_from_uri): Like soup_messgae_new, but takes a
1436         SoupUri instead of a string
1437         (soup_message_set_request, soup_message_set_response): Replace
1438         soup_message_new_full.
1439         (cleanup_message): Was soup_message_cleanup, but is static now.
1440         (queue_message): Do the pre-queuing message cleanup here instead
1441         of in soup_queue_message.
1442         (soup_message_queue): Set the callback and user_data, then call
1443         queue_message.
1444         (requeue_read_error, requeue_read_finished, soup_message_requeue):
1445         Use queue_message
1446         (soup_message_get_uri): Replaces soup_message_get_context.
1447
1448         * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
1449         part of SoupMessagePrivate now)
1450
1451         * libsoup/soup-context.c: #include soup-message-private
1452         (soup_context_from_uri): constify the uri arg.
1453
1454         * libsoup/soup-queue.c: Various context/uri fixes
1455         (proxy_https_connect): Use soup_message_new_from_uri.
1456         (soup_queue_message): Drastically simplified since most of the
1457         work is in soup-messsage.c:queue_message() now
1458
1459         * libsoup/soup-auth-digest.c (compute_response,
1460         get_authorization): Use soup_message_get_uri.
1461
1462         * libsoup/soup-server-auth.c (parse_digest): Likewise
1463
1464         * libsoup/soup-server.c (call_handler): Likewise
1465
1466         * tests/simple-httpd.c (server_callback): Likewise.
1467
1468         * tests/simple-proxy.c (server_callback): Likewise
1469
1470         * tests/get.c (got_url): Likewise.
1471         (get_url): Update soup_message_new usage.
1472
1473         * tests/auth-test.c: #include soup-message-private. Update for
1474         context changes and soup_message_new change.
1475
1476 2003-08-22  Dan Winship  <danw@ximian.com>
1477
1478         * libsoup/soup-message-private.h: New file containing
1479         SoupMessagePrivate and some other soup-message-internal
1480         types/functions. Also includes the new, expanded SoupMessageStatus
1481         enum.
1482
1483         * libsoup/soup-message-io.c: Replaces what used to be in
1484         soup-transfer, but now all the interfaces take SoupMessages
1485         instead of SoupReader/SoupWriter and deal with maintaining
1486         msg->priv->{read,write}_state themselves. Fixes up all the
1487         refcounting madness.
1488
1489         * libsoup/soup-message-handlers.c: Move the handler code here,
1490         mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
1491         to make the distinction from SoupHandlerKind clearer.)
1492
1493         * libsoup/soup-message.c: Update for soup-message-io and new
1494         SoupMessageStatus values. Remove handler code.
1495         (soup_message_cleanup): Remove the hack to try to preserve the
1496         connection if the message gets cleaned up before it finishes
1497         reading. soup_message_requeue handles this in the requeuing case,
1498         and there's no especially compelling reason to bother doing it in
1499         any other case. (And the soup-message-io api doesn't support
1500         having a read operation that's not connected to any message.)
1501
1502         * libsoup/soup-private.h: remove SoupMessagePrivate
1503
1504         * libsoup/soup-queue.c: Update for soup-message-io and new
1505         SoupMessageStatus values.
1506
1507         * libsoup/soup-server-message.c: Likewise
1508
1509         * libsoup/soup-server.c: Likewise
1510
1511         * libsoup/soup-transfer.c: Gone (yay)
1512
1513         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
1514
1515 2003-08-20  Dan Winship  <danw@ximian.com>
1516
1517         * libsoup/soup-message.c: Make this a GObject. (Note that since
1518         SoupMessage was not refcounted before, it's not really refcounted
1519         now either. TBF)
1520         (soup_message_free): Gone, replaced by g_object_unref
1521         (soup_message_copy, soup_message_foreach_remove_header): Remove
1522         these, since neither was currently functional.
1523         (soup_message_is_keepalive): New utility function to look at
1524         HTTP version and request/response headers to decide if a message
1525         indicates the connection should be kept alive.
1526         (soup_message_set_connection, soup_message_get_connection): New
1527         (soup_message_get_socket): New
1528
1529         * libsoup/soup-server-message.c: Make this a subclass of
1530         SoupMessage.
1531         (soup_server_message_new): Now takes a SoupServer and SoupSocket
1532         (soup_server_message_get_server): New
1533         (soup_server_message_set_encoding,
1534         soup_server_message_get_encoding): Get/set whether the message
1535         should be sent with content-length or chunked encoding
1536         (soup_server_message_is_started, soup_server_message_is_finished):
1537         Private member accessors.
1538         (soup_server_message_add_chunk): Renamed from add_data
1539         (soup_server_message_get_chunk): Pops a chunk from the list.
1540         (soup_server_message_get_source): Gone
1541
1542         * libsoup/soup-server.c: Update for SoupServerMessage changes.
1543         (error_cb, write_done_cb): All the cleanup stuff that used to be
1544         here happens automatically by unreffing the message now.
1545         (get_response_header): Remove some erroneous leftover CGI stuff
1546         (issue_bad_request): add "Connection: close" to the response.
1547         (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
1548         with no Host header as per RFC 2616.
1549
1550         * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
1551         (soup_connection_set_in_use): Let the caller set the connection to
1552         "not in use" even after the socket has been disconnected.
1553
1554         * libsoup/soup-context.c: Use soup_message_get_connection
1555
1556         * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
1557         check on request length, since it was rejecting
1558         "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
1559
1560         * libsoup/soup-queue.c: Use soup_message_get_connection and
1561         soup_message_get_socket.
1562         (soup_queue_read_done_cb): Use soup_message_is_keepalive
1563         (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
1564         soup_connection_start_ssl
1565
1566         * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
1567         handlers if the socket hasn't been disconnected yet.
1568
1569         * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
1570         reader_read): Fix these so that reader_read will exit properly if
1571         the read is cancelled.
1572
1573         * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
1574
1575         * tests/simple-httpd.c (server_callback): set the message to
1576         content-length encoding.
1577         * tests/simple-proxy.c (server_callback): Likewise
1578
1579 2003-08-19  Dan Winship  <danw@ximian.com>
1580
1581         * libsoup/soup-socket.c (soup_socket_read,
1582         soup_socket_read_until, soup_socket_write): New API for doing
1583         socket IO. Works both synchronously and asynchronously, and
1584         buffers data to prevent the "100 Continue" problem.
1585         (soup_socket_set_flag): Replaces formerly-private
1586         soup_set_sockopts. (primarily to let the caller turn off
1587         SOUP_SOCKET_FLAG_NONBLOCKING).
1588
1589         * libsoup/soup-transfer.c (soup_transfer_read,
1590         soup_transfer_write, soup_transfer_write_simple): Take a
1591         SoupSocket instead of a GIOChannel. Use the new socket IO api.
1592         Changed the prototypes of some of the callbacks to be less
1593         hackish.
1594
1595         * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
1596         soup_connection_get_iochannel.
1597
1598         * libsoup/soup-message.c: Fix up for soup-transfer changes
1599
1600         * libsoup/soup-queue.c: Likewise
1601
1602         * libsoup/soup-server.c: Likewise
1603
1604         * tests/revserver.c: A slightly more complicated replacement for
1605         timeserver. (Does both reads and writes)
1606
1607 2003-08-19  Dan Winship  <danw@ximian.com>
1608
1609         * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
1610         configure it, and no one has complained, and it looks like the
1611         SOCKS5 auth code doesn't actually work anyway...
1612
1613         * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
1614
1615         * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
1616         SOUP_PROTOCOL_SOCKS5
1617
1618         * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
1619
1620         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
1621         soup-socks.[ch]
1622
1623 2003-08-19  Dan Winship  <danw@ximian.com>
1624
1625         * libsoup/soup-server.c: Make this a GObject. Remove
1626         SoupServerMessage code (to soup-server-message.c). Remove CGI
1627         server code (for now?)
1628         (soup_server_add_handler, soup_server_remove_handler): Rename
1629         (from register/unregister) to make it clearer what they do.
1630
1631         * libsoup/soup-server-message.c: Moved out of soup-server.c
1632
1633         * libsoup/soup-private.h: Remove SoupServer def
1634
1635         * libsoup/Makefile.am (libsoupinclude_HEADERS,
1636         libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
1637
1638         * tests/simple-httpd.c: 
1639         * tests/simple-proxy.c: Update for SoupServer changes
1640
1641 2003-08-18  Dan Winship  <danw@ximian.com>
1642
1643         * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
1644         a struct sockaddr again (like it used to be). In particular, add
1645         back the "port" field. Add a bunch of macros to try (and fail) to
1646         simplify some of the code.
1647         (soup_address_new): Now returns a SoupAddress directly rather than
1648         a random handle, and the caller can just use g_object_unref to
1649         cancel the lookup. Also, the callback now uses a
1650         SoupKnownErrorCode rather than a special-purpose address-lookup
1651         error code.
1652         (soup_address_new_cancel): No longer needed.
1653         (soup_address_new_sync): Removed
1654         (soup_address_new_any): Replaces soup_address_ipv4_any and
1655         soup_address_ipv6_any.
1656         (soup_address_get_name, etc): Gone. Use soup_address_resolve()
1657         now.
1658         (soup_address_get_physical): Renamed from
1659         soup_address_get_canonical_name.
1660         (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
1661
1662         * libsoup/soup-socket.c: Update for SoupAddress changes and make
1663         similar changes here.
1664         (soup_socket_new): Just creates a generic SoupSocket now.
1665         (soup_socket_connect): Client setup
1666         (soup_socket_listen): Server setup. Now also sets up an iochannel
1667         listening for connects and emits a "new_connection" signal as they
1668         come in.
1669         (soup_socket_start_ssl): Turns on SSL.
1670         (soup_socket_client_new, soup_socket_server_new): Utility
1671         functions that wrap the above.
1672         (soup_socket_new_cancel, soup_socket_new_sync): Gone
1673         (soup_socket_server_accept, soup_socket_server_try_accept): No
1674         longer needed.
1675         (soup_socket_get_iochannel): No longer adds a ref when returning
1676         the iochannel. Also, we set it to "close_on_unref" so that if a
1677         caller adds a ref to it, the connection will actually remain open
1678         even after the SoupSocket is destroyed.
1679         (soup_socket_get_local_address, soup_socket_get_remote_address):
1680         Let the caller get both of these.
1681
1682         * libsoup/soup-connection.c: Don't keep a private copy of the
1683         socket's iochannel.
1684         (soup_connection_new): Don't need to set socket options here.
1685         SoupSocket does it.
1686         (soup_connection_start_ssl): Just call soup_socket_start_ssl.
1687         (soup_connection_get_iochannel): Just return the socket's
1688         iochannel (and don't ref it)
1689
1690         * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
1691         SOUP_ERROR_CANT_RESOLVE_PROXY
1692
1693         * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
1694         Remove the "FIXME add a CANT_RESOLVE error" and return
1695         SOUP_ERROR_CANT_RESOLVE instead.
1696
1697         * libsoup/soup-server.c: Update for socket/address changes. Don't
1698         poke into SoupSocket's private fields.
1699         (soup_server_run_async): Just connect to the socket's
1700         "new_connection" signal.
1701
1702         * libsoup/soup-context.c (try_create_connection,
1703         soup_context_connect_cb): Update for socket changes. Replace
1704         SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
1705
1706         * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
1707         to connect to a signal handler and connect another function to
1708         clean up the first signal handler after its first invocation.
1709         (Lets us use signals to replace one-off callbacks.)
1710
1711         * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
1712         actually private now.
1713         (struct _SoupServer): Remove accept_tag.
1714
1715         * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
1716         Don't unref the iochannel.
1717         (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
1718
1719         * libsoup/soup-socks.c: Update for socket/address changes
1720
1721         * tests/simple-httpd.c (main):
1722         s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
1723         * tests/simple-proxy.c (main): Likewise
1724
1725         * tests/timeserver.c: Update for SoupSocket's "new_connection"
1726         signal, and for SoupAddress changes.
1727
1728 2003-08-14  Dan Winship  <danw@ximian.com>
1729
1730         * libsoup/soup-connection.c: New, split out from soup-context and
1731         made into a GObject.
1732         (soup_connection_disconnect): Disconnects the connection and emits
1733         a signal. (Replaces the old "keep_alive" flag.)
1734         (soup_connection_is_connected): Checks if the connection is still
1735         connected
1736         (connection_died): Just disconnect, rather than freeing the
1737         connection. This way if anyone else is still referencing it they
1738         won't end up with an invalid pointer.
1739
1740         * libsoup/soup-context.c: Make this a GObject, remove all the
1741         SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
1742         SoupContext can keep track of connection auth stuff there without
1743         SoupConnection needing to care. Various other updates.
1744
1745         * libsoup/soup-private.h: Remove SoupContext and SoupConnection
1746         definitions.
1747
1748         * libsoup/*.c, tests/get.c: Update for context/connection changes
1749
1750         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
1751         definition to deal with the fact that there's no
1752         soup_connection_get_context any more.
1753
1754         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
1755         with connection persistence here.
1756         (soup_queue_read_done_cb): Do it here instead. Disconnect the
1757         connection when appropriate.
1758         (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
1759         Reference-count the connection properly. (I think.)
1760
1761         * libsoup/soup-marshal.list: New, for SoupConnection's
1762         "disconnected" signal.
1763
1764         * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
1765
1766         * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
1767         GLIB_GENMARSHAL gets set too.
1768
1769 2003-08-14  Dan Winship  <danw@ximian.com>
1770
1771         * libsoup/soup-error.c: Fix a spelling mistake.
1772
1773         * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
1774
1775 2003-08-12  Dan Winship  <danw@ximian.com>
1776
1777         * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
1778         of the interfaces around a little bit.
1779
1780         * libsoup/soup-auth-basic.c: subclass for Basic auth
1781
1782         * libsoup/soup-auth-digest.c: subclass for Digest auth
1783
1784         * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
1785         the code from soup-ntlm.c here, and make it private.
1786
1787         * libsoup/soup-ntlm.c: gone
1788
1789         * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
1790         here, and change the signature of SoupAuthorizeFn.
1791
1792         * libsoup/soup-context.c: Use g_object_unref to free auths, use
1793         methods instead of directly access private fields.
1794
1795         * libsoup/soup-queue.c: Likewise
1796
1797         * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
1798         NTLM references. We have no plans to implement server-side NTLM
1799         auth.
1800
1801         * tests/auth-test.c (identify_auth): Update for auth api changes
1802
1803 2003-08-12  Dan Winship  <danw@ximian.com>
1804
1805         * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
1806         call
1807
1808         * libsoup/soup-address.c: Make this a GObject.
1809         (soup_address_ref, soup_address_unref): Gone.
1810         (soup_address_copy): Gone. Wasn't being used anyway.
1811
1812         * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
1813         here from soup-address.c, so that soup-address doesn't need to
1814         worry about trying to cache zero-ref addresses.
1815
1816         * libsoup/soup-socket.c: Make this a GObject. Use "guint"
1817         consistently for port numbers.
1818         (soup_socket_ref, soup_socket_unref): Gone.
1819
1820         * libsoup/soup-private.h: Change the SoupSocket definition to be
1821         SoupSocketPrivate. (Still need to keep this here since soup-server
1822         pokes around in its internals.)
1823         (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
1824
1825         * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
1826         reader/writer rather than leaking them.
1827
1828         * libsoup/*: Use GObject methods for socket/address refcounting
1829         
1830         * tests/auth-test.c (main)
1831         * tests/timeserver.c (main): Call g_type_init.
1832
1833         * tests/get.c (main): Call g_type_init.
1834         (get_url, got_url): Fix some bugs that could make -r mode get into
1835         infinite loops downloading the same files over and over. Plug some
1836         memory leaks to make this more useful for valgrinding libsoup.
1837
1838         * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
1839         handler for SIGINT so we can exit cleanly, since valgrind won't
1840         give a leak report if you don't. Plug a few memory leaks.
1841
1842         * tests/simple-proxy.c (main): Likewise 
1843
1844 2003-08-12  Dan Winship  <danw@ximian.com>
1845
1846         Pull over some new test programs from the soup-refactoring branch,
1847         along with the SoupUri changes they depend on.
1848
1849         * tests/simple-httpd.c: A really simple HTTP server, to test the
1850         server code.
1851
1852         * tests/simple-proxy.c: An even simpler HTTP proxy
1853
1854         * tests/get.c: Add "-r" flag to recursively get files (thereby
1855         testing multiple-connections-at-once code). Also good for setting
1856         up a tree to use with simple-httpd.
1857
1858         * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
1859         normal case)
1860
1861         * tests/uri-parsing.c: Regression test for the new soup-uri.c
1862
1863         * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
1864         pull in some optimizations from camel-url. Also, make SoupProtocol
1865         a GQuark so we can still compare them with ==, but we can also
1866         recognize any protocol.
1867         (soup_uri_new_with_base): New, to merge base and relative URIs
1868         (soup_uri_to_string): Update this. Change the "show_password" flag
1869         (which we always passed FALSE for) to "just_path", for places that
1870         want the path+query without the protocol, host, etc.
1871
1872         * libsoup/soup-queue.c (soup_get_request_header): Just use
1873         soup_uri_to_string to generate the request URI.
1874
1875         * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
1876         "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
1877         the URI by hand badly.
1878         * libsoup/soup-server-auth.c (parse_digest): Likewise
1879
1880         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
1881         switch() to an series of if()s since SOUP_PROTOCOL_* aren't
1882         constants any more.
1883
1884         * libsoup/soup-context.c (soup_context_uri_hash,
1885         soup_context_uri_equal): s/querystring/query/
1886
1887 2003-08-12  Dan Winship  <danw@ximian.com>
1888
1889         * configure.in: Bump API version to 2.2 and package version to
1890         2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
1891         libgnutls-config to find GNUTLS.
1892
1893         * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
1894
1895         * Makefile.am: Update for pc file rename
1896
1897         * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
1898         and libsoup-ssl-proxy stuff.
1899
1900         * libsoup/soup-ssl-proxy.c
1901         * libsoup/soup-nss.[ch]
1902         * libsoup/soup-openssl.[ch]: gone
1903
1904         * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
1905
1906         * tests/Makefile.am (get_LDADD, timeserver_LDADD,
1907         auth_test_LDADD): Update libsoup version
1908
1909 2003-08-07  Dan Winship  <danw@ximian.com>
1910
1911         * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
1912         soup_auth_invalidate): These are all really SoupContext functions,
1913         so move them to soup-context.c (and rename them appropriately).
1914         (soup_auth_get_protection_space): New method to get the
1915         "protection space" of an auth (paths where it is valid).
1916         (soup_auth_invalidate): New method to try to un-authenticate an
1917         auth (so we can keep the domain info cached even if the auth info
1918         is wrong).
1919         (basic_pspace_func): Basic protection space is all directories
1920         below the current one.
1921         (basic_invalidate_func): Clear the encoded username/password
1922         (digest_pspace_func): Digest protection space is either the whole
1923         server, or "what the domain parameter says" (though we don't deal
1924         with cross-host domains).
1925         (digest_invalidate_func): Return FALSE; bad digest auth info isn't
1926         cacheable.
1927         (digest_parse_func, digest_free): Set/free domain parameter
1928         (ntlm_pspace): NTLM protection space is always the whole server.
1929         (ntlm_invalidate): Clear the auth state.
1930         (soup_auth_new_ntlm): Make this non-static
1931         (SoupAuth): Replace the quad-state "status" field with an
1932         "authenticated" boolean.
1933         
1934         * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
1935         hash with separate "auth_realms" (path->realm) and "auths"
1936         (realm->auth) hashes. Also add a "use_ntlm" flag.
1937
1938         * libsoup/soup-context.c (soup_context_unref): Update SoupHost
1939         freeing code.
1940         (connection_free): Don't the connection's auth, just free it.
1941         (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
1942         does two-stage lookup (path->realm then realm->auth) and also
1943         deals with NTLM hacks.
1944         (soup_context_update_auth): Mostly formerly soup_auth_set_context,
1945         but also large parts of authorize_handler. Updates the auth hashes
1946         based on information from a 401 or 407 response. Does a better job
1947         than authorize_handler did of not throwing away good information.
1948         (soup_context_preauthenticate): New; fakes up auth info so that
1949         requests will end up using authentication without the server
1950         needing to return an error first.
1951         (soup_context_authenticate_auth): Moved out of authorize_handler
1952         so it can be used at request-sending time too, if we know that we
1953         need it. (That way we can avoid requeuing the request if it isn't
1954         going to be able to be authenticated.)
1955         (soup_context_invalidate_auth): Sort of like the old
1956         soup_auth_invalidate, but only destroys the auth data, while still
1957         remembering the path->realm mapping.
1958
1959         * libsoup/soup-message.c (authorize_handler): Mostly moved into
1960         soup_context_update_auth.
1961         (maybe_validate_auth): Remove this; it was only useful because of
1962         bugs elsewhere in the auth handling.
1963         
1964         * libsoup/soup-queue.c (soup_encode_http_auth): Update for
1965         soup_context_lookup_auth. If the returned auth isn't
1966         authenticated, call soup_context_authenticate_auth() on it.
1967
1968         * tests/auth-test.c: New (from soup-refactoring branch). Tests
1969         that the Basic/Digest auth code does the right thing. (TODO: find
1970         a good way to add NTLM tests too.)
1971
1972         * tests/Makefile.am (check_PROGRAMS): add auth-test
1973
1974 2003-07-29  Dan Winship  <danw@ximian.com>
1975
1976         * configure.in: 1.99.25 ("Potato and Leek Soup")
1977
1978         * libsoup/soup-message.c (requeue_read_finished,
1979         release_connection): Free the passed-in body data. Otherwise the
1980         response body ends up getting leaked on most 3xx and 4xx
1981         responses.
1982         (soup_message_cleanup): Remove a piece of code that didn't
1983         actually do anything and its associated confused comment.
1984
1985         * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
1986
1987         * libsoup/soup-context.c (connection_free): plug a non-occasional
1988         NTLM auth leak.
1989
1990 2003-06-26  Joe Shaw  <joe@ximian.com>
1991
1992         * configure.in: Version 1.99.24
1993
1994 2003-06-24  Dan Winship  <danw@ximian.com>
1995
1996         * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
1997         it, and (b) depends on lots of new things sometimes (like on RH9).
1998
1999         * libsoup/soup-openssl.c: 
2000         * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
2001         just #ifdef HAVE_OPENSSL since the header check doesn't get run in
2002         the pkgconfig case
2003
2004 2003-06-19  Dan Winship  <danw@ximian.com>
2005
2006         * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
2007         old read_tag before changing/clearing it.
2008         (soup_queue_write_done_cb): Likewise with the write_tag.
2009
2010         * libsoup/soup-transfer.c (issue_final_callback): ref the reader
2011         around the stop+callback.
2012         (soup_transfer_write_cb): Likewise.
2013
2014 2003-06-12  Dan Winship  <danw@ximian.com>
2015
2016         * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
2017         ref_count field.
2018         (soup_transfer_read, create_writer): Set initial ref_count to 2
2019         (one for soup-transfer, one for the caller).
2020         (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
2021         reader
2022         (soup_transfer_read_stop): Clears the GIOChannel callbacks and
2023         drops soup-transfer's ref.
2024         (soup_transfer_read_cancel): Now just a stop+unref
2025         (soup_transfer_write_ref, soup_transfer_write_unref,
2026         soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
2027
2028         * libsoup/soup-message.c (soup_message_cleanup): when setting up
2029         the "finish reading" callbacks, unref the reader so it will be
2030         destroyed once it's done reading.
2031         (soup_message_requeue): Likewise.
2032
2033         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
2034         prototype change (no longer returns a SoupTransferDone).
2035         (soup_queue_read_chunk_cb): Likewise.
2036
2037         * libsoup/soup-server.c (read_headers_cb): Likewise
2038
2039 2003-06-11  Dan Winship  <danw@ximian.com>
2040
2041         * libsoup/soup-transfer.c: Change all functions to take a
2042         SoupReader * or SoupWriter * instead of a guint.
2043
2044         * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
2045         write_tag pointers instead of guints.
2046
2047 2003-06-02  Chris Toshok  <toshok@ximian.com>
2048
2049         * libsoup/soup-ssl.c: remove #include for soup-nss.h
2050
2051 2003-06-02  Chris Toshok  <toshok@ximian.com>
2052
2053         * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
2054         (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
2055         (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
2056
2057 2003-06-02  Chris Toshok  <toshok@ximian.com>
2058
2059         * configure.in: Bump version to 1.99.23.
2060
2061 2003-05-30  Chris Toshok  <toshok@ximian.com>
2062
2063         * libsoup/soup-queue.c (soup_queue_error_cb): always force a
2064         reconnect when there's an error with ssl connection.  This fixes
2065         #43387, but it runs the risk of sending requests multiple times to
2066         the exchange server, and it results in lots of shorter lived
2067         connections and more forking (in the ssl proxy case), depending on
2068         the length of the operation.
2069
2070 2003-05-21  Dan Winship  <danw@ximian.com>
2071
2072         * configure.in: 1.99.22 (codename: French Onion Soup)
2073
2074 2003-05-20  Dan Winship  <danw@ximian.com>
2075
2076         * libsoup/soup-message.c (soup_message_requeue): Clear the
2077         write_tag as well so we don't double-cancel it. #43395.
2078
2079         * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
2080         be destroyed by the end of the func, so we have to call
2081         soup_connection_set_used at the beginning.
2082
2083         * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
2084         Call g_set_error() so that we don't SEGV immediately after
2085         returning G_IO_STATUS_ERROR.
2086
2087 2003-05-08  Joe Shaw  <joe@ximian.com>
2088
2089         * configure.in: Bump version to 1.99.21
2090
2091         * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
2092         tunnelling fails, the other message which shares our same
2093         connection will free it first, so set ours to NULL.
2094
2095 2003-05-08  Dan Winship  <danw@ximian.com>
2096
2097         * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
2098         return an NTLM request string. Otherwise return the "response"
2099         field (which should include the NTLM authenticate message)
2100         (ntlm_init): Don't bother setting "response" to the NTLM request
2101         string. Just leave it NULL in that case.
2102
2103         * libsoup/soup-message.c (authorize_handler): Never try to reuse
2104         an NTLM auth returned from soup_auth_lookup. Only set the auth on
2105         the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
2106         call soup_auth_set_context() on it just like for non-NTLM auth.
2107         The net effect of all of this is that now we record when a context
2108         needs NTLM auth just like with non-NTLM auth, so that that info
2109         gets preserved across connections.
2110         (soup_message_requeue): No longer need the hackery here to
2111         preserve the connection auth state.
2112
2113 2003-05-07  Dan Winship  <danw@ximian.com>
2114
2115         * libsoup/soup-context.c (soup_connection_set_in_use): New, to
2116         toggle the connection's in_use flag, and set up the death watch
2117         when it's not in use.
2118         (connection_death): This is only hooked up when the connection is
2119         not in use now, so don't need to check that. Should fix the
2120         infinite connection_death loop.
2121         (soup_connection_is_new): Keep a distinct "new" flag rather than
2122         defining "new" as "has been released at least once".
2123         (soup_connection_set_used): Mark a connection no-longer new.
2124         (soup_context_connect_cb): Mark the connection as new. Don't set
2125         up the death watch since it's in_use.
2126         (try_existing_connections): Use soup_connection_set_in_use.
2127         (soup_connection_release): Likewise
2128
2129         * libsoup/soup-message.c (requeue_read_finished): Call
2130         soup_connection_set_used so that the connection isn't still
2131         considered new when we send the message the second time.
2132
2133         * libsoup/soup-queue.c (soup_queue_error_cb): Call
2134         soup_connection_set_used (assuming we don't close the connection)
2135         (soup_queue_read_done_cb): Likewise.
2136
2137         * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
2138         nothing, call soup_transfer_read_error_cb rather than just
2139         cancelling, or else it will get cancelled again later.
2140
2141 2003-05-07  Dan Winship  <danw@ximian.com>
2142
2143         * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
2144         library doesn't depend on them, only the proxy does. #42473
2145
2146 2003-05-06  Dan Winship  <danw@ximian.com>
2147
2148         * src/libsoup/soup-message.c (global_handlers): Change the
2149         redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
2150         SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
2151         for "Location" to get around the non-64-bit-clean union
2152         initialization pointed out by Jeremy Katz <katzj@redhat.com>.
2153         (redirect_handler): Update for that.
2154
2155 2003-04-28  Dan Winship  <danw@ximian.com>
2156
2157         * configure.in: 1.99.20
2158
2159         * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
2160         we always call UNIGNORE_CANCEL. Might fix #41971
2161
2162 2003-04-25  Dan Winship  <danw@ximian.com>
2163
2164         * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
2165         suddenly gets an io error while reading or writing, assume it's a
2166         timeout or something, close the connection, and requeue the
2167         message.
2168
2169 2003-04-23  Dan Winship  <danw@ximian.com>
2170
2171         * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
2172         soup-transfer callbacks to keep reading off the connection unless
2173         we're actually going to keep the connection around afterward.
2174         Otherwise we can just close it.
2175
2176         * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
2177         thingy so that it's possible to cancel a read from inside a
2178         callback so that the above change actually works instead of just
2179         crashing.
2180
2181 2003-04-20  Rodney Dawes  <dobey@ximian.com>
2182
2183         * configure.in: Up version to 1.99.18
2184         * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
2185         
2186 2003-04-11  Dan Winship  <danw@ximian.com>
2187
2188         * libsoup/soup-context.c (soup_connection_purge_idle): New
2189         function to close all idle connections. (Needed for #41117 or else
2190         there's no way to force-discard NTLM authentication.)
2191
2192         * libsoup/soup-queue.c (soup_queue_shutdown): Use it
2193
2194 2003-04-10  Joe Shaw  <joe@ximian.com>
2195
2196         * libsoup/soup-queue.c (proxy_https_connect):
2197         proxy_https_connect_cb() might not get called if connecting to the
2198         proxy fails, and it causes us to double-free the connection.
2199         Always set the message's connection to NULL before freeing it.
2200
2201 2003-04-09  Dan Winship  <danw@ximian.com>
2202
2203         * configure.in: 1.99.17
2204
2205 2003-04-07  Dan Winship  <danw@ximian.com>
2206
2207         * libsoup/soup-context.c (connection_death): Revert Joe's changes.
2208         We can't release the connection there because there may be
2209         SoupMessages still pointing to it. (Needs to be revisited.)
2210
2211 2003-04-03  JP Rosevear  <jpr@ximian.com>
2212
2213         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
2214         error during waitpid
2215
2216         * libsoup/soup-address.c: ditto
2217
2218 2003-04-02  Joe Shaw  <joe@ximian.com>
2219
2220         * libsoup/soup-context.c (connection_death): Only drop the
2221         connection if we get an error condition on the channel.  Fixes a
2222         double-free.
2223
2224 2003-04-02  Joe Shaw  <joe@ximian.com>
2225
2226         * libsoup/soup-context.c (connection_death): Just call
2227         soup_connection_release() from here and return whether the
2228         connection is in use.
2229
2230 2003-03-31  Ian Peters  <itp@ximian.com>
2231
2232         * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
2233         case of EAGAIN or EINTR, since shutting down an SSL connection
2234         requires more than just closing a socket.
2235
2236 2003-03-28  Dan Winship  <danw@ximian.com>
2237
2238         * libsoup/soup-message.c (soup_message_set_context): If the new
2239         context points to a different server from the old context, call
2240         soup_message_cleanup. Otherwise it tries to reuse the old
2241         connection...
2242
2243 2003-03-25  Joe Shaw  <joe@ximian.com>
2244
2245         * configure.in: Bump up to 1.99.16
2246
2247 2003-03-24  Joe Shaw  <joe@ximian.com>
2248
2249         * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
2250         slightly better error message on various SSL failures than the
2251         previous message.
2252
2253         * soup-queue.c (soup_queue_error_cb): Throw the
2254         SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
2255
2256 2003-03-21  Joe Shaw  <joe@ximian.com>
2257
2258         * soup-server.c: Use non-deprecated g_main_loop_* calls
2259         throughout.
2260         (soup_server_unref): Don't unref the main loop if it's NULL.
2261         Fixes a glib warning.
2262
2263 2003-03-18  Dan Winship  <danw@ximian.com>
2264
2265         * configure.in: comment out NSS checks. The NSS code doesn't work
2266         and there are no current plans to fix it.
2267
2268         * README (Features): Mention GnuTLS, remove NSS and the rest of
2269         the "Planned Features" section.
2270
2271         * MAINTAINERS: remove Alex
2272
2273         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
2274         timeout to 10 seconds (and get rid of the 3 tries) so we don't
2275         fail to connect just because the server is slow/far away.
2276
2277 2003-03-17  Joe Shaw  <joe@ximian.com>
2278
2279         * configure.in: Bump up to 1.99.15.
2280
2281 2003-03-12  Ian Peters  <itp@ximian.com>
2282
2283         * libsoup/soup-gnutls.c: because creating client credentials is
2284         expensive, keep the same one around as long as possible, only
2285         recreating it if the ssl_ca_file changes.  Wrap
2286         gnutls_certificate_credentials in a refcounted struct to avoid
2287         freeing it while another established connection may potentially
2288         need it (say, to rehandshake).
2289
2290 2003-03-11  Frank Belew  <frb@ximian.com>
2291
2292         * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't 
2293         use pkgconfig
2294
2295 2003-03-10  Joe Shaw  <joe@ximian.com>
2296
2297         * configure.in: Bump up to 1.99.14.
2298
2299         * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
2300         libsoup/soup-ssl.c: Add support for GnuTLS.  Patch from Ian
2301         Peters.
2302
2303 2003-03-07  Joe Shaw  <joe@ximian.com>
2304
2305         * configure.in: Bump up to 1.99.13.
2306
2307         * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
2308         the list of conditions to watch.  If the remote end hangs up the
2309         connection, we'll get a successful read of 0 bytes, not a HUP.
2310         The connection will have to be released by the point we check for
2311         it in connection_death().
2312
2313         * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
2314         (apparently) errant resetting of the read and write tags.  I think
2315         this might have been causing some reentrancy and crashes.
2316
2317         * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
2318         channel to NULL encoding and not buffered.
2319
2320         * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
2321         incorrect comments.
2322
2323 2003-02-28  Joe Shaw  <joe@ximian.com>
2324
2325         * configure.in: Bump up to 1.99.12.
2326
2327         * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
2328         header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
2329         this case we probably don't want to call the error callback, we
2330         just want to act like our transfer was cancelled.
2331
2332 2003-02-27  Joe Shaw  <joe@ximian.com>
2333
2334         Try to apply some order to the iochannel refcounting...
2335
2336         * configure.in: Bump up to 1.99.11.
2337
2338         * libsoup/soup-context.c (soup_connection_get_iochannel): The
2339         connections needs to own a reference to the iochannel!  If we're
2340         using HTTPS, release the ref we get from soup_socket_get_iochannel
2341         and replace it with the ref we get from soup_ssl_get_iochannel().
2342         Then, always ref the channel that we return (ugh, but that's the
2343         soup way).
2344         (connection_free): Release the connection's ref to the iochannel.
2345
2346         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
2347         iochannel. The reference we pass back will be owned by the
2348         connection.
2349         (soup_ssl_hup_waitpid): Release our ref.
2350
2351 2003-02-27  Joe Shaw  <joe@ximian.com>
2352
2353         * configure.in: Bump up to 1.99.10.
2354
2355         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
2356         iochannel, return to the status quo.  Sigh.
2357
2358 2003-02-26  Joe Shaw  <joe@ximian.com>
2359
2360         * configure.in: Bump up to 1.99.9.
2361
2362         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
2363         it's causing problems with HTTPS and proxies; the iochannel
2364         refcounting is waaaaaay horked.
2365
2366 2003-02-26  Frank Belew  <frb@ximian.com>
2367
2368         * libsoup/Makefile.am: added workaround to link ssl-proxy statically
2369
2370 2003-02-11  Joe Shaw  <joe@ximian.com>
2371
2372         * configure.in: Bump up to 1.99.8 for snaps.
2373
2374         * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
2375         It returns the address to the resulting hostent or NULL on failure,
2376         unlike Linux which returns an error code.
2377
2378 2003-02-11  Joe Shaw  <joe@ximian.com>
2379
2380         * configure.in: Bump up to 1.99.7 for snaps.
2381
2382         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
2383         the error string from OpenSSL if we can't establish a connection.
2384
2385 2003-02-04  Joe Shaw  <joe@ximian.com>
2386
2387         * configure.in: Bump up to 1.99.6 for snaps.
2388
2389         * libsoup/soup-server.c (destroy_message): We already assigned
2390         chan, so don't reassign it, and unref it in all cases.
2391         (issue_bad_request): Always unref after a call to
2392         soup_socket_get_iochannel(), because it refs it.
2393         (conn_accept): Fix some funky GIOChannel reffing here.
2394
2395         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
2396         g_io_channel_ref() on the socket.  This is the exact opposite of
2397         what we want to do.  Create a temporary structure containing the
2398         parent pid and the old socket and unref the socket when our
2399         callback is called.  This should fix GIOChannels being leaked on
2400         SSL connections.
2401
2402         * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
2403         main loop quits.
2404
2405 2003-01-22  Joe Shaw  <joe@ximian.com>
2406
2407         * configure.in: Bump up to 1.99.5 for the snaps.
2408
2409         * libsoup/soup-address.c (soup_address_new): If we found the
2410         address in our hash, we need to return NULL or else Soup will
2411         think we're doing an async lookup and do some cancellation on
2412         us.  Besides, we were returning the wrong type anyway and it
2413         was crashing things.
2414
2415 2003-01-17  Joe Shaw  <joe@ximian.com>
2416
2417         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
2418         uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
2419         out, so keep trying until we succeed.
2420
2421 2003-01-10  Joe Shaw  <joe@ximian.com>
2422
2423         * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
2424         strings and print out the error when the cert can't verify.
2425
2426 2003-01-09  Dan Winship  <danw@ximian.com>
2427
2428         * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
2429         overrun noticed by valgrind
2430
2431 2002-12-20  Joe Shaw  <joe@ximian.com>
2432
2433         * libsoup/soup-server.c (soup_server_new_with_host): Added.
2434         Starts a server only on the interface specified, instead of all
2435         network interfaces.
2436
2437 2002-12-16  Jeremy Katz  <katzj@redhat.com>
2438
2439         * configure.in: use $libdir instead of /usr/lib when looking for
2440         libraries
2441
2442 2002-12-11  Joe Shaw  <joe@ximian.com>
2443
2444         * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
2445         Don't set a variable to NULL and then immediately try to
2446         dereference it.
2447
2448 2002-12-09  Joe Shaw  <joe@ximian.com>
2449
2450         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
2451         timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
2452         we don't hang forever if we don't get more data.
2453
2454         * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
2455         or else we'll hang forever in SSL_connect() if the other side
2456         hangs up.
2457
2458         * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
2459         release the connection on message free, even if the connection was
2460         unsuccessful.
2461
2462 2002-12-03  Joe Shaw  <joe@ximian.com>
2463
2464         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
2465         g_io_channel_set_close_on_unref() on the second half of the socket
2466         pair so we don't leak file descriptors.
2467
2468 2002-12-03  Frank Belew  <frb@ximian.com>
2469
2470         * libsoup/soup-address.c: add signal.h to the list of headers to 
2471         pick up SIGKILL
2472         
2473 2002-11-25  Joe Shaw  <joe@ximian.com>
2474
2475         * Makefile.am: Build the tests directory again
2476
2477 2002-11-21  Rodney Dawes  <dobey@ximian.com>
2478
2479         * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
2480         
2481 2002-11-20  Michael Meeks  <michael@ximian.com>
2482
2483         * configure.in: require autoconf 2.52 not 2.53.
2484
2485 2002-11-18  Dan Winship  <danw@ximian.com>
2486
2487         * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
2488         since it's apparently non-portable. Use s6_addr instead.
2489         (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
2490
2491         * libsoup/soup-error.c: Fix spelling of
2492         SOUP_ERROR_MOVED_PERMANENTLY and its description.
2493
2494         * libsoup/soup-message.c (soup_message_get_request_header, etc):
2495         Remove long-deprecated API.
2496
2497         * libsoup/soup-socket.c (soup_socket_connect): remove unused
2498         variable.
2499
2500         * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
2501         * libsoup/soup-server.c (cgi_read): Likewise
2502         * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
2503         Likewise.
2504         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
2505         * libsoup/soup-transfer.c (soup_transfer_read_cb,
2506         soup_transfer_write_cb): Likewise.
2507
2508         * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
2509         instead of IPv4. (Tested on OS X.)
2510
2511 2002-11-15  Dan Winship  <danw@ximian.com>
2512
2513         * libsoup/*: Change old Helix Code refs to Ximian (and update
2514         copyright dates).
2515
2516 2002-11-15  Frank Belew  <frb@ximian.com>
2517
2518         * tests/Makefile.am: uncomment lines to make timeserver build 
2519         correctly
2520         
2521 2002-11-14  Joe Shaw  <joe@ximian.com>
2522
2523         * libsoup/soup-address.c (soup_address_new): When we get an
2524         address from the hash, call our address lookup callback or else
2525         the connection will hang.
2526
2527 2002-11-13  Dan Winship  <danw@ximian.com>
2528
2529         * tests/timeserver.c: Oops, commit this.
2530
2531         * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
2532
2533 2002-11-13  Joe Shaw  <joe@ximian.com>
2534
2535         * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
2536         (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
2537         instead of bindir.
2538
2539         * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
2540         to properly shut down the SSL connection before closing the
2541         socket.
2542
2543         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
2544         iochannels before quitting the main loop.
2545
2546         * tests/Makefile.am: disable building timeserver, the source file
2547         wasn't added.
2548
2549 2002-11-12  Dan Winship  <danw@ximian.com>
2550
2551         * configure.in: Check for IPv6 support in networking headers.
2552
2553         * libsoup/soup-address.c: Make the internal structure of
2554         SoupAddress entirely private, and make SoupAddress be more like a
2555         hostent and less like a sockaddr. (Ie, make it not have a port
2556         associated with it.) Document undocumented functions. Add
2557         completely-untested support for IPv6.
2558         (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
2559         SoupAddress and a port.
2560         (soup_address_ipv4_any, soup_address_ipv6_any): Return static
2561         addresses corresponding to the IPv6 and IPv6 "any" addresses.
2562         (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
2563         (soup_address_make_sockaddr): Now constructs a new sockaddr, which
2564         may be a sockaddr_in or sockaddr_in6.
2565         (soup_address_gethostname, soup_address_gethostaddr): Remove
2566         these. They aren't reliable, especially on multihomed hosts.
2567         (soup_gethostbyname, soup_gethostbyaddr): support IPv6
2568         (soup_address_new): Keep pending lookups in a separate hash table
2569         from completed lookups. Fix a bug when canceling a lookup when
2570         there was more one outstanding request for it.
2571         (soup_address_lookup_in_cache): Removed.
2572
2573         * libsoup/soup-socket.c: Add a port field to SoupSocket (since
2574         it's not in SoupAddress any more).
2575         (soup_socket_connect): Simplify this. Don't use
2576         soup_address_lookup_in_cache, just call soup_address_new, since we
2577         already know the code can deal with the callback being invoked
2578         immediately.
2579         (soup_socket_new_sync, soup_socket_new): Take a port argument.
2580         (soup_socket_server_new): Take a SoupAddress to use as the local
2581         address to bind to. This lets the caller choose between the IPv4
2582         and IPv6 "any" addresses, and also lets you bind to a single
2583         interface of a multi-homed machine.
2584         (soup_socket_server_accept, soup_socket_server_try_accept): Merge
2585         the common code.
2586
2587         * libsoup/soup-server.c (soup_server_new): Pass
2588         soup_address_ipv4_any() to soup_socket_server_new().
2589
2590         * libsoup/soup-socks.c (soup_connect_socks_proxy,
2591         soup_socks_write): Fix up for the API changes, but it won't work
2592         with IPv6 yet.
2593
2594         * tests/timeserver.c: Another really simple test, for the server
2595         socket code.
2596
2597         * tests/Makefile.am: build timeserver
2598
2599 2002-11-11  Dan Winship  <danw@ximian.com>
2600
2601         * libsoup/soup-address.c: Move the SoupAddress code from
2602         soup-socket.c and soup-socket-unix.c to here.
2603
2604         * libsoup/soup-socket.c: Move the remaining code from
2605         soup-socket-unix.c here.
2606
2607         * libsoup/soup-socket-unix.c: Gone
2608
2609         * tests/get.c: really really trivial test program
2610
2611         * configure.in (AC_OUTPUT):
2612         * Makefile.am (SUBDIRS): add tests/
2613
2614 2002-11-05  Dan Winship  <danw@ximian.com>
2615
2616         * Split libsoup out of soup. ChangeLog.old contains the original
2617         soup ChangeLog.
2618
2619         * Makefile.am, etc: Fix things up to work with the new directory
2620         layout. Disable docs until we fix them.
2621
2622         * autogen.sh: Use gnome-autogen.sh
2623
2624         * configure.in: Require autoconf 2.53. Remove stuff that was only
2625         needed for httpd or wsdl code. Remove glib1 support. Bump version
2626         to 2.0.
2627
2628         * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
2629         in ${includedir}/soup-2.0
2630         
2631         * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
2632         SOAP-specific stuff, Windows support, and other things that
2633         weren't being maintained.
2634
2635         * soup-config.in, soupConf.sh: Kill these. We only support
2636         pkg-config now.