Free ssl_creds. Pointed out by Chris Austin.
[platform/upstream/libsoup.git] / ChangeLog
1 2006-12-05  Dan Winship  <danw@novell.com>
2
3         * libsoup/soup-message.c (soup_message_set_uri): Remove the calls
4         to soup_message_io_stop() here; the corresponding calls were
5         needed back in the SoupContext days, but they are wrong now and
6         cause async-redirects-to-other-hosts to fail. #382251. Also
7         clarify docs with respect to soup_session_requeue_message().
8
9         * libsoup/soup-message-io.c (soup_message_io_stop): Clarify docs
10
11         * libsoup/soup-session.c (finalize): Free ssl_creds. Pointed out
12         by Chris Austin.
13
14 2006-11-20  Dan Winship  <danw@novell.com>
15
16         * configure.in: 2.2.98
17
18         * NEWS: update
19
20 2006-11-20  Dan Winship  <danw@novell.com>
21
22         Patch from Andrew W. Nosenko:
23
24         * libsoup/soup-message-client-io.c (parse_response_headers): Avoid
25         memory leak when parse_response_headers() is called on a message
26         that has a 'reason_phrase' already for some reason.
27
28         * libsoup/soup-gnutls.c (soup_gnutls_free): Avoid memory leak:
29         hostname was not freed.
30         (soup_ssl_wrap_iochannel): Avoid memory leak: SoupGNUTLSChannel
31         'chan' was not freed in case of initialization error. Avoid double
32         close of the "real" (plain, non-ssl) channel FD.
33         
34         * libsoup/soup-socket.c (soup_socket_start_proxy_ssl): Avoid
35         memory leak: the "real" (plain, non-ssl) GIOChannel was never
36         "finally" unreffed (one more *_ref() than *_unref()) in case of
37         ssl-wrapping.
38
39 2006-11-20  Dan Winship  <danw@novell.com>
40
41         * libsoup/soup-connection-ntlm.c (send_request): 
42         * libsoup/soup-session-sync.c (queue_message): 
43         * libsoup/soup-status.c (reason_phrases): Add some missing
44         "static"s. Patch from Matthias Clasen, #376387
45
46         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_type)
47         (soup_xmlrpc_value_get_string): <value>foo</value> should mean the
48         same thing as <value><string>foo</string></value>. Pointed out by
49         Todd Kulesza. #364490
50
51 2006-11-06  Dan Winship  <danw@novell.com>
52
53         * configure.in: Bump version to 2.2.97. Bump AGE and CURRENT for
54         addition of soup_xml_real_node.
55
56         * NEWS: update
57
58 2006-11-06  Dan Winship  <danw@novell.com>
59
60         * libsoup/soup-misc.c (soup_xml_real_node): new method to find a
61         "real" (ie, not comment or whitespace) xml node
62
63         * libsoup/soup-soap-response.c (parse_parameters) 
64         (soup_soap_response_from_string) 
65         (soup_soap_parameter_get_first_child) 
66         (soup_soap_parameter_get_next_child): Use soup_xml_real_node.
67         Based on a patch from Andrew W. Nosenko.
68
69         * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_from_string):
70         don't call xmlKeepBlanksDefault, which changes libxml's behavior
71         globally! Instead, use soup_xml_real_node() when traversing the
72         xml tree.
73
74         * libsoup/soup-xmlrpc-response.c
75         (soup_xmlrpc_response_from_string): don't call
76         xmlKeepBlanksDefault.
77         (exactly_one_child): rewrite in terms of soup_xml_real_node()
78         (which means it handles comments now as well)
79         (soup_xmlrpc_value_get_struct)
80         (soup_xmlrpc_value_array_get_iterator)
81         (soup_xmlrpc_value_array_iterator_prev)
82         (soup_xmlrpc_value_array_iterator_next): Use soup_xml_real_node.
83
84 2006-11-05  Dan Winship  <danw@novell.com>
85
86         * libsoup/soup-headers.c (soup_headers_parse_request): document
87         this (in particular, point out that str+len must point to exactly
88         the right place). Allow req_method and req_path to be NULL.
89         (soup_headers_parse_status_line, soup_headers_parse_response):
90         document. Also, change "status_phrase" argument to "reason_phrase"
91         to match the spec. Inspired by #339889.
92
93 2006-11-03  Dan Winship  <danw@novell.com>
94
95         * libsoup/*.c: fix lots of warnings. Partially from patches from
96         Andrew W. Nosenko, and also some fixes from libsoup-pre214-branch.
97         
98 2006-11-03  Dan Winship  <danw@novell.com>
99
100         * Makefile.am (uninstall-local): uninstall the pkgconfig file.
101         Based on #356809 from Matthew Barnes.
102
103         * libsoup/soup-server.c (get_property): Fix leaks pointed out by
104         Paolo Borelli. #351500
105
106         * libsoup/soup-uri.c (soup_uri_get_protocol): Fix an off by one
107         pointed out by Andrew W. Nosenko.
108
109         * configure.in: Use pkgconfig to find gnutls. Remove old static
110         linking stuff that was only needed for rcd.
111
112         * acinclude.m4: remove gnutls stuff
113
114         * libsoup.pc.in: Use Requires rather than putting xml/ssl
115         dependencies directly into Libs/Cflags. From Mikhail Zabaluev.
116         #343340.
117
118         * libsoup/Makefile.am (libsoup_2_2_la_LDFLAGS): fix build on
119         cygwin. From "Cygwin Ports maintainer", #321827.
120
121 2006-07-24  Dan Winship  <danw@novell.com>
122
123         * configure.in: 2.2.96. bump AGE and CURRENT for new API
124
125         * NEWS: update
126
127         * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_from_string):
128         New, from Fernando Herrera, bug 348532.
129
130 2006-07-21  Dan Winship  <danw@novell.com>
131
132         * libsoup/soup-auth.c (soup_auth_new_from_header_list): if the
133         constructed auth doesn't have a realm, it's invalid, as per RFC
134         2617. Based on a patch from Nate Nielsen on libsoup-list.
135         (soup_auth_get_realm): remove "if available" from docs; all auths
136         always have a realm.
137
138         * libsoup/soup-message-server-io.c (get_response_headers): If the
139         server handler set a Content-Length header on the message, don't
140         add a second one. (Preserves compatibility with an old hacky way
141         that people might have been handling HEAD from SoupServer.)
142
143         * README: update to mention mailing list and bugzilla
144
145         * HACKING: kill this since there's nothing here that isn't either
146         obvious, or redundant with the README
147
148 2006-07-21  Dan Winship  <danw@novell.com>
149
150         * libsoup/soup-server-message.c (soup_server_message_init):
151         initialize encoding to SOUP_TRANSFER_CONTENT_LENGTH rather than
152         SOUP_TRANSFER_UNKNOWN, since SOUP_TRANSFER_UNKNOWN has never
153         actually worked here, and so there was an undocumented requirement
154         that you manually set the encoding on every response
155         (which SoupServer itself was not doing on internal errors).
156         Problem pointed out by Dennis Jacobfeuerborn on libsoup-list.
157         (soup_server_message_set_encoding): reject the new
158         SoupTransferEncoding values, for compatibility
159
160         * libsoup/soup-message.h (SoupTransferEncoding): Clarify that
161         SOUP_TRANSFER_UNKNOWN is essentially an error value, since in the
162         public API, it always has been, due to bugs. Add some new values,
163         currently just for internal use: SOUP_TRANSFER_NONE (for cases
164         like HEAD which never have a body), SOUP_TRANSFER_EOF (to replace
165         SOUP_TRANSFER_UNKNOWN), and SOUP_TRANSFER_BYTERANGES (which isn't
166         actually implemented yet).
167
168         * libsoup/soup-message.c (soup_message_get_request_encoding,
169         soup_message_get_response_encoding): figure out the body encoding
170         being used by the request/response, including all the tricky
171         cases like HEAD/1xx/etc.
172         (soup_message_is_keepalive): if the response encoding is
173         SOUP_TRANSFER_EOF, then the message isn't keepalive.
174
175         * libsoup/soup-message-client-io.c (parse_response_headers): use
176         soup_message_get_response_encoding.
177
178         * libsoup/soup-message-server-io.c (parse_request_headers): use
179         soup_message_get_request_encoding.
180         (get_response_headers): use both soup_server_message_get_encoding
181         and soup_message_get_response_encoding, to properly distinguish
182         between the wire encoding and the alleged-by-headers encoding
183         (which differ for HEAD, etc).
184
185         * libsoup/soup-message-io.c (io_error, read_body_chunk):
186         s/SOUP_TRANSFER_UNKNOWN/SOUP_TRANSFER_EOF/.
187         (io_body_state): if encoding is SOUP_TRANSFER_NONE, jump right to
188         SOUP_MESSAGE_IO_STATE_FINISHING.
189
190         * libsoup/soup-server.c (request_finished): Check
191         soup_socket_is_connected() *before* soup_message_is_keepalive(),
192         since the message will be invalid if the client unexpectedly
193         dropped the connection.
194
195         * tests/simple-httpd.c (server_callback): handle HEAD requests.
196         Remove no-longer-necessary soup_server_message_set_encoding()
197         call.
198
199         * tests/get.c: add -d (debug) flag to print headers, and -h flag
200         to do a HEAD rather than GET
201
202 2006-07-10  Dan Winship  <danw@novell.com>
203
204         * configure.in: 2.2.95.1, and bump SOUP_AGE/SOUP_CURRENT this
205         time. Pointed out by Daniel Holbach.
206         
207 2006-07-10  Dan Winship  <danw@novell.com>
208
209         * configure.in: 2.2.95
210
211         * NEWS: update
212
213 2006-06-19  Dan Winship  <danw@novell.com>
214
215         * tests/Makefile.am (noinst_PROGRAMS): don't build xmlrpc-test
216         unless we have apache/php/xmlrpc-epi. Fixes the build. #345342
217
218         * configure.in: fix some quoting
219
220 2006-06-14  Dan Winship  <danw@novell.com>
221
222         * configure.in: add tests for apache mod_php5 and xmlrpc-epi-php
223
224         * tests/xmlrpc-test.c: XML-RPC regression test
225
226         * tests/xmlrpc-server.php: PHP server for xmlrpc-test
227
228         * tests/httpd.conf.in: add php stuff
229
230         * tests/apache-wrapper.c (apache_cleanup): Use "graceful-stop"
231         rather than "stop", so that it stops listening on the socket
232         before exiting, so that we can immediately start another apache
233         (eg, in "make check").
234
235         * libsoup/soup-date.c (soup_mktime_utc): Fix a bug in leap-year
236         counting.
237
238         * libsoup/soup-xmlrpc-message.c
239         (soup_xmlrpc_message_write_datetime): rename from
240         "..._write_time", to make it consistent with the XML-RPC type name
241         and the corresponding SoupXmlrpcResponse method. Also, fix it to
242         use the same ISO 8601 format as the spec, and use the right value
243         for the seconds field.
244         (soup_xmlrpc_message_write_base64): Change the buf arg to a
245         gconstpointer rather than a const char *.
246
247         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_base64):
248         Return a GByteArray containing the decoded data, rather than
249         the base64-encoded string.
250         (soup_xmlrpc_value_dump_internal): Update for that (and don't
251         leak it).
252         (soup_xmlrpc_value_array_get_iterator,
253         soup_xmlrpc_value_array_iterator_get_value): Make these actually
254         work.
255
256 2006-06-12  Dan Winship  <danw@novell.com>
257
258         * configure.in: 2.2.94
259
260         * NEWS: update
261
262 2006-06-12  Dan Winship  <danw@novell.com>
263
264         * docs/reference/client-howto.xml: 
265         * docs/reference/server-howto.xml: New client and server API
266         tutorials.
267
268         * docs/reference/*: reorganize, regenerate, fill in some missing
269         pieces, etc
270
271         * libsoup/soup-connection.c (soup_connection_new): document the
272         varargs param
273
274         * libsoup/soup-date.h: sync prototypes to declarations for gtk-doc.
275
276         * libsoup/soup-headers.c (soup_headers_parse_response): fix typo
277         in doc.
278
279 2006-06-12  Dan Winship  <danw@novell.com>
280
281         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_int,
282         soup_xmlrpc_value_get_double): Further fixes from Brent Smith.
283         #344458.
284         (soup_xmlrpc_value_get_boolean): Similar fix, plus actually set
285         the output parameter and make the return value match the other
286         get_* methods.
287
288 2006-06-09  Dan Winship  <danw@novell.com>
289
290         * configure.in: Add tests for apache, output tests/httpd.conf
291
292         * tests/htdigest: 
293         * tests/htpasswd: 
294         * tests/httpd.conf.in: Apache 2.2 config files for auth-test
295
296         * tests/apache-wrapper.c (apache_init, apache_cleanup): functions
297         to start/stop apache
298
299         * tests/auth-test.c: Use apache-wrapper functions to start a local
300         apache process to test authentication against, since the auth-test
301         tree at developer.ximian.com went missing a long time ago. #311825
302
303         * tests/Makefile.am (auth_test_SOURCES): use apache-wrapper.c
304         (TESTS): include auth-test if HAVE_APACHE.
305
306         * libsoup/soup-session.c (lookup_auth): Fix this in the case of a
307         URI pointing to a directory rather than a file.
308
309 2006-06-08  Dan Winship  <danw@novell.com>
310
311         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_int,
312         soup_xmlrpc_value_get_double, soup_xmlrpc_value_get_boolean):
313         Check return value of strtol/g_ascii_strtod correctly. #344222,
314         patch from Brent Smith.
315
316 2006-06-07  Dan Winship  <danw@novell.com>
317
318         * libsoup/soup-xmlrpc-response.c
319         (soup_xmlrpc_response_from_string): record whether or not the
320         response was a fault.
321         (soup_xmlrpc_response_is_fault): test that. #343973, patch from
322         Brent Smith.
323
324 2006-05-29  Dan Winship  <danw@novell.com>
325
326         * configure.in: 2.2.93
327
328         * NEWS: update
329
330 2006-05-29  Dan Winship  <danw@novell.com>
331
332         * libsoup/soup-message-io.c (SoupMessageIOState): add a new state
333         "FINISHING" which means "done I/O, but not yet done processing and
334         cleanup" before "DONE" (which now always means "completely done").
335         (soup_message_io_stop): disconnect the socket if the read state is
336         "< FINISHING", not "!= DONE".
337         (io_error): on an EOF-that-signals-end-of-data, set state to
338         FINISHING and run io_read().
339         (io_read, io_write): remove the g_return_if_fails from before.
340         s/DONE/FINISHING/ in most places. In the FINISHING handler, stop
341         listening for the readable/writable signal (eg, so we don't end up
342         reading a following pipelined request), and set the state to DONE.
343         (soup_message_io_unpause): Only reconnect the readable/writable
344         signals if the io state isn't DONE. Guard the calls to
345         io_read/io_write better so that it's safe to call this even after
346         they are both DONE, since it may be easier for us to test that
347         than for the caller to.
348
349         Fixes 334469, 342640, and another bug caused by the earlier
350         workaround to 334469. Based on patches and analysis from William
351         Jon McCann and Armin Bauer.
352
353         * tests/simple-proxy.c (main): add g_thread_init (NULL) to make
354         this work again. (Pointed out by Alex Larsson)
355
356 2006-05-26  Dan Winship  <danw@novell.com>
357
358         * libsoup/soup-socket.c: #include <sys/time.h> for struct timeval.
359         #342048
360
361         * libsoup/soup-connection.c (soup_connection_connect_sync): Start
362         SSL after CONNECTing! Doh. Part of bnc #174255.
363         (SoupConnectionMode): new enum for the three types of
364         SoupConnection (direct, proxy, tunnel).
365         (set_property): set priv->mode according to proxy_uri and
366         conn_uri.
367         (socket_connect_result, soup_connection_connect_sync): use
368         priv->mode to decide whether or not to tunnel.
369         (send_request): Only pass TRUE for is_proxy to
370         soup_message_send_request if mode is PROXY, not if it's TUNNEL.
371         (Also part of bnc #174255).
372
373 2006-05-26  Dan Winship  <danw@novell.com>
374
375         * libsoup/soup-message-io.c (soup_message_io_in_progress): tests
376         if IO is currently in progress on a message.
377
378         * libsoup/soup-session-async.c (run_queue): don't process messages
379         that are io_in_progress. #342545, fix based on analysis from Wang
380         Xin. (In the future we may want to re-fix this by adding a
381         REQUEUED message status separate from QUEUED.)
382
383 2006-05-22  Dan Winship  <danw@novell.com>
384
385         * libsoup/soup-session.c (cleanup_hosts): Don't free the hosts
386         while holding host_lock; that's not allowed and can cause
387         deadlock. #309867. Based on a patch from Veerapuram Varadhan for
388         part of bnc #174255.
389
390 2006-04-10  Dan Winship  <danw@novell.com>
391
392         * configure.in: bump version to 2.2.92
393
394         * NEWS: update
395
396 2006-04-10  Dan Winship  <danw@novell.com>
397
398         * libsoup/soup-message-io.c (io_write, io_read): g_return_if_fail
399         if these get called after the IO is done. This isn't supposed to
400         happen, but apparently does. Workaround for #334469.
401
402         * libsoup/soup-auth-digest.c (qop_types, algorithm_types):
403         NULL-terminate these so we don't crash when trying to parse an
404         invalid value. (Flip side of the previous #328615 patch.)
405
406 2006-04-02  Dan Winship  <danw@novell.com>
407
408         * libsoup/soup-server-auth.c (soup_server_auth_context_challenge):
409         Write out correct digest algorithm value. #328615.
410
411         * libsoup/soup-headers.c (soup_headers_parse_request): Rewrite
412         Request-Line-parsing code to not have a lame max length. #335040.
413
414         * Makefile.am (install-data-local): Install the .pc file mode 644,
415         not 755. #330878
416
417         * libsoup/soup-auth-digest.c:
418         * libsoup/soup-auth.c:
419         * libsoup/soup-message-client-io.c:
420         * libsoup/soup-message-server-io.c:
421         * libsoup/soup-message.c:
422         * libsoup/soup-method.c:
423         * libsoup/soup-server-auth.c:
424         * tests/get.c: replace locale-ish strcasecmps with
425         g_ascii_strcasecmp
426
427         * libsoup/*.c: fix most signed/unsigned mismatch warnings
428
429 2006-03-03  Dan Winship  <danw@novell.com>
430
431         * configure.in: bump version to 2.2.91.
432
433         * NEWS: Update
434
435 2006-03-03  Dan Winship  <danw@novell.com>
436
437         * libsoup/soup-dns.c (soup_dns_lookup_resolve_async): Take a
438         GMainContext as well, and update the resolution code to dispatch
439         each lookup result in the correct context.
440
441         * libsoup/soup-address.c (soup_address_resolve_async_full): New
442         method that takes a GMainContext to pass to
443         soup_dns_lookup_resolve_async.
444
445         * libsoup/soup-socket.c (soup_socket_connect): Use
446         soup_address_resolve_async_full. Fixes a problem reported by Armin
447         Bauer.
448
449         * configure.in: update to require glib 2.6, since apparently the
450         code does.
451
452 2006-02-25  Veerapuram Varadhan <vvaradhan@novell.com>
453
454         * libsoup/soup-connection.c:
455         * libsoup/soup-session.c:
456         * libsoup/soup-socket.c: add a "timeout" property,
457         which gets passed from server to socket, and session to connection
458         to socket, allowing blocking non-responsive sync connections to 
459         return.  Combination of "EAGAIN" && "Blocking" connection is treated
460         as error and the connection will be terminated and the control 
461         is returned to the caller immediately.
462                 
463 2006-02-02  Tor Lillqvist  <tml@novell.com>
464
465         * configure.in: Don't use getaddrinfo() etc or try to support IPv6
466         on Windows, as they are present by default on XP only. We do want
467         to support Windows 2000, too.
468
469 2005-12-21  Dan Winship  <danw@novell.com>
470
471         * libsoup/soup-date.c (soup_date_iso8601_parse): fix two bugs in
472         the YYYYMMDD case.
473
474         * tests/date.c: add three more ISO 8601 cases, to exercise all the
475         code paths.
476
477         #324671, from Emmanuele Bassi
478         
479 2005-11-25  Dan Winship  <danw@novell.com>
480
481         * README: sync to text on wiki, and point to wiki
482
483         * TODO: moved to http://live.gnome.org/LibSoup_2fToDo
484
485 2005-11-17  Dan Winship  <danw@novell.com>
486
487         * libsoup/soup-message-io.c (io_cleanup): clear priv->io_data
488         right away, to protect against this being re-entered mid-cleanup
489         (when we unref the connection). #321208, based on a patch from
490         Jedy Wang.
491
492 2005-11-16  Dan Winship  <danw@novell.com>
493
494         * libsoup/soup-xmlrpc-message.c
495         (soup_xmlrpc_message_start_member): add the "name" element to the
496         struct member. #321362, patch from Sebastian Bauer.
497
498 2005-11-10  Dan Winship  <danw@novell.com>
499
500         * configure.in: bump version to 2.2.90. This will not be
501         officially released, but once these patches have gotten some
502         testing they may be pulled up to the gnome-2-12 branch.
503
504         * libsoup/soup-connection.c:
505         * libsoup/soup-server.c: 
506         * libsoup/soup-session.c: 
507         * libsoup/soup-socket.c: add an "async-context" property,
508         which gets passed from server to socket, and session to connection
509         to socket, allowing async usage outside the main thread. Based on
510         patches from Armin Bauer and Jürg Billeter.
511
512         * libsoup/soup-misc.c (soup_add_io_watch, soup_add_idle,
513         soup_add_timeout): utility routines to add watches, idles, and
514         timeouts to non-default GMainContexts.
515
516         * libsoup/soup-message-io.c (io_write): set the read state
517         appropriately after writing a "100 Continue" response
518         (io_read): More 100-Continue stuff. I don't think this is quite
519         right so it will probably change again later.
520
521 2005-11-01  Dan Winship  <danw@novell.com>
522
523         * docs/reference/libsoup-docs.sgml: tell it to generate an index
524
525         * docs/reference/tmpl/*.sgml: regen with newer gtk-doc
526
527 2005-11-01  Dan Winship  <danw@novell.com>
528
529         * libsoup/soup-connection.c (set_current_request,
530         clear_current_request): Cast the argument to
531         g_object_add/remove_weak_pointer to the wrong type, to make gcc
532         4.1 happy, because C is stupid and "void **" means "a pointer to a
533         void *", not "a pointer to any kind of pointer".
534
535         * libsoup/soup-xmlrpc-response.c
536         (soup_xmlrpc_value_dump_internal): fix gccism. #320349, from
537         Roland Illig.
538
539 2005-10-27  Dan Winship  <danw@novell.com>
540
541         * libsoup/soup-socket.c (soup_socket_client_new_async,
542         soup_socket_client_new_sync): unref the SoupAddress passed to
543         soup_socket_connect to avoid a leak. Based on a patch from Wang
544         Xin.
545         (socket_read_watch, read_from_network, socket_write_watch,
546         soup_socket_write): request and handle G_IO_ERR and G_IO_HUP
547         events when polling, since poll() will return them whether or not
548         you asked for them, but glib will ignore them unless you did,
549         which will result in CPU suckage if such an error occurs. #319305,
550         patch from Jonathan Matthew.
551
552 2005-10-27  Dan Winship  <danw@novell.com>
553
554         bgo #316313 / bnc #116762, and probably also bgo #318252
555
556         * libsoup/soup-message-io.c (soup_message_io_stop): clear io->conn
557         after releasing it, to make sure we can't accidentally release it
558         twice.
559
560         * libsoup/soup-connection.c (clear_current_request): Call
561         soup_message_io_stop() on the cleared request.
562
563         * libsoup/soup-connection-ntlm.c (ntlm_authorize_post): do a
564         little dance here to make sure the session can't queue another
565         message on the connection while we're in the process of requeuing
566         the original one.
567
568 2005-08-30  Tor Lillqvist  <tml@novell.com>
569
570         * libsoup-zip.in: Include documentation in developer zipfile.
571
572 2005-08-22  Dan Winship  <danw@novell.com>
573
574         * libsoup/soup-soap-message.c (soup_soap_message_class_init): Call
575         g_type_class_add_private.
576
577         * configure.in: Bump to 2.2.6.1
578
579         * NEWS: update
580
581 2005-08-22  Dan Winship  <danw@novell.com>
582
583         * configure.in: Bump to 2.2.6. Bump SOUP_AGE and SOUP_CURRENT for
584         soup_server_get_socket() addition.
585
586         * NEWS: update
587
588 2005-08-22  Dan Winship  <danw@novell.com>
589
590         * libsoup/soup-connection.c (set_current_request,
591         clear_current_request): Fix g_object_add/remove_weak_pointer usage
592         to prevent a crash when canceling a request. From Tambet.
593
594 2005-08-16  Dan Winship  <danw@novell.com>
595
596         Fix a connection leak reported by Tambet.
597
598         * libsoup/soup-connection.c (send_request): rather than tracking
599         the message progress via signals, call
600         soup_message_send_request_internal() and have it call
601         soup_connection_release() when it's done.
602         (request_restarted, request_done): gone
603         (clear_current_request): handle disconnecting (if necessary) and
604         updating last_used time here.
605         (soup_connection_release): Call clear_current_request().
606         (dispose): Call clear_current_request()
607
608         * libsoup/soup-message-client-io.c
609         (soup_message_send_request_internal): New. Takes a SoupConnection
610         in addition to the other args, and passes that on to
611         soup-message-io.
612
613         * libsoup/soup-message-io.c (SoupMessageIOData): add a
614         SoupConnection field.
615         (io_cleanup): if io->conn is set, unref it.
616         (soup_message_io_stop): if io->conn is set, and we ended in a
617         clean state, call soup_connection_release() on it.
618         (soup_message_io_client): Add a SoupConnection arg, which gets
619         reffed and stored in io->conn.
620
621         * TODO: misc updates
622
623 2005-08-15  Dan Winship  <danw@novell.com>
624
625         * libsoup/soup-connection.h (soup_connection_new):
626         * libsoup/soup-server.h (soup_server_new):
627         * libsoup/soup-session-async.h (soup_session_async_new_with_options): 
628         * libsoup/soup-session-sync.h (soup_session_sync_new_with_options): 
629         * libsoup/soup-socket.h (soup_socket_new): use G_GNUC_NULL_TERMINATED.
630
631         * libsoup/soup-types.h (G_GNUC_NULL_TERMINATED): steal the
632         definition of this from glib 2.8 for use when compiling against
633         glib 2.6.
634
635 2005-08-15  Tambet Ingo  <tambet@ximian.com>
636
637         * libsoup/soup-socket.c (update_fdflags, set_property): Fix compilation
638         errors.
639
640         * libsoup/soup-server.c (soup_server_get_listener): ditto.
641
642 2005-08-12  Dan Winship  <danw@novell.com>
643
644         * libsoup/soup-server.c (soup_server_get_listener): new method to
645         get the server's listening socket.
646
647         * libsoup/soup-socket.c: add a new "cloexec" property, to set
648         FD_CLOEXEC on the socket. Update everything for that.
649
650 2005-08-05  Dan Winship  <danw@novell.com>
651
652         * libsoup/soup-socket.c (finalize): Free priv->read_buf. From
653         Tambet.
654         (soup_socket_connect): Make sure that get_iochannel() gets called
655         if the connect succeeds right away, or the socket will fail on
656         the first read or write. [#312540]
657
658 2005-08-01  Dan Winship  <danw@novell.com>
659
660         * configure.in: drop version back down to 2.2.5 and
661         SOUP_API_VERSION back to 2.2; due to various snafus, there has
662         never yet been an official release of the 2.4 API and the GNOME
663         2.12 betas have been shipping with libsoup 2.2 tarballs (while
664         jhbuild has been using 2.4, with evolution and related packages
665         having configure hacks to build against either). As there never
666         ended up being any API-incompatible changes in the 2.4 series, we
667         can just merge it back into the 2.2 series and kill off 2.4.
668
669         * NEWS: Copy in the 2.2-series news from the gnome-2-10 branch,
670         and add new NEWS
671
672         * libsoup-zip.in: s/2.2/@SOUP_API_VERSION@/
673
674         * libsoup/Makefile.am (libsoupincludedir, lib_LTLIBRARIES,
675         libsoup_2_2_la_LDFLAGS, libsoup_2_2_la_LIBADD,
676         libsoup_2_2_la_SOURCES): s/4/2/ in all the places automake won't
677         let us use a variable.
678
679 2005-08-01  Dan Winship  <danw@novell.com>
680
681         * libsoup/soup-md5-utils.c (soup_md5_final_hex): Finalize a
682         SoupMD5Context and write out the digest in hex digits.
683
684         * libsoup/soup-auth-digest.c (authenticate, compute_response):
685         * libsoup/soup-server-auth.c (check_digest_passwd): Use that,
686         rather than duplicating the code in both places here.
687
688         Patch from Wim Lewis.
689         
690 2005-07-15  Dan Winship  <danw@novell.com>
691
692         * libsoup/soup-session.c (redirect_handler): Allow relative URIs,
693         since some servers are lame. Based on a patch from Jean-Yves
694         Lefort. [#270688]
695
696         * tests/uri-parsing.c: add some more tests to make sure that
697         things that should be %-escaped do get %-escaped
698
699 2005-07-06  Tor Lillqvist  <tml@novell.com>
700
701         * libsoup/soup-date.c (soup_gmtime): Mention in the doc comment
702         that gmtime() is thread-safe on Windows.
703         (soup_date_generate): Use soup_gmtime() instead of gmtime_r().
704
705 2005-06-14  Dan Winship  <danw@novell.com>
706
707         * configure.in: check for gmtime_r
708
709         * libsoup/soup-date.c: date/time-manipulation functions
710
711         * libsoup/soup-xmlrpc-message.c: 
712         * libsoup/soup-xmlrpc-response.c: XMLRPC message classes, from
713         Mariano Suarez-Alvarez, Fernando Herrera, and Jeff Bailey.
714         [#300227]
715
716         * tests/date.c: soup-date test code
717
718         * tests/getbug.c: XMLRPC test code. (Should be switched to use
719         bugzilla.gnome.org once bgo supports XMLRPC.)
720
721         * TODO: XMLRPC is implemented now (but shares the problem with
722         SOAP that the API is not very good).
723
724 2005-06-14  Dan Winship  <danw@novell.com>
725
726         * libsoup/*.[ch]: add/fix gtk-doc comments, make functions match
727         prototypes, etc
728
729         * docs/reference/*: update, fix, etc
730
731 2005-06-13  Tor Lillqvist  <tml@novell.com>
732
733         * configure.in: Check also for inet_ntop(). Pre-cache knowledge
734         that we do have inet_pton() and inet_ntop() on Windows (because we
735         implement them ourselves in soup-dns.c).
736         
737         * libsoup/soup-dns.c (inet_pton, inet_ntop): Fix the Win32
738         implementations, they were completely bogus.
739         (soup_dns_ntop): Make it compile if HAVE_INET_NTOP.
740
741 2005-06-08  Dan Winship  <danw@novell.com>
742
743         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Fix this to
744         use just the domain name for the domain, not the whole
745         DOMAIN\username. Based on a patch by Jeroen Hautekeete in #306877.
746
747 2005-05-26  Dan Winship  <danw@novell.com>
748
749         * libsoup/soup-session.c (cleanup_hosts): lock host_lock around
750         this, since it can be called from set_property(). Possible fix for
751         bnc #81641.
752
753 2005-05-05  Dan Winship  <danw@novell.com>
754
755         * docs/reference/Makefile.am (SCANGOBJ_OPTIONS): Use
756         --type-init-func to force g_thread_init to be called. [#302674]
757
758 2005-04-18  Tor Lillqvist  <tml@novell.com>
759
760         * configure.in: Call AC_LIBTOOL_WIN32_DLL. Check for Win32, set
761         Automake conditional OS_WIN32. Pre-cache information that we do
762         have getaddrinfo(), getnameinfo(), and IPv6 on Win32. (The tests
763         wouldn't notice as they don't include the necessary headers or
764         link with -lws2_32. Easiest to just pre-cache it.)
765
766         * libsoup-zip.in: New file, to build zipfile-based distribution of
767         libsoup for Win32. 
768
769         * Makefile.am (EXTRA_DIST)
770         * configure.in (AC_OUTPUT): Add libsoup-zip(.in).
771
772         * libsoup/Makefile.am: Use -no-undefined on Win32. Link with
773         WinSock library -lws2_32.
774         
775         * libsoup/soup-portability.h: New file. On Unix it includes the
776         traditional BSD socket etc headers. On Win32 it includes
777         winsock2.h and ws2tcpip.h.
778
779         * libsoup/*.c
780         * libsoup/*.h: Correspondingly, don't include the BSD socket API
781         headers directly.
782
783         * libsoup/soup-address.h
784         * libsoup/soup-dns.h: Include soup-portability.h
785
786         * libsoup/soup-address.c (soup_address_class_init): This function
787         should get called before libsoup uses the WinSock API, so this is
788         a good place to call WSAStartup().
789         
790         * libsoup/soup-auth-digest.c (get_protection_space): Use
791         g_strsplit() instead of the relatively unportable strtok_r().
792
793         * libsoup/soun-dns.c: Remove unused headers. Implement
794         inet_pton() and inet_ntop() on Win32 using WSAStringToAddress()
795         and WSAAddressToString().
796
797         * libsoup/soup-socket.c (SOUP_CLOSE_SOCKET, SOUP_IS_SOCKET_ERROR,
798         SOUP_IS_INVALID_SOCKET, SOUP_IS_CONNECT_STATUS_INPROGRESS):
799         Portability macros.
800         (soup_socket_class_init): Call soup_address_get_type() to make
801         sure WSAStartup() gets called (through soup_address_class_init()).
802         (update_fdflags): Use ioctlsocket(FIONBIO) on Win32.
803         (soup_socket_write): Conditionalize SIGPIPE use.
804         
805         * tests/get.c: mkdir() is different in Microsoft's C library.
806
807         * tests/simple-httpd.c: Rename TRY_AGAIN label to AGAIN to avoid
808         some clash with winsock2.h (which includes windows.h). The Win32
809         headers pollute the namespace wildly.
810
811 2005-04-15  Dan Winship  <danw@novell.com>
812
813         * libsoup/soup-dns.c (resolve_name): make this work with
814         pre-EAI_OVERFLOW glibc [#300620]
815
816 2005-04-12  Dan Winship  <danw@novell.com>
817
818         * configure.in: Remove the various gethostbyname_r checks and just
819         check for getnameinfo/getaddrinfo.
820
821         * libsoup/soup-dns.c: de-nastify. Make this use threads instead of
822         forking. Change the API around a bunch in the process.
823
824         * libsoup/soup-address.c: Update for soup-dns changes
825
826         * tests/dns.c: take multiple hostnames on the command line and
827         resolve them all at once (patch from tml)
828
829 2005-04-11  Dan Winship  <danw@novell.com>
830
831         * configure.in: require glib-2.0 >= 2.4.0
832
833         * libsoup/*.c: use G_DEFINE_TYPE and
834         g_type_class_add_private/G_TYPE_INSTANCE_GET_PRIVATE
835
836         * libsoup/soup-types.h: kill SOUP_MAKE_TYPE and
837         SOUP_MAKE_TYPE_WITH_IFACE
838
839         * tests/revserver.c: use GThread. (patch from tml)
840
841 2005-04-11  Dan Winship  <danw@novell.com>
842
843         * configure.in: bump version to 2.3.0. bump SOUP_API_VERSION to
844         2.4
845
846         * libsoup.pc.in: rename from libsoup-2.2.pc.in
847
848         * Makefile.am (EXTRA_DIST, pkgconfig_DATA, install-data-local):
849         install the .pc file by hand, renaming it to include the
850         SOUP_API_VERSION
851
852         * libsoup/Makefile.am: s/2.2/2.4/
853
854 2005-03-09  Dan Winship  <danw@novell.com>
855
856         * libsoup/soup-gnutls.c (soup_gnutls_read): return G_IO_STATUS_EOF
857         if gnutls returns 0. [#73352]
858         (verify_certificate): put an #ifdef around
859         GNUTLS_CERT_NOT_TRUSTED so it works with gnutls 1.2.x. [#57811]
860
861 2005-01-08  Not Zed  <NotZed@Ximian.com>
862
863         ** See ximian bug #70323.
864
865         * libsoup/soup-connection-ntlm.c: replace all unsigned long/long
866         types with guint32, as the code needs 32 bit longs.
867
868 2004-10-20  Dan Winship  <danw@novell.com>
869
870         * libsoup/soup-gnutls.c: Commit the alleged changes from the 10-06
871         commit, which somehow did not actually get committed then.
872
873         * libsoup/soup-connection.c (SoupConnectionPrivate): add a flag
874         indicating whether or not the connection is connected.
875         (tunnel_connect_finished): If successful, set connected. If the
876         server returns a 3xx response, translate it to 407 (under the
877         assumption that it's trying to redirect us to an HTML login page,
878         as in bug 68531). Use soup_socket_start_proxy_ssl() rather than
879         soup_socket_start_ssl().
880         (socket_connect_result, soup_connection_connect_sync): If
881         successful, set connected
882         (soup_connection_disconnect): Don't emit "disconnected" if we
883         aren't yet connected, or the message that was waiting for this
884         connection may get stranded in the queue. (also part of 68531)
885
886         * libsoup/soup-socket.c (soup_socket_start_proxy_ssl): New, starts
887         SSL and lets the caller pass the expected hostname. Fixes a
888         problem where SSL certification validation would always fail if
889         you used a proxy, because it was comparing the cert against the
890         proxy's hostname. (68583)
891
892 2004-10-06  Dan Winship  <danw@novell.com>
893
894         * libsoup/soup-ssl.h (SoupSocketError): add
895         SOUP_SSL_ERROR_CERTIFICATE.
896
897         * libsoup/soup-gnutls.c (do_handshake): Pass the GError to
898         verify_certificate.
899         (verify_certificate): Set the GError appropriately rather than
900         spewing g_warnings.
901
902         * libsoup/soup-socket.c (read_from_network, soup_socket_write): If
903         the GIOChannel operation returns an error, store it as GOBject
904         data on the socket (as a hack so soup-message-io.c can access it
905         without us needing to change SoupSocket's API).
906
907         * libsoup/soup-message-io.c (io_error): peek at the socket's
908         "last_error" datum and set the message's status to SSL_FAILED
909         (with the GError's message string) rather than IO_ERROR, if
910         appropriate. For 64414.
911
912 2004-09-30  Dan Winship  <danw@novell.com>
913
914         * libsoup/soup-gnutls.c (soup_gnutls_init): Add this, with some
915         extra initialization needed for libgcrypt 1.2 or higher. Fixes
916         66342.
917         (soup_ssl_get_client_credentials,
918         soup_ssl_get_server_credentials): Call soup_gnutls_init().
919
920 2004-08-26  Dan Winship  <danw@novell.com>
921
922         * configure.in: Bump version to 2.2.0.
923
924         * AUTHORS: Update this to reflect the last 2 years.
925
926         * NEWS: Brief summary of 1.99.x -> 2.2 changes
927
928         * README, TODO: Updates
929
930 2004-08-26  Dan Winship  <danw@novell.com>
931
932         * libsoup/*: add/fix lots of gtk-doc comments
933         
934         * libsoup/soup-misc.c (soup_str_case_hash, soup_str_case_equal):
935         Fix bug noticed while documenting. (We were using the
936         locale-case-insensitive functions rather than the g_ascii_ ones.)
937
938         * libsoup/soup-message.h (SoupMessageFlags): remove the (never
939         implemented) NO_PIPELINE and NO_COOKIE flags.
940
941         * docs/reference/tmpl/*.sgml: Regenerate, fill in some stuff.
942         There are still problems here with gtk-doc not recognizing many of
943         the objects in libsoup...
944
945 2004-08-13  JP Rosevear  <jpr@novell.com>
946
947         * configure.in: bump version, libtool number
948
949 2004-08-09  Dan Winship  <danw@novell.com>
950
951         * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
952         use conn after emitting the "connect_result" signal, since it
953         might be destroyed by that. Based on a patch from hpj.
954
955 2004-08-02  Dan Winship  <danw@novell.com>
956
957         * libsoup/soup-uri.h: Add flag "broken_encoding" to SoupUri.
958
959         * libsoup/soup-uri.c: (soup_uri_to_string): if broken_encoding is
960         set, don't re-encode the URL parts. Based on a patch by
961         Alfred.Peng@Sun.COM.
962
963 2004-07-19  JP Rosevear  <jpr@novell.com>
964
965         * configure.in: bump version, libtool number
966
967 2004-07-15  Dan Winship  <danw@novell.com>
968
969         * libsoup/soup-session-sync.c (send_message): Simplify this. If
970         the message comes back from soup_connection_send_request not
971         FINISHED, get a new connection rather than reusing the old one.
972         This fixes a race condition in which a connection could end up
973         double-booked, and fixes the handling of messages that get
974         redirected to another server.
975
976 2004-07-13  Dan Winship  <danw@novell.com>
977
978         * libsoup/soup-session.c (connect_result): If the connection
979         attempt succeeded, reserve the connection before releasing
980         host_lock. Otherwise, another thread might find it in the
981         connection pool before the caller can queue a message on it.
982         #60693
983
984         * libsoup/soup-session-async.c (got_connection): Call
985         soup_connection_release(), since we don't have a specific message
986         in mind for the connection, so we need it to be considered idle.
987
988         * libsoup/soup-connection.c (soup_connection_release): New
989         function, to undo a soup_connection_reserve().
990         (soup_connection_send_request, soup_connection_reserve,
991         soup_connection_authenticate, soup_connection_reauthenticate):
992         Document these
993
994 2004-07-12  Dan Winship  <danw@novell.com>
995
996         * libsoup/soup-session-sync.c (send_message): signal the
997         "connections available" condition after the message finishes. Duh.
998
999         * libsoup-2.2.pc.in (Cflags, Libs): add XML_CFLAGS and XML_LIBS
1000
1001 2004-07-08  Dan Winship  <danw@novell.com>
1002
1003         * libsoup/soup-soap-response.c: Revert previous change for now; it
1004         breaks the build on distros with older libxmls.
1005
1006 2004-07-08  Dan Winship  <danw@novell.com>
1007
1008         * tests/dict.c: Basic SOAP test, using Aonaware's SOAP->DICT
1009         gateway
1010
1011 2004-07-07  Fernando Herrera  <fherrera@onirica.com>
1012
1013         * libsoup/soup-soap-response.c: (finalize), (init),
1014         (soup_soap_response_from_string): Use a parse context for the
1015         xml document, so we can safely use the option to ignore
1016         blank spaces and '\n'.
1017
1018 2004-07-06  Dan Winship  <danw@novell.com>
1019
1020         * libsoup/soup-uri.c (soup_uri_new_with_base): if the protocol is
1021         http or https, require a hostname. For #61049
1022
1023         * tests/uri-parsing.c (rel_tests, do_uri): Update for that
1024
1025 2004-06-03  JP Rosevear <jpr@novell.com>
1026
1027         * configure.in: bump version to 2.1.11, libtool number
1028
1029 2004-06-01  Dan Winship  <danw@novell.com>
1030
1031         * libsoup/soup-address.c: Redo the various IPv4/IPv6-abstracting
1032         macros to not use ?: expressions as lvalues, since that's
1033         apparently a GNU extension.
1034         (soup_address_resolve_async): Use a timeout rather than an idle
1035         handler to poll the dns result. (soup-dns really should be
1036         rewritten to not require polling, but this is easier for now.)
1037         #59240
1038
1039         * libsoup/soup-server.c (call_handler): Don't use GNU-only
1040         non-constant structure initialization
1041
1042         * tests/dns.c: Simple test of the dns code
1043
1044         * tests/Makefile.am (noinst_PROGRAMS): build it
1045
1046 2004-05-19  JP Rosevear  <jpr@novell.com>
1047
1048         * configure.in (SOUP_API_VERSION): bump version, libtool numbers
1049
1050 2004-05-18  Dan Winship  <danw@novell.com>
1051
1052         * libsoup/soup-ssl.h:
1053         * libsoup/soup-nossl.c: define some GError codes and stuff
1054
1055         * libsoup/soup-gnutls.c: add missing #include <gnutls/x509.h>
1056         (do_handshake): when returning G_IO_STATUS_AGAIN, set the GError
1057         to SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ or _NEEDS_WRITE
1058         appropriately.
1059
1060         * libsoup/soup-socket.c (soup_socket_write): Handle
1061         SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ, by setting an io watch for
1062         G_IO_IN instead of G_IO_OUT. Fixes the rcd-sucking-up-all-cpu bug
1063         (#58434)
1064         (read_from_network): Handle the reverse case (which would cause
1065         hanging rather than spinning, and might be the cause of some
1066         connector 1.5 slowness?)
1067
1068 2004-05-11  Dan Winship  <danw@novell.com>
1069
1070         * libsoup/soup-misc.c (soup_signal_connect_once): Do this less
1071         kludgefully, using the magic of GClosure, to fix x86_64 problems
1072         reported by snorp.
1073
1074 2004-05-04  Sivaiah Nallagatla <snallagatla@novell.com>
1075
1076         * libsoup/soup-soap-message.c (finalize) : free
1077         the elements of priv structure before freeing priv
1078
1079 2004-04-20  Dan Winship  <danw@ximian.com>
1080
1081         * libsoup/soup-connection-ntlm.c (ntlm_authorize_post): if
1082         re-sending the message, call soup_message_restarted()
1083         (send_request): Connect to "restarted" signal, and remove the 401
1084         handlers from there; doing it here didn't work because if the
1085         connection was closed, the message would be re-sent on a new
1086         connection, but would still have the handlers from the old
1087         connection attached to it, which would make authentication fail.
1088
1089         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
1090         Copy the handler list before starting, to protect against handlers
1091         that modify the handler list.
1092
1093 2004-04-15  Dan Winship  <danw@ximian.com>
1094
1095         * libsoup/soup-connection.c (soup_connection_connect_sync):
1096         Connect to the socket's "disconnect" signal. (We were only doing
1097         this from the async version before, which meant that synchronous
1098         SoupConnections could outlive their sockets and start causing
1099         errors.) #57004
1100
1101         * libsoup/soup-connection-ntlm.c (send_request): Remove the old
1102         Authorization header before adding a new one.
1103
1104 2004-04-02  JP Rosevear  <jpr@ximian.com>
1105
1106         * configure.in: bump version, libtool number
1107
1108 2004-03-15  Dan Winship  <danw@ximian.com>
1109
1110         * libsoup/soup-soap-message.c (soup_soap_message_persist): Fix up
1111         types to kill a warning with -Wall -O2
1112
1113 2004-03-05  JP Rosevear <jpr@ximian.com>
1114
1115         * configure.in: bump version, libtool number
1116
1117 2004-03-02  Dan Winship  <danw@ximian.com>
1118
1119         * libsoup/soup-dns.c (check_hostent): Only loop on EINTR if
1120         bytes_read is -1, since the value of errno is irrelevant when
1121         bytes_read is 0. Probably #54960.
1122
1123 2004-03-01  Rodrigo Moya <rodrigo@ximian.com>
1124
1125         * libsoup/soup-soap-response.h: removed not-implemented function's
1126         prototype.
1127
1128 2004-02-27  Rodney Dawes  <dobey@ximian.com>
1129
1130         * configure.in:
1131         * libsoup/Makefile.am: Use a different variable for linking to the
1132         static version of gnutls, so we don't pull the .a files into the .pc
1133
1134         Fixes #53346
1135
1136 2004-02-20  Dan Winship  <danw@ximian.com>
1137
1138         * libsoup/soup-message-io.c (read_metadata, read_body_chunk,
1139         write_data): Pass gsize *, not guint *, to soup_socket_read/write,
1140         to make this work on 64-bit platforms. (Grr. C type checking
1141         sucks.) #54631
1142         
1143         * tests/revserver.c: Likewise
1144
1145 2004-02-18  Rodrigo Moya <rodrigo@ximian.com>
1146
1147         Fixes #54512
1148
1149         * libsoup/soup-soap-response.c (soup_soap_parameter_get_int_value):
1150         don't leak the value returned from xmlNodeGetContent().
1151         (soup_soap_parameter_get_string_value,
1152         soup_soap_parameter_get_property): return a g_strdup'ed
1153         string, not the value returned by xmlNodeGetContent, so that
1154         callers can use g_free, and not xmlFree.
1155
1156         * libsoup/soup-soap-response.h: made soup_parameter_get_property
1157         not return const.
1158
1159 2004-02-17  Dan Winship  <danw@ximian.com>
1160
1161         * libsoup/soup-soap-message.h (SOUP_IS_SOAP_MESSAGE_CLASS): Fix a
1162         typo. #54433, from Mariano Suarez-Alvarez.
1163
1164         * libsoup/soup-soap-response.h (SOUP_IS_SOAP_RESPONSE_CLASS):
1165         Likewise
1166
1167 2004-02-17  Rodney Dawes  <dobey@ximian.com>
1168
1169         * libsoup/soup-message.c (soup_message_new): HTTP connections require
1170         a hostname, and we also hash on the host for message queueing in the
1171         session, if the host is NULL we free the SoupUri and return NULL
1172
1173 2004-02-14  Dan Winship  <danw@ximian.com>
1174
1175         * configure.in: Use POSIX-compliant "test $foo = bar", rather than
1176         GNU-only "test $foo == bar". #54354, from Julio M. Merino Vidal.
1177
1178 2004-02-12  Joe Shaw  <joe@ximian.com>
1179
1180         * libsoup/soup-dns.c (check_hostent): Call read() in a do-while
1181         loop to prevent DNS errors from short reads.
1182
1183 2004-02-11  Joe Shaw  <joe@ximian.com>
1184
1185         * configure.in: Bumped version number to 2.1.7 and libtool
1186         current. 
1187
1188 2004-02-11  Dan Winship  <danw@ximian.com>
1189
1190         * libsoup/soup-connection.c (soup_connection_disconnect): Update
1191         Joe's comment here with a gory explanation of exactly what's going
1192         on. (It's not just an SSL bug either, it affects all connections.)
1193
1194 2004-02-10  Joe Shaw  <joe@ximian.com>
1195
1196         * libsoup/soup-connection.c (soup_connection_disconnect): Add a
1197         workaround for SSL connections which time-out but don't close the
1198         socket until we try sending data again later.
1199
1200         * libsoup/soup-socket.c (soup_socket_connect, soup_socket_listen):
1201         Don't free the sockaddr from soup_address_get_sockaddr(); we don't
1202         own it, the SoupAddress does.
1203
1204 2004-02-09  JP Rosevear  <jpr@ximian.com>
1205
1206         * configure.in: Bump libtool numbers
1207
1208 2004-02-05  Dan Winship  <danw@ximian.com>
1209
1210         * libsoup/soup-session.c (soup_session_add_filter): Ref the filter
1211         when adding it.
1212         (soup_session_remove_filter): And unref it here (we were already
1213         unreffing it in dispose().)
1214
1215 2004-02-05  Joe Shaw  <joe@ximian.com>
1216
1217         * libsoup/soup-dns.c (soup_dns_entry_unref): Don't try to free the
1218         hostent if it's NULL.
1219         (soup_dns_entry_check_lookup): If the entry is resolved, but the
1220         hostent is NULL, uncache it.
1221
1222 2004-02-04  Dan Winship  <danw@ximian.com>
1223
1224         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Always
1225         remove the WWW-Authenticate headers before returning, so the
1226         session won't fall back to Basic auth. Also, leave the connection
1227         in the "authenticating" state rather than setting it to
1228         "authenticated".
1229         (ntlm_authorize_post): Only requeue the message if it's in the
1230         "authenticating" state (and set it to "authenticated"). Fixes an
1231         "unepectedly disconnected" error if authentication fails.
1232
1233 2004-02-03  Dan Winship  <danw@ximian.com>
1234
1235         * libsoup/soup-message-io.c (io_cleanup): Call
1236         soup_message_io_stop so we don't get a callback on the io after
1237         it's been cleaned up.
1238
1239         * libsoup/soup-session.c (add_auth): Only remove the Authorization
1240         header if we have another one to add. (Otherwise it messes up
1241         SoupConnectionNTLM.)
1242
1243         * libsoup/soup-socket.c (read_from_buf): Use memmove rather than
1244         memcpy here, since the source and destination will overlap if
1245         *nread is small and read_buf->len is large. (Noticed by valgrind,
1246         #53625.)
1247
1248 2004-02-02  Joe Shaw  <joe@ximian.com>
1249
1250         * libsoup/soup-gnutls.c (soup_gnutls_close): Call gnutls_bye()
1251         with the GNUTLS_SHUT_WR flag (instead of RDWR) and check only for
1252         GNUTLS_E_INTERRUPTED.  GNUTLS_E_AGAIN will be returned by recv()
1253         when there are no messages on the wire on a non-blocking socket.
1254         This sends a SSL hangup message and then allows us to immediately
1255         close the socket.
1256
1257 2004-01-30  Rodrigo Moya <rodrigo@ximian.com>
1258
1259         * configure.in: bumped version number to 2.1.6.
1260
1261 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
1262
1263         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_property):
1264         new function.
1265
1266 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
1267
1268         * libsoup/soup-soap-response.[ch]
1269         (soup_soap_parameter_get_string_value): removed 'const' from return
1270         type.
1271
1272 2004-01-29  Joe Shaw  <joe@ximian.com>
1273
1274         * libsoup/soup-gnutls.c (verify_certificate): Initialize the
1275         certificate before we try to use it.  Ahem.
1276
1277 2004-01-23  Joe Shaw  <joe@ximian.com>
1278
1279         * configure.in: Bump version to 2.1.5 and SOUP_RELEASE to 2
1280
1281 2004-01-21  Joe Shaw  <joe@ximian.com>
1282
1283         * configure.in: Require at least GnuTLS 1.0.0.
1284
1285         * libsoup/soup-gnutls.c: Fix the use of deprecated GnuTLS
1286         functions.
1287         (verify_certificate): Use gnutls_x509_crt_import() and
1288         gnutls_x509_crt_check_hostname() instead of
1289         gnutls_x509_check_certificates_hostname().
1290         (init_dh_params): Use gnutls_dh_params_generate2() instead of
1291         gnutls_dh_params_generate() and gnutls_dh_params_set().
1292
1293 2004-01-20  Joe Shaw  <joe@ximian.com>
1294
1295         * libsoup/soup-gnutls.c (soup_gnutls_close): gnutls_bye() doesn't
1296         close the socket itself, so we need to do it or else our
1297         connections stay in CLOSE_WAIT forever.
1298
1299 2004-01-16  Jason Leach  <leach@wam.umd.edu>
1300
1301         * libsoup/Makefile.am: builddir != srcdir fixes.
1302
1303 2004-01-14  Joe Shaw  <joe@ximian.com>
1304
1305         * libsoup/soup-gnutls.c (verify_certificate): Remove the
1306         check for GNUTLS_CERT_CORRUPTED, it's not in 1.0.x.
1307
1308 2004-01-12  JP Rosevear  <jpr@ximian.com>
1309
1310         * configure.in: bump version and libtool revision
1311
1312 2004-01-12  Dan Winship  <danw@ximian.com>
1313
1314         * tests/simple-httpd.c (main): Add a g_thread_init() so this works
1315         again.
1316
1317 2004-01-10  Larry Ewing  <lewing@ximian.com>
1318
1319         * libsoup-2.2.pc.in (Libs): use LIBGNUTLS_LIBS in the substitution
1320         string.
1321
1322 2004-01-09  Joe Shaw  <joe@ximian.com>
1323
1324         * acinclude.m4: Include the libgnutls.m4 file.
1325
1326         * configure.in: Remove manual checking for libgnutls-config and
1327         use the AM_PATH_LIBGNUTLS so we can pass in a minimum required
1328         version, which is 0.9.7 for now.
1329
1330         * libsoup/Makefile.am: Some changes for the above change.
1331
1332         * libsoup/soup-gnutls.c: Check for HAVE_SSL, not
1333         HAVE_GNUTLS_GNUTLS_H.
1334         (verify_certificate): Uncomment the SSL certificate hostname
1335         check.
1336
1337         * libsoup/soup-session.c (set_property): Be smart about flushing
1338         our SSL credentials only when the CA file is set to something
1339         different than it was before.
1340
1341 2004-01-09  Harish K <kharish@novell.com>
1342         * libsoup/soup-soap-response.c (soup_soap_response_from_string): 
1343         added code to ignore Header element, if present, while creating 
1344         response objects.  
1345         
1346 2004-01-05  Dan Winship  <danw@ximian.com>
1347
1348         * configure.in: Remove no-longer-relevant socklen_t check
1349
1350         * libsoup/soup-address.c: Reorder #includes for FreeBSD (From Joe
1351         Marcus Clarke, #52566)
1352
1353         * libsoup/soup-dns.c: Likewise
1354
1355 2003-12-29  JP Rosevear <jpr@ximian.com>
1356
1357         * configure.in: bump version and libtool numbers
1358
1359 2003-12-22  Dan Winship  <danw@ximian.com>
1360
1361         * README, TODO: Update these
1362
1363 2003-12-22  Dan Winship  <danw@ximian.com>
1364
1365         * libsoup/soup-socket.c: Lots of thread-safety stuff, primarly so
1366         you can disconnect a socket from one thread while doing I/O in
1367         another.
1368
1369         * libsoup/soup-message-io.c (soup_message_io_cancel): Split into
1370         soup_message_io_stop() and io_cleanup(), to separate out the "stop
1371         reading/writing" and "free data" phases to allow thread-safe
1372         synchronous cancellation.
1373         (soup_message_io_finished): call both soup_message_io_stop() and
1374         io_cleanup()
1375         (io_error): Only set SOUP_STATUS_IO_ERROR on the message if it
1376         doesn't already have a transport error status (eg, CANCELLED).
1377         (new_iostate): Call io_cleanup() if needed.
1378
1379         * libsoup/soup-status.h: add "SOUP_STATUS_NONE" for 0, to make it
1380         clearer that it's not a status.
1381
1382         * libsoup/soup-message.c (finalize, restarted, finished,
1383         soup_message_set_uri): s/soup_message_io_cancel/soup_message_io_stop/
1384         (soup_message_cleanup_response): s/0/SOUP_STATUS_NONE/
1385
1386         * libsoup/soup-connection.c (send_request): Remove
1387         soup_message_io_cancel call.
1388
1389         * libsoup/soup-session-sync.c (send_message): Connect to the
1390         connection's "disconnected" signal rather than using a weak ref,
1391         since that's what we really care about, and it's possible that the
1392         connection may have an extra ref on it somewhere that would keep
1393         it from being destroyed even if it was disconnected.
1394
1395 2003-12-20  Joe Shaw  <joe@ximian.com>
1396
1397         * libsoup/soup-session.c (lookup_auth): If const_path is NULL un
1398         the non-proxy case, then use the root ("/").
1399
1400 2003-12-19  Dan Winship  <danw@ximian.com>
1401
1402         * libsoup/soup-message-filter.c: New. An interface for objects
1403         that want to act on every message passing through a session.
1404         (Initially being used for authentication, but could also be used
1405         for cache handling, cookie management, etc.)
1406
1407         * libsoup/soup-connection.c (class_init, etc): Add a message
1408         filter property.
1409         (send_request): If the connection has a message filter set, run
1410         it on the message before sending it.
1411         (soup_connection_connect_async, etc): When setting up a tunnel, if
1412         we get back a 407 and the session tries to requeue the message,
1413         either re-send it, or return SOUP_STATUS_TRY_AGAIN (depending on
1414         whether or not the proxy closed the connection).
1415         (soup_connection_connect_sync): Likewise
1416         (send_request, request_done): Ref/unref the connection
1417
1418         * libsoup/soup-session.c (soup_session_get_type): Implement the
1419         SoupMessageFilter interface.
1420         (soup_session_get_connection): Use the session as the connection's
1421         message filter
1422         (soup_session_add_filter, soup_session_remove_filter): Add/remove
1423         filters from the session
1424         (setup_message): do auth handling, and call each of the session's
1425         filters' setup_message methods as well.
1426         (soup_session_send_message_via): No longer needed.
1427         (connect_result): Handle SOUP_STATUS_TRY_AGAIN.
1428
1429         * libsoup/soup-session-async.c (run_queue): Use
1430         soup_connection_send_request, since soup_session_send_message_via
1431         is gone now.
1432
1433         * libsoup/soup-session-sync.c (send_message): Likewise
1434
1435         * libsoup/soup-message.c (soup_message_is_keepalive): A successful
1436         response to a CONNECT is always keepalive, even if it's HTTP/1.0
1437         with no Connection header.
1438
1439         * libsoup/soup-status.h: add SOUP_STATUS_TRY_AGAIN
1440
1441         * libsoup/soup-types.h: Add SoupMessageFilter, and macros for
1442         gobject interface types.
1443
1444         * tests/get.c (main): Add a -p flag to specify a proxy
1445
1446         * tests/simple-proxy.c: Fix #includes
1447
1448 2003-12-18  Dan Winship  <danw@ximian.com>
1449
1450         * libsoup/soup-connection.c (soup_connection_disconnect): Actually
1451         disconnect the socket rather than just unreffing it, since the IO
1452         code may be holding an extra ref on it.
1453         (send_request): connect to the "restarted" signal too
1454         (request_restarted): Deal with "Connection: close"
1455
1456         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this
1457         not go into an infinite loop if the server only supports Basic.
1458
1459 2003-12-17  Rodrigo Moya <rodrigo@ximian.com>
1460
1461         * libsoup/Makefile.am: install soup-message-queue.h with the rest
1462         of the headers.
1463
1464 2003-12-17  Dan Winship  <danw@ximian.com>
1465
1466         * configure.in: Add gthread to glib check
1467
1468         * libsoup/soup-session.c: Make this an abstract class.
1469
1470         * libsoup/soup-session-async.c: A SoupSession class for
1471         asynchronous gmain-based operation; replaces the old SoupSession.
1472
1473         * libsoup/soup-session-sync.c: A SoupSession class for synchronous
1474         blocking operation for use with threaded apps.
1475
1476         * libsoup/soup-types.h, libsoup/soup.h: add the new session
1477         subclasses
1478
1479         * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
1480         try to unref the socket if the socket creation fails.
1481         (soup_connection_reserve): New, to explicitly mark a connection as
1482         being in use without queueing a message on it.
1483
1484         * libsoup/soup-dns.c (check_hostent): Oof. Fix the logic of the
1485         "block" flag to not be reversed.
1486
1487         * libsoup/soup-message.c (finished): set status to FINISHED here.
1488         (soup_message_cancel): Gone; needs to be done at the session
1489         level.
1490
1491         * libsoup/soup-message-queue.c: Add a mutex and make all of the
1492         operations thread-safe.
1493
1494         * libsoup/soup-socket.c (disconnect_internal): Make this
1495         thread-safe.
1496         (soup_socket_connect): Make the sync case work correctly.
1497
1498         * libsoup/Makefile.am: add the SoupSession subclasses
1499
1500         * tests/Makefile.am: libsoup depends on libgthread now, so
1501         revserver doesn't need to explicitly.
1502
1503         * tests/get.c, tests/auth-test.c, tests/simple-proxy.c: Use
1504         soup_session_async_new().
1505
1506 2003-12-16  Rodrigo Moya <rodrigo@ximian.com>
1507
1508         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_int_value):
1509         new function.
1510
1511 2003-12-16  Joe Shaw  <joe@ximian.com>
1512
1513         * libsoup/soup-connection.c (socket_connect_result,
1514         soup_connection_connect_sync): Only set up a tunnel if the
1515         destination protocol is HTTPS.
1516
1517         * libsoup/soup-message.c (class_init): Add a default handler for
1518         wrote_body.
1519         (wrote_body): Run the SOUP_HANDLER_POST_REQUEST handlers here.
1520         (soup_message_cancel): Don't set the status to
1521         SOUP_STATUS_CANCELLED and call soup_message_finished() if the
1522         status is already SOUP_MESSAGE_STATUS_FINISHED.
1523
1524         * libsoup/soup-session.c (set_property): Don't cancel the session
1525         if the proxy URI set as a property isn't different from the old
1526         one.
1527         (get_host_for_message): Refactor some code so that we can easily
1528         get the right SoupSessionHost for proxies as well as from the
1529         message.
1530         (authenticate_auth): Take a gboolean proxy parameter.  Check it to
1531         see which URI (message URI or proxy URI) to use for
1532         authentication.  Add a long comment about lack of clarity in RFC
1533         2617 with respect to proxies and protection spaces.
1534
1535 2003-12-15  Dan Winship  <danw@ximian.com>
1536
1537         * libsoup/soup-socket.h (soup_socket_read, soup_socket_read_until,
1538         soup_socket_write): s/guint/gsize/ to match the definitions in
1539         soup-socket.c. #52167.
1540
1541 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
1542
1543         * libsoup/soup-soap-message.c: removed debugging of the messages here.
1544
1545 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
1546
1547         * libsoup/soup-soap-message.c (soup_soap_message_start_envelope):
1548         added information for SOAP-ENV namespace.
1549
1550 2003-12-10  Dan Winship  <danw@ximian.com>
1551
1552         * libsoup/soup-message-client-io.c (parse_response_headers): if we
1553         receive an HTTP/1.0 response to an HTTP/1.1 request, downgrade the
1554         message's http_version so the keep-alive handling is correct.
1555         Fixes a problem noticed almost simultaneously by Rodrigo and Joe.
1556
1557         * libsoup/soup-message.c (soup_message_restarted, etc): Add a
1558         "restarted" signal as suggested by Joe.
1559
1560         * libsoup/soup-message-io.c (soup_message_io_finished): emit
1561         either "restarted" or "finished" as appropriate
1562
1563         * libsoup/soup-session.c (soup_session_queue_message): Connect to
1564         "restarted" and run the queue if a message gets restarted
1565
1566         * libsoup/soup-status.h: Remove a stray comma that gtk-doc doesn't
1567         like.
1568
1569 2003-12-10  Tambet Ingo  <tambet@ximian.com>
1570
1571         * configure.in: Use autoconfig to check for socklen_t ...
1572
1573         * libsoup/soup-address.c: ... and remove it from here ...
1574
1575         * libsoup/soup-dns.c: ... and here.
1576
1577 2003-12-09  Rodrigo Moya <rodrigo@ximian.com>
1578
1579         * libsoup/soup-soap-message.c (soup_soap_message_persist):
1580         (soup_soap_message_parse_response): print out request/response's
1581         contents, if in debug mode.
1582
1583 2003-12-07  JP Rosevear  <jpr@ximian.com>
1584
1585         * configure.in: Bump version
1586
1587 2003-11-28  Rodrigo Moya <rodrigo@ximian.com>
1588
1589         * libsoup/soup-soap-response.[ch]
1590         (soup_soap_parameter_get_first_child,
1591         soup_soap_parameter_get_first_child_by_name,
1592         soup_soap_parameter_get_next_child,
1593         soup_soap_parameter_get_next_child_by_name): new functions to
1594         manage SoupSoapParameter's children.
1595         (soup_soap_response_get_first_parameter): dont return a GList, but
1596         a SoupSoapParameter contained in the GList.
1597
1598 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
1599
1600         * libsoup/soup-soap-response.[ch]
1601         (soup_soap_parameter_get_string_value): new function.
1602
1603 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
1604
1605         * libsoup/soup-soap-response.[ch]: added SoupSoapParameter
1606         structure, to "hide" the usage of xmlNode's.
1607         (soup_soap_parameter_get_name): functions to manage SOAP
1608         response parameters.
1609         (soup_soap_response_get_first_parameter,
1610         soup_soap_response_get_first_parameter_by_name,
1611         soup_soap_response_get_next_parameter,
1612         soup_soap_response_get_next_parameter_by_name):
1613         new functions for an easy access to the response's parameters.
1614         (soup_soap_response_from_string): removed warnings.
1615
1616 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
1617
1618         * libsoup/soup-soap-response.c (soup_soap_response_set_method_name):
1619         fixed typo.
1620
1621 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
1622
1623         * libsoup/soup-soap-response.[ch] (soup_soap_response_get_method_name,
1624         soup_soap_response_set_method_name, soup_soap_message_get_parameters):
1625         new functions.
1626         (finalize): NULL out new private fields.
1627         (soup_soap_response_from_string): added validation code.
1628
1629 2003-11-23  Rodrigo Moya <rodrigo@ximian.com>
1630
1631         * libsoup/soup-soap-response.[ch]: new class for managing SOAP
1632         responses.
1633
1634         * libsoup/soup-soap-message.[ch] (soup_soap_message_parse_response):
1635         new function.
1636
1637         * libsoup/Makefile.am: added new files.
1638
1639 2003-11-18  Rodney Dawes  <dobey@ximian.com>
1640
1641         * gtk-doc.make: Add gtk-doc.make to cvs for systems without gtk-doc
1642
1643 2003-11-18  Rodney Dawes  <dobey@ximian.com>
1644
1645         * acinclude.m4: Add GTK_DOC_CHECK
1646
1647 2003-11-18  Dan Winship  <danw@ximian.com>
1648
1649         * configure.in: Replace old gtk-doc test with GTK_DOC_CHECK()
1650         (AC_OUTPUT): add docs/Makefile, docs/reference/Makefile
1651
1652         * autogen.sh (REQUIRED_AUTOMAKE_VERSION): 1.6, for gtk-doc.make
1653
1654         * Makefile.am: updates for gtk-doc
1655         (SUBDIRS): add back "docs"
1656
1657         * docs/Makefile.am (EXTRA_DIST): remove, since those old docs
1658         aren't around any more
1659
1660         * docs/reference/*: set up gtk-doc
1661
1662         * libsoup/Makefile.am (INCLUDES): Change G_LOG_DOMAIN to
1663         "libsoup". Remove unused defines.
1664
1665         * libsoup/soup-connection.c: Fix doc comments
1666         * libsoup/soup-message.c: Likewise
1667         * libsoup/soup-misc.c: Likewise
1668         * libsoup/soup-socket.c: Likewise
1669         * libsoup/soup-uri.c: Likewise
1670
1671         * libsoup/soup-address.h: Fixes to please gtk-doc
1672         * libsoup/soup-connection.h: Likewise
1673         * libsoup/soup-message.h: Likewise
1674         * libsoup/soup-message-private.h: Likewise
1675         * libsoup/soup-misc.h: Likewise
1676         * libsoup/soup-server-auth.h: Likewise
1677         * libsoup/soup-socket.h: Likewise
1678         * libsoup/soup-status.h: Likewise
1679
1680 2003-11-18  Dan Winship  <danw@ximian.com>
1681
1682         * configure.in: Fix up the SSL checks some. Remove some useless
1683         old header checks.
1684
1685         * libsoup/soup-misc.h: declare soup_ssl_supported.
1686
1687         * libsoup/soup-gnutls.c: add soup_ssl_supported declaration.
1688
1689         * libsoup/soup-nossl.c: Not an SSL implementation, built if
1690         HAVE_SSL is not defined.
1691
1692         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): add soup-nossl.c
1693
1694         * libsoup/soup-socket.c (soup_socket_start_ssl): Return success or
1695         failure.
1696         (listen_watch): Deal with soup_socket_start_ssl failing.
1697
1698         * libsoup/soup-connection.c (tunnel_connect_finished,
1699         socket_connect_result, soup_connection_connect_sync): Deal with
1700         the soup_socket_start_ssl failing.
1701
1702         * libsoup/soup-server.c (soup_server_new): Deal with
1703         soup_ssl_get_server_credentials failing
1704
1705 2003-11-18  Rodrigo Moya <rodrigo@ximian.com>
1706
1707         * libsoup/soup-soap-message.[ch] (soup_soap_message_start_fault,
1708         soup_soap_message_end_fault, soup_soap_message_start_fault_detail,
1709         soup_soap_message_end_fault_detail, soup_soap_message_start_header,
1710         soup_soap_message_end_header,
1711         soup_soap_message_start_header_element,
1712         soup_soap_message_end_header_element, soup_soap_message_write_int,
1713         soup_soap_message_write_double, soup_soap_message_write_base64,
1714         soup_soap_message_write_time, soup_soap_message_write_string,
1715         soup_soap_message_write_buffer, soup_soap_message_set_element_type,
1716         soup_soap_message_set_null, soup_soap_message_add_attribute,
1717         soup_soap_message_add_namespace,
1718         soup_soap_message_set_default_namespace,
1719         soup_soap_message_get_namespace_prefix,
1720         soup_soap_message_set_encoding_style, soup_soap_message_reset,
1721         soup_soap_message_persist): new functions from old SoupSerializer.
1722
1723 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
1724
1725         * libsoup/soup-soap-message.[ch] (soup_soap_message_new,
1726         soup_soap_message_new_from_uri): added a bunch of initialization
1727         parameters.
1728         (soup_soap_message_get_xml_doc, soup_soap_message_start_envelope,
1729         soup_soap_message_end_envelope, soup_soap_message_start_body,
1730         soup_soap_message_end_body, soup_soap_message_start_element,
1731         soup_soap_message_end_element):
1732         new functions.
1733
1734         * configure.in: depend on libxml-2.0 for the SOAP code.
1735
1736         * libsoup/Makefile.am: use XML CFLAGS and LIBS.
1737
1738 2003-11-17  Joe Shaw  <joe@ximian.com>
1739
1740         * configure.in: Add in the --enable-libgpg-error flag from the 2.0
1741         branch.
1742
1743         * acinclude.m4: Include the gpg-error macros.
1744
1745 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
1746
1747         * libsoup/soup-soap-message.[ch]: new class to make it easier to
1748         build SOAP messages.
1749
1750         * libsoup/Makefile.am: added new files.
1751
1752         * configure.in: increased version number.
1753
1754 2003-10-24  Joe Shaw  <joe@ximian.com>
1755
1756         * libsoup/soup-address.c (update_address_from_entry): Call
1757         soup_dns_entry_get_hostent() on the SoupAddress passed in, not the
1758         one in addr->priv->lookup.  Fixes a crash on synchronous DNS
1759         lookups.
1760
1761         * libsoup/soup-server.c (soup_server_new): We need to ref the
1762         address we're binding to, because soup_socket_get_local_address()
1763         doesn't ref for us.
1764
1765 2003-10-23  Dan Winship  <danw@ximian.com>
1766
1767         * libsoup/soup-socket.c (init): Initialize flags to default
1768         values.
1769
1770 2003-09-23  Dan Winship  <danw@ximian.com>
1771
1772         * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but
1773         note whether or not the CA file has been loaded.
1774         (SoupGNUTLSChannel): add a "hostname" field.
1775         (verify_certificate): Remove the comment about not being able to
1776         verify the hostname because of soup problems. Now it's because of
1777         GNUTLS problems instead.
1778         (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel,
1779         and takes a hostname and a creds argument now.
1780         (soup_ssl_get_client_credentials,
1781         soup_ssl_get_server_credentials): Return client/server credentials
1782         structures.
1783         (soup_ssl_free_client_credentials,
1784         soup_ssl_free_server_credentials): and free them.
1785
1786         * libsoup/soup-session.c (class_init, set_property, get_property):
1787         add ssl_ca_file property
1788         (get_host_for_message): when returning an SSL host for the first
1789         time, create a client credentials structure for the session.
1790         (run_queue): Pass the ssl creds to the new connection. Also fix an
1791         unrelated bug that caused infinite loops on "bad hostname".
1792
1793         * libsoup/soup-server.c: Use GObject properties, including
1794         ssl_cert_file and ssl_key_file properties.
1795         (soup_server_new): Remove "protocol" argument; if the cert file
1796         and key file properties were set, create a server credential
1797         structure from them and pass that to soup_socket_server_new.
1798
1799         * libsoup/soup-connection.c (SoupConnectionPrivate): Rename
1800         dest_uri to origin_uri to match RFC 2616 terminology. Add an
1801         "ssl_creds" field.
1802         (class_init, set_property, get_property): add SSL_CREDS property
1803         (soup_connection_connect_async, soup_connection_connect_sync):
1804         Pass ssl_creds to soup_socket_client_new calls.
1805
1806         * libsoup/soup-socket.c: Use GObject properties, including an
1807         ssl_creds property
1808         (soup_socket_set_flags): Gone (replaced with boolean properties)
1809         (soup_socket_new): Make this take a list of properties
1810         (listen_watch): copy ssl creds from listener to new socket
1811         (soup_socket_start_ssl): Pass remote hostname and socket creds
1812         structure to soup_ssl_wrap_iochannel.
1813         (soup_socket_client_new_async, soup_socket_client_new_sync,
1814         soup_socket_server_new): Replace the SSL boolean with an ssl_creds
1815         structure.
1816
1817         * libsoup/soup-misc.c (soup_set_ssl_ca_file,
1818         soup_set_ssl_cert_files, soup_get_ssl_ca_file,
1819         soup_get_ssl_cert_files): Gone. SSL state is now per-session or
1820         per-server.
1821
1822         * tests/get.c: add a "-c CAfile" argument, for loading a CA
1823         certificate file to validate https connections against
1824
1825         * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile"
1826         arguments for loading an SSL server certificate. Only start an SSL
1827         server if those arguments were used.
1828
1829         * tests/test-cert.pem: 
1830         * tests/test-key.pem: SSL certificate for testing simple-httpd
1831
1832         * tests/revserver.c: Update for API changes
1833         * tests/simple-proxy.c: Likewise
1834
1835 2003-09-22  Dan Winship  <danw@ximian.com>
1836
1837         * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
1838         from soup-private.h
1839
1840         * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
1841         (soup_set_security_policy, soup_get_security_policy): Remove,
1842         since the GNUTLS backend doesn't actually implement it.
1843         (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
1844
1845         * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
1846         stuff.
1847
1848         * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
1849         soup-private.h
1850
1851         * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
1852         soup_ssl_get_server_iochannel into a single function that takes a
1853         SoupSSLType.
1854
1855         * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
1856         (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
1857         (soup_gnutls_set_security_policy): Gone
1858
1859         * libsoup/soup-gnutls.h
1860         * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
1861         soup-gnutls.c now
1862
1863         * libsoup/soup-socket.c: Move soup_sockaddr_max
1864         #define here from soup-private.h
1865         (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
1866         prototype.
1867
1868         * libsoup/soup-private.h: Gone
1869         
1870         * libsoup/soup-address.c: Fix #includes for soup-private.h and
1871         soup-misc.h changes
1872         * libsoup/soup-auth-digest.c: Likewise
1873         * libsoup/soup-auth.c: Likewise
1874         * libsoup/soup-connection-ntlm.c: Likewise
1875         * libsoup/soup-connection.c: Likewise
1876         * libsoup/soup-dns.c: Likewise
1877         * libsoup/soup-gnutls.c: Likewise
1878         * libsoup/soup-headers.c: Likewise
1879         * libsoup/soup-message-client-io.c: Likewise
1880         * libsoup/soup-message-handlers.c: Likewise
1881         * libsoup/soup-message-io.c: Likewise
1882         * libsoup/soup-message-server-io.c: Likewise
1883         * libsoup/soup-message.c: Likewise
1884         * libsoup/soup-server-message.c: Likewise
1885         * libsoup/soup-server.c: Likewise
1886         * libsoup/soup-session.c: Likewise
1887         * libsoup/soup-socket.c: Likewise
1888         * tests/auth-test.c: Likewise
1889
1890 2003-09-19  Dan Winship  <danw@ximian.com>
1891
1892         * libsoup/soup-address.c (update_address_from_entry): free the
1893         hostent.
1894
1895         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't leak
1896         the domain
1897
1898         * libsoup/soup-gnutls.c (soup_gnutls_get_iochannel): Add some more
1899         iochannel initialization. Not sure how this worked before...
1900
1901         * libsoup/soup-message.c (soup_message_cleanup_response): Renamed
1902         from soup_message_prepare (and a few things removed).
1903
1904         * libsoup/soup-message-client-io.c (soup_message_send_request):
1905         s/soup_message_prepare/soup_message_cleanup_response/
1906
1907         * libsoup/soup-message-io.c (io_read): Replace the final "\r\n"
1908         with "\0" on the headers before passing them to the parse
1909         function.
1910         (io_read): Call soup_message_cleanup_response after returning an
1911         informational response so the data doesn't leak.
1912
1913         * libsoup/soup-headers.c (soup_headers_parse): Update for
1914         soup-message-io.c:io_read change
1915
1916         * libsoup/soup-server.c (soup_server_new,
1917         soup_server_new_with_host): Don't leak the SoupAddress.
1918
1919         * libsoup/soup-session.c (class_init): Make PROP_PROXY_URI not
1920         CONSTRUCT_ONLY.
1921         (set_property): If the proxy uri changes, call
1922         soup_session_abort() and cleanup_hosts().
1923         (request_finished, final_finished): Fix a bug when requeuing
1924         messages.
1925
1926         * tests/libsoup.supp: valgrind suppression file for soup tests
1927
1928         * tests/Makefile.am (EXTRA_DIST): dist it.
1929         (noinst_PROGRAMS): move the former check_PROGRAMS to
1930         noinst_PROGRAMS instead.
1931
1932 2003-09-18  Dan Winship  <danw@ximian.com>
1933
1934         * libsoup/soup-message.c: Add wrote_informational and
1935         got_informational signals.
1936
1937         * libsoup/soup-message-client-io.c (get_request_headers): Set the
1938         EXPECT_CONTINUE flag on the message if that header is set.
1939
1940         * libsoup/soup-message-server-io.c (parse_request_headers):
1941         Likewise
1942
1943         * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
1944         when blocking on an expect-continue. Emit wrote_informational
1945         instead of wrote_headers in the 1xx case.
1946         (io_read): Set read_state to BLOCKING, not NOT_STARTED after
1947         reading a 100 Continue response. Emit got_informational instead of
1948         got_headers in the 1xx case.
1949
1950         * libsoup/soup-session.c (soup_session_send_message): Reorder
1951         things to deal with the fact that the message could finish right
1952         away if there is a connection available and the server is very
1953         close.
1954
1955         * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
1956         SOUP_STATUS_CLASS_TRANSPORT_ERROR.
1957
1958 2003-09-17  Dan Winship  <danw@ximian.com>
1959
1960         * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
1961         (one that pruned too little, one that pruned too much).
1962         (queue_message): When requeuing, don't run the queue;
1963         final_finished will take care of that later.
1964         (soup_session_abort): New, to cancel all pending requests.
1965
1966         * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
1967         the socket while waiting for the address to resolve
1968
1969 2003-09-17  Dan Winship  <danw@ximian.com>
1970
1971         * libsoup/soup-connection.c (soup_connection_new): Replaces the
1972         three previous soup_connection_new* functions and uses gobject
1973         properties to set the destination and proxy uris.
1974         (class_init): set up two more signals, authenticate and
1975         reauthenticate.
1976         (soup_connection_send_request): virtualize
1977         (send_request): Default implementation
1978
1979         * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
1980         also handles NTLM authentication. Includes all of the NTLM code
1981         formerly in soup-auth-ntlm.c.
1982
1983         * libsoup/soup-auth-ntlm.[ch]: Gone.
1984
1985         * libsoup/soup-auth.c: Remove NTLM refs
1986
1987         * libsoup/soup-session.c (class_init): Add gobject properties for
1988         proxy, max_conns, use_ntlm. Change the "authenticate" and
1989         "reauthenticate" signal prototypes to not pass a SoupAuth (so they
1990         can be used for authenticating SoupConnectionNTLM as well, which
1991         doesn't use a SoupAuth).
1992         (soup_session_new): Renamed from soup_session_new_default.
1993         (soup_session_new_with_options): Replaces
1994         soup_session_new_with_proxy and soup_session_new_full. Takes
1995         gobject properties.
1996         (run_queue): Create a new connection of type SoupConnection or
1997         SoupConnectionNTLM depending on our "use_ntlm" property. Connect
1998         to its authenticate and reauthenticate signals.
1999         (connection_authenticate, connection_reauthenticate): proxy these
2000         signals.
2001
2002         * libsoup/soup-address.c (update_address_from_entry): Fix a
2003         crasher when failing to resolve the address.
2004
2005         * libsoup/soup-dns.c (check_hostent): Fix some "how was this
2006         working before" bugs.
2007
2008         * libsoup/soup-message-client-io.c (soup_message_send_request):
2009         call soup_message_prepare() to clean up the existing response
2010         state.
2011
2012         * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
2013         when processing an OK EOF.
2014
2015         * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
2016         these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
2017
2018         * tests/auth-test.c (authenticate, reauthenticate): Update for new
2019         prototypes.
2020         (main): Use soup_session_new.
2021         * tests/get.c (main): Likewise.
2022         * tests/simple-proxy.c (main): Likewise.
2023
2024 2003-09-10  Dan Winship  <danw@ximian.com>
2025
2026         * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
2027         signals.
2028         (invalidate_auth): Remove the call to soup_auth_invalidate.
2029         (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
2030         contain authentication, then emit "authenticate" or
2031         "reauthenticate" (depending on whether or not this is the first
2032         time we've asked for a password for this auth).
2033         (update_auth_internal): If the server rejects our
2034         username/password, don't bail out immediately. Try doing a
2035         "reauthenticate" first.
2036
2037         * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
2038
2039         * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
2040         "pref" arg.
2041         (soup_auth_invalidate): Remove this; it doesn't actually do
2042         anything useful for us.
2043
2044         * libsoup/soup-auth-basic.c (invalidate): Remove
2045         * libsoup/soup-auth-digest.c: (invalidate): Remove
2046         * libsoup/soup-auth-ntlm.c: (invalidate): Remove
2047
2048         * libsoup/soup-uri.c: Remove all references to "authmech".
2049         (soup_uri_set_auth): Remove this too.
2050
2051         * tests/auth-test.c: Update to use the "authenticate" and
2052         "reauthenticate" signals instead of encoding usernames and
2053         passwords in the URIs. Add a few more test cases.
2054
2055 2003-09-10  Dan Winship  <danw@ximian.com>
2056
2057         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
2058         "status" field from here, since it's mostly used by SoupSession,
2059         which shouldn't need access to SoupMessagePrivate.
2060
2061         * libsoup/soup-message.h (SoupMessage): Move it here.
2062         (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
2063         (soup_message_set_uri): also moved from soup-message-private.h
2064
2065         * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
2066
2067         * libsoup/soup-message-handlers.c:
2068         s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
2069
2070         * libsoup/soup-message-io.c (soup_message_io_client,
2071         soup_message_io_server, soup_message_io_unpause): Don't set up an
2072         idle handler, just jump right in to reading/writing; if this is a
2073         synchronous socket, then the caller wants to block, and if it's
2074         not, then we'll quickly get an EAGAIN anyway.
2075
2076         * libsoup/soup-session.c: (queue_message): Likewise.
2077         (*) Update for SoupMessageStatus move and remove
2078         soup-message-private.h include.
2079
2080         * libsoup/soup-server-message.c: Remove soup-message-private.h
2081         include.
2082
2083         * libsoup/soup-server.c: Likewise.
2084
2085         * libsoup/soup-connection.c (soup_connection_is_connected,
2086         soup_connection_is_new): Remove these, since they weren't being
2087         used.
2088
2089         * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
2090         avoid namespace pollution.
2091
2092         * libsoup/soup-auth-digest.c: Update for that.
2093         * libsoup/soup-server-auth.c: Likewise
2094
2095         * tests/auth-test.c: Remove soup-message-private.h include
2096
2097 2003-09-09  Dan Winship  <danw@ximian.com>
2098
2099         Beginnings of improved synchronous API support
2100
2101         * libsoup/soup-dns.c: Simplify this by making it not automatically
2102         return the result: force the caller to poll. (This isn't really a
2103         performance issue: the results should come back quickly anyway.)
2104         Also, make the cache thread-safe.
2105         (soup_dns_entry_from_name): Was soup_gethostbyname
2106         (soup_dns_entry_from_addr): Was soup_gethostbyaddr
2107         (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
2108         (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
2109         blocks if it's not resolved yet).
2110
2111         * libsoup/soup-address.c: Update for soup-dns changes.
2112         (soup_address_new): Don't automatically start resolving the
2113         hostname now, since we don't know if the caller is going to want
2114         it resolved synchronously or asynchronously.
2115         (soup_address_resolve_async): Renamed from soup_address_resolve.
2116         (soup_address_resolve_sync): New routine to do blocking
2117         synchronous DNS.
2118
2119         * libsoup/soup-socket.c (soup_socket_connect): Now returns a
2120         status value directly when connecting synchronously.
2121         (soup_socket_client_new_async, soup_socket_client_new_sync):
2122         Separate async/sync client socket functions.
2123         (soup_socket_get_iochannel): Made static since it was not used
2124         outside soup-socket.
2125
2126         * libsoup/soup-connection.c (soup_connection_new,
2127         soup_connection_new_proxy, soup_connection_new_tunnel): Just set
2128         up the data, don't actually start connecting.
2129         (soup_connection_connect_async, soup_connection_connect_sync): New
2130         async and sync SoupConnection connecting routines.
2131         (soup_connection_get_socket): Remove this since it wasn't being
2132         used.
2133
2134         * libsoup/soup-session.c (final_finished): Run the queue since a
2135         connection is now freed up.
2136         (run_queue): Update for soup_connection_new* changes.
2137
2138         * libsoup/soup-misc.c (soup_substring_index): Remove, since it
2139         wasn't being used any more.
2140
2141         * libsoup/soup-private.h: Remove some prototypes for functions
2142         that no longer exist.
2143
2144         * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
2145         (copies the protocol, host, and port of a SoupUri).
2146
2147         * tests/auth-test.c:
2148         * tests/get.c:
2149         * tests/simple-proxy.c: belatedly update for soup-session change
2150
2151         * tests/revserver.c: Handle each new connection in its own thread,
2152         using synchronous SoupSocket calls.
2153
2154 2003-09-05  Dan Winship  <danw@ximian.com>
2155
2156         * libsoup/soup-session.c: Move a bunch of logic here from
2157         soup-context. Now the session keeps track of hosts (instead of
2158         having a global soup_hosts hash) and their connections.
2159         (soup_session_new_with_proxy, soup_session_new_full): New session
2160         constructors to specify a proxy or a proxy and connection limits
2161         (send_request): Add Authorization and Proxy-Authorization headers
2162         before sending off the request.
2163         (soup_session_queue_message, et al): Improve the way this works.
2164         There's no need to use timeouts to wait for connections to become
2165         free; we *know* when they become free.
2166
2167         * libsoup/soup-private.h: Remove SoupHost and some other
2168         no-longer-used stuff.
2169
2170         * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
2171         soup_set_connection_limit, soup_set_connection_limit): Gone. These
2172         are all per-session now.
2173
2174         * libsoup/soup-message.c: Remove all SoupContext references
2175         (mostly replaced with SoupUri references)
2176         (cleanup_message): priv->connect_tag and priv->connection are gone
2177         now, so this was just soup_message_io_cancel(). So remove
2178         cleanup_message and replace it with that everywhere.
2179         (soup_message_disconnect): Gone.
2180         (soup_message_set_uri): Replaces soup_message_set_context.
2181         (soup_message_set_connection, soup_message_get_connection): Gone
2182
2183         * libsoup/soup-message-server-io.c (parse_request_headers):
2184         s/soup_message_set_context/soup_message_set_uri/
2185
2186         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
2187         connect_tag, context, and connection.
2188
2189         * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
2190
2191         * libsoup/soup-context.c: Gone
2192
2193         * tests/auth-test.c (identify_auth): update for session/context
2194         changes
2195
2196 2003-09-03  Dan Winship  <danw@ximian.com>
2197
2198         * libsoup/soup-status.h: Renamed from soup-error.h, with types
2199         and defines renamed accordingly.
2200
2201         * libsoup/soup-message.h (SoupMessage): Rename errorcode to
2202         status_code and errorphrase to reason_phrase. Remove errorclass.
2203         (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
2204         as being either "errors" or "not errors", so its semantics are
2205         guaranteed to be wrong sometimes.
2206
2207         * libsoup/soup-message.c (soup_message_set_status,
2208         soup_message_set_status_full): Renamed
2209
2210         * libsoup/soup-message-handlers.c
2211         (soup_message_add_status_code_handler,
2212         soup_message_add_status_class_handler): Rename.
2213
2214         * libsoup/soup-session.c (soup_session_send_message): Make this
2215         return a status code rather than a status class.
2216
2217         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
2218         unrelated unused fields (retries, callback, user_data).
2219
2220         * ...: Updates
2221
2222 2003-09-02  Dan Winship  <danw@ximian.com>
2223
2224         * libsoup/soup-session.c: First draft at the new object to
2225         maintain formerly-global state. (Not yet complete; still need to
2226         get rid of SoupContext).
2227
2228         * libsoup/soup-message-queue.c: Data structure used by SoupSession
2229
2230         * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
2231         some bits went into soup-connection.
2232
2233         * libsoup/soup-connection.c (soup_connection_send_request): New,
2234         to send a request on a connection. The connection updates its
2235         internal state and then hands off to soup_message_send_request.
2236         (request_done): Callback set up by soup_connection_send_request.
2237         Marks the connection as no-longer-in-use, and disconnects it if
2238         the message says to.
2239         (soup_connection_set_in_use, soup_connection_mark_old): No longer
2240         needed; the connection takes care of this itself now.
2241         (soup_connection_new_proxy): New, to create a new connection that
2242         is explicitly marked as being through an HTTP proxy.
2243         (soup_connection_new_tunnel): New, to create a new HTTPS
2244         connection through a proxy. (Includes the code to send the
2245         CONNECT.)
2246
2247         * libsoup/soup-context.c (try_existing_connections): Don't need to
2248         call soup_connection_set_in_use.
2249         (try_create_connection): Use soup_connection_new,
2250         soup_connection_new_proxy, or soup_connection_new_tunnel as
2251         appropriate.
2252
2253         * libsoup/soup-message.c (soup_message_prepare): Replaces
2254         queue_message.
2255         (soup_message_queue, soup_message_requeue, soup_message_prepare):
2256         Gone. This must be done via a SoupSession now.
2257         (soup_message_set_connection): don't need to mark in_use/not
2258         in_use. Also, msg->priv->socket is gone now.
2259         (soup_message_get_socket): Gone.
2260
2261         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
2262         Remove references to global handlers.
2263         (redirect_handler, authorize_handler): Moved to soup-session.c.
2264
2265         * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
2266         session to shut down now.
2267
2268         * libsoup/soup.h: add soup-session.h
2269
2270         * libsoup/Makefile.am: updates
2271
2272         * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
2273         SoupSession.
2274
2275 2003-08-29  Dan Winship  <danw@ximian.com>
2276
2277         * libsoup/soup-message-io.c: Major rewrite. There is now only a
2278         single IO state object (instead of one for reading and one for
2279         writing), and the IO code handles switching back and forth between
2280         reading and writing as appropriate (including handling the extra
2281         switches needed for "Expect: 100-continue").
2282         (soup_message_io_client, soup_message_io_server): The new entry
2283         points.
2284         (soup_message_io_cancel): If the caller cancels the IO when we
2285         were expecting to read more data, disconnect the socket.
2286
2287         * libsoup/soup-message.h (SoupMessageFlags): add
2288         SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
2289         do the special expect-continue handling.
2290
2291         * libsoup/soup-message.c: Move all the signal stuff here. Remove
2292         the "done_reading" and "done_writing" signals and replace them
2293         with a single "finished" signal. (A single signal. Say that 10
2294         times fast!)
2295         (soup_message_got_headers, etc): Functions to emit signals.
2296         (got_headers, got_chunk, got_body): Default signal methods that
2297         call soup_message_run_handlers.
2298         (finished): Default signal method that replaces
2299         soup_message_issue_callback.
2300         ([various]): s/soup_message_issue_callback/soup_message_finished/
2301         (soup_message_requeue): There's no soup_message_set_read_callbacks
2302         any more, so if the caller requeues while it's still reading, just
2303         cancel the read.
2304         (soup_message_add_chunk, soup_message_add_final_chunk,
2305         soup_message_pop_chunk): Moved here from soup-server-message,
2306         although we don't actually quite support using chunked encoding
2307         for requests yet.
2308
2309         * libsoup/soup-server-message.c (soup_server_message_new): No
2310         longer takes a socket argument.
2311         (soup_server_message_add_chunk, soup_server_message_get_chunk):
2312         Moved into SoupMessage.
2313
2314         * libsoup/soup-message-handlers.c (global_handlers): Make these
2315         POST_BODY rather than PRE_BODY, so they won't mess up the IO
2316         channel when the requeue the message.
2317         (soup_message_run_handlers): Don't need to issue the message
2318         callback from here any more.
2319         (authorize_handler): Just leave the error as 401 or 407 (see
2320         soup-error.h change)
2321
2322         * libsoup/soup-message-client-io.c (soup_message_send_request):
2323         Replaces soup_message_write_request and
2324         soup_message_read_response.
2325
2326         * libsoup/soup-message-server-io.c: Parallel to
2327         soup-message-client-io.c, this defines the server-side header
2328         handling.
2329         (soup_message_read_request): Its entry point.
2330
2331         * libsoup/soup-server.c: Lots of code moved into
2332         soup-message-server-io.c. Update for other changes.
2333
2334         * libsoup/soup-queue.c: Update for changes
2335
2336         * libsoup/soup-socket.c (read_from_network, soup_socket_write):
2337         Don't call soup_socket_disconnect() on an error, just return
2338         SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
2339         signals that will mess up the caller of the read/write function.
2340
2341         * libsoup/soup-connection.c (soup_connection_disconnect): When
2342         disconnecting the socket, disconnect from its signals first to
2343         prevent bad reentrancy.
2344
2345         * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
2346         SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
2347         anything that SOUP_ERROR_UNATHORIZED and
2348         SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
2349         "transport" errors actually are transport-related.)
2350
2351         * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
2352
2353         * tests/simple-proxy.c: Complicate this a bunch. In particular,
2354         use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
2355         pass the data back to the client in chunked format.
2356
2357 2003-08-27  Dan Winship  <danw@ximian.com>
2358
2359         * libsoup/soup-types.h: New header with typedefs, to avoid
2360         #include loops among other headers.
2361
2362         * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
2363
2364         * libsoup/*.[ch], tests/*.c: Update for soup-types.h
2365         
2366 2003-08-26  Dan Winship  <danw@ximian.com>
2367
2368         * libsoup/soup-message-client-io.c (soup_message_write_request,
2369         soup_message_read_response): Higher-than-soup-message-io-level
2370         functions to do client-side IO. (Code that used to be in
2371         soup-queue.c)
2372         (get_request_header_cb): Fix a bug in the generation of the Host:
2373         header; need to include the port number if it's not the default.
2374
2375         * libsoup/soup-message-io.c (soup_message_write,
2376         soup_message_write_simple): Take separate user_datas for the get_*
2377         callbacks and the done callbacks.
2378
2379         * libsoup/soup-queue.c: Update to use soup_message_write_request
2380         and soup_message_read_response.
2381
2382         * libsoup/soup-connection.c (soup_connection_new): Change the
2383         prototype to take a SoupUri and a callback.
2384
2385         * libsoup/soup-context.c (try_create_connection,
2386         soup_context_connect_cb): Update for soup_connection_new change.
2387
2388         * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
2389         for soup_message_write changes
2390
2391         * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
2392         function
2393
2394 2003-08-26  Dan Winship  <danw@ximian.com>
2395
2396         * libsoup/soup-message-private.h: Define SoupMessage signal stuff
2397         (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
2398         WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
2399
2400         * libsoup/soup-message.c (class_init): set up signals
2401         (requeue_read_finished): Update for changes.
2402
2403         * libsoup/soup-message-io.c (soup_message_read): Split out
2404         parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
2405         arg to say where to store the message body. Set up
2406         read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
2407         signal handlers.
2408         (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
2409         (read_body_chunk): emit READ_CHUNK.
2410         (issue_final_callback): Set r->body. emit READ_BODY.
2411         (failed_read): emit READ_ERROR.
2412         (soup_message_read_set_callbacks): Disconnect old signal handlers,
2413         connect new ones.
2414         (soup_message_read_cancel): Disconnect signal handlers.
2415         (soup_message_write, soup_message_write_simple): Set up
2416         wrote_body_cb and error_cb as signal handlers.
2417         (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
2418         nothing currently ever listens for them. emit WROTE_BODY when
2419         done.
2420         (failed_write): emit WRITE_ERROR
2421
2422         * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
2423         soup_queue_read_headers_cb): Split this into two unequal chunks.
2424         (read_header_cb only runs the pre-body handlers).
2425         (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
2426         prototypes.
2427         (soup_queue_write_done_cb): Update call to soup_message_read
2428
2429         * libsoup/soup-server.c (parse_headers_cb): Renamed from
2430         read_headers_cb
2431         (read_done_cb): Update prototype
2432         (start_request): Update soup_message_read call.
2433
2434 2003-08-25  Dan Winship  <danw@ximian.com>
2435
2436         * libsoup/soup-message-io.c (soup_message_read,
2437         soup_message_write, soup_message_write_simple): Add a "user_data"
2438         arg, pass it to the callbacks.
2439
2440         * libsoup/soup-message.c (soup_message_requeue,
2441         requeue_read_finished, requeue_read_error): Update for that
2442
2443         * libsoup/soup-queue.c: Likewise
2444
2445         * libsoup/soup-server.c: Likewise
2446
2447 2003-08-25  Dan Winship  <danw@ximian.com>
2448
2449         * libsoup/soup-message.c (soup_message_new): Take a uri string
2450         instead of a context. Also, swap the args (so the method comes
2451         before the URI, just like in the protocol).
2452         (soup_message_new_from_uri): Like soup_messgae_new, but takes a
2453         SoupUri instead of a string
2454         (soup_message_set_request, soup_message_set_response): Replace
2455         soup_message_new_full.
2456         (cleanup_message): Was soup_message_cleanup, but is static now.
2457         (queue_message): Do the pre-queuing message cleanup here instead
2458         of in soup_queue_message.
2459         (soup_message_queue): Set the callback and user_data, then call
2460         queue_message.
2461         (requeue_read_error, requeue_read_finished, soup_message_requeue):
2462         Use queue_message
2463         (soup_message_get_uri): Replaces soup_message_get_context.
2464
2465         * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
2466         part of SoupMessagePrivate now)
2467
2468         * libsoup/soup-context.c: #include soup-message-private
2469         (soup_context_from_uri): constify the uri arg.
2470
2471         * libsoup/soup-queue.c: Various context/uri fixes
2472         (proxy_https_connect): Use soup_message_new_from_uri.
2473         (soup_queue_message): Drastically simplified since most of the
2474         work is in soup-messsage.c:queue_message() now
2475
2476         * libsoup/soup-auth-digest.c (compute_response,
2477         get_authorization): Use soup_message_get_uri.
2478
2479         * libsoup/soup-server-auth.c (parse_digest): Likewise
2480
2481         * libsoup/soup-server.c (call_handler): Likewise
2482
2483         * tests/simple-httpd.c (server_callback): Likewise.
2484
2485         * tests/simple-proxy.c (server_callback): Likewise
2486
2487         * tests/get.c (got_url): Likewise.
2488         (get_url): Update soup_message_new usage.
2489
2490         * tests/auth-test.c: #include soup-message-private. Update for
2491         context changes and soup_message_new change.
2492
2493 2003-08-22  Dan Winship  <danw@ximian.com>
2494
2495         * libsoup/soup-message-private.h: New file containing
2496         SoupMessagePrivate and some other soup-message-internal
2497         types/functions. Also includes the new, expanded SoupMessageStatus
2498         enum.
2499
2500         * libsoup/soup-message-io.c: Replaces what used to be in
2501         soup-transfer, but now all the interfaces take SoupMessages
2502         instead of SoupReader/SoupWriter and deal with maintaining
2503         msg->priv->{read,write}_state themselves. Fixes up all the
2504         refcounting madness.
2505
2506         * libsoup/soup-message-handlers.c: Move the handler code here,
2507         mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
2508         to make the distinction from SoupHandlerKind clearer.)
2509
2510         * libsoup/soup-message.c: Update for soup-message-io and new
2511         SoupMessageStatus values. Remove handler code.
2512         (soup_message_cleanup): Remove the hack to try to preserve the
2513         connection if the message gets cleaned up before it finishes
2514         reading. soup_message_requeue handles this in the requeuing case,
2515         and there's no especially compelling reason to bother doing it in
2516         any other case. (And the soup-message-io api doesn't support
2517         having a read operation that's not connected to any message.)
2518
2519         * libsoup/soup-private.h: remove SoupMessagePrivate
2520
2521         * libsoup/soup-queue.c: Update for soup-message-io and new
2522         SoupMessageStatus values.
2523
2524         * libsoup/soup-server-message.c: Likewise
2525
2526         * libsoup/soup-server.c: Likewise
2527
2528         * libsoup/soup-transfer.c: Gone (yay)
2529
2530         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
2531
2532 2003-08-20  Dan Winship  <danw@ximian.com>
2533
2534         * libsoup/soup-message.c: Make this a GObject. (Note that since
2535         SoupMessage was not refcounted before, it's not really refcounted
2536         now either. TBF)
2537         (soup_message_free): Gone, replaced by g_object_unref
2538         (soup_message_copy, soup_message_foreach_remove_header): Remove
2539         these, since neither was currently functional.
2540         (soup_message_is_keepalive): New utility function to look at
2541         HTTP version and request/response headers to decide if a message
2542         indicates the connection should be kept alive.
2543         (soup_message_set_connection, soup_message_get_connection): New
2544         (soup_message_get_socket): New
2545
2546         * libsoup/soup-server-message.c: Make this a subclass of
2547         SoupMessage.
2548         (soup_server_message_new): Now takes a SoupServer and SoupSocket
2549         (soup_server_message_get_server): New
2550         (soup_server_message_set_encoding,
2551         soup_server_message_get_encoding): Get/set whether the message
2552         should be sent with content-length or chunked encoding
2553         (soup_server_message_is_started, soup_server_message_is_finished):
2554         Private member accessors.
2555         (soup_server_message_add_chunk): Renamed from add_data
2556         (soup_server_message_get_chunk): Pops a chunk from the list.
2557         (soup_server_message_get_source): Gone
2558
2559         * libsoup/soup-server.c: Update for SoupServerMessage changes.
2560         (error_cb, write_done_cb): All the cleanup stuff that used to be
2561         here happens automatically by unreffing the message now.
2562         (get_response_header): Remove some erroneous leftover CGI stuff
2563         (issue_bad_request): add "Connection: close" to the response.
2564         (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
2565         with no Host header as per RFC 2616.
2566
2567         * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
2568         (soup_connection_set_in_use): Let the caller set the connection to
2569         "not in use" even after the socket has been disconnected.
2570
2571         * libsoup/soup-context.c: Use soup_message_get_connection
2572
2573         * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
2574         check on request length, since it was rejecting
2575         "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
2576
2577         * libsoup/soup-queue.c: Use soup_message_get_connection and
2578         soup_message_get_socket.
2579         (soup_queue_read_done_cb): Use soup_message_is_keepalive
2580         (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
2581         soup_connection_start_ssl
2582
2583         * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
2584         handlers if the socket hasn't been disconnected yet.
2585
2586         * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
2587         reader_read): Fix these so that reader_read will exit properly if
2588         the read is cancelled.
2589
2590         * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
2591
2592         * tests/simple-httpd.c (server_callback): set the message to
2593         content-length encoding.
2594         * tests/simple-proxy.c (server_callback): Likewise
2595
2596 2003-08-19  Dan Winship  <danw@ximian.com>
2597
2598         * libsoup/soup-socket.c (soup_socket_read,
2599         soup_socket_read_until, soup_socket_write): New API for doing
2600         socket IO. Works both synchronously and asynchronously, and
2601         buffers data to prevent the "100 Continue" problem.
2602         (soup_socket_set_flag): Replaces formerly-private
2603         soup_set_sockopts. (primarily to let the caller turn off
2604         SOUP_SOCKET_FLAG_NONBLOCKING).
2605
2606         * libsoup/soup-transfer.c (soup_transfer_read,
2607         soup_transfer_write, soup_transfer_write_simple): Take a
2608         SoupSocket instead of a GIOChannel. Use the new socket IO api.
2609         Changed the prototypes of some of the callbacks to be less
2610         hackish.
2611
2612         * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
2613         soup_connection_get_iochannel.
2614
2615         * libsoup/soup-message.c: Fix up for soup-transfer changes
2616
2617         * libsoup/soup-queue.c: Likewise
2618
2619         * libsoup/soup-server.c: Likewise
2620
2621         * tests/revserver.c: A slightly more complicated replacement for
2622         timeserver. (Does both reads and writes)
2623
2624 2003-08-19  Dan Winship  <danw@ximian.com>
2625
2626         * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
2627         configure it, and no one has complained, and it looks like the
2628         SOCKS5 auth code doesn't actually work anyway...
2629
2630         * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
2631
2632         * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
2633         SOUP_PROTOCOL_SOCKS5
2634
2635         * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
2636
2637         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
2638         soup-socks.[ch]
2639
2640 2003-08-19  Dan Winship  <danw@ximian.com>
2641
2642         * libsoup/soup-server.c: Make this a GObject. Remove
2643         SoupServerMessage code (to soup-server-message.c). Remove CGI
2644         server code (for now?)
2645         (soup_server_add_handler, soup_server_remove_handler): Rename
2646         (from register/unregister) to make it clearer what they do.
2647
2648         * libsoup/soup-server-message.c: Moved out of soup-server.c
2649
2650         * libsoup/soup-private.h: Remove SoupServer def
2651
2652         * libsoup/Makefile.am (libsoupinclude_HEADERS,
2653         libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
2654
2655         * tests/simple-httpd.c: 
2656         * tests/simple-proxy.c: Update for SoupServer changes
2657
2658 2003-08-18  Dan Winship  <danw@ximian.com>
2659
2660         * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
2661         a struct sockaddr again (like it used to be). In particular, add
2662         back the "port" field. Add a bunch of macros to try (and fail) to
2663         simplify some of the code.
2664         (soup_address_new): Now returns a SoupAddress directly rather than
2665         a random handle, and the caller can just use g_object_unref to
2666         cancel the lookup. Also, the callback now uses a
2667         SoupKnownErrorCode rather than a special-purpose address-lookup
2668         error code.
2669         (soup_address_new_cancel): No longer needed.
2670         (soup_address_new_sync): Removed
2671         (soup_address_new_any): Replaces soup_address_ipv4_any and
2672         soup_address_ipv6_any.
2673         (soup_address_get_name, etc): Gone. Use soup_address_resolve()
2674         now.
2675         (soup_address_get_physical): Renamed from
2676         soup_address_get_canonical_name.
2677         (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
2678
2679         * libsoup/soup-socket.c: Update for SoupAddress changes and make
2680         similar changes here.
2681         (soup_socket_new): Just creates a generic SoupSocket now.
2682         (soup_socket_connect): Client setup
2683         (soup_socket_listen): Server setup. Now also sets up an iochannel
2684         listening for connects and emits a "new_connection" signal as they
2685         come in.
2686         (soup_socket_start_ssl): Turns on SSL.
2687         (soup_socket_client_new, soup_socket_server_new): Utility
2688         functions that wrap the above.
2689         (soup_socket_new_cancel, soup_socket_new_sync): Gone
2690         (soup_socket_server_accept, soup_socket_server_try_accept): No
2691         longer needed.
2692         (soup_socket_get_iochannel): No longer adds a ref when returning
2693         the iochannel. Also, we set it to "close_on_unref" so that if a
2694         caller adds a ref to it, the connection will actually remain open
2695         even after the SoupSocket is destroyed.
2696         (soup_socket_get_local_address, soup_socket_get_remote_address):
2697         Let the caller get both of these.
2698
2699         * libsoup/soup-connection.c: Don't keep a private copy of the
2700         socket's iochannel.
2701         (soup_connection_new): Don't need to set socket options here.
2702         SoupSocket does it.
2703         (soup_connection_start_ssl): Just call soup_socket_start_ssl.
2704         (soup_connection_get_iochannel): Just return the socket's
2705         iochannel (and don't ref it)
2706
2707         * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
2708         SOUP_ERROR_CANT_RESOLVE_PROXY
2709
2710         * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
2711         Remove the "FIXME add a CANT_RESOLVE error" and return
2712         SOUP_ERROR_CANT_RESOLVE instead.
2713
2714         * libsoup/soup-server.c: Update for socket/address changes. Don't
2715         poke into SoupSocket's private fields.
2716         (soup_server_run_async): Just connect to the socket's
2717         "new_connection" signal.
2718
2719         * libsoup/soup-context.c (try_create_connection,
2720         soup_context_connect_cb): Update for socket changes. Replace
2721         SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
2722
2723         * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
2724         to connect to a signal handler and connect another function to
2725         clean up the first signal handler after its first invocation.
2726         (Lets us use signals to replace one-off callbacks.)
2727
2728         * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
2729         actually private now.
2730         (struct _SoupServer): Remove accept_tag.
2731
2732         * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
2733         Don't unref the iochannel.
2734         (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
2735
2736         * libsoup/soup-socks.c: Update for socket/address changes
2737
2738         * tests/simple-httpd.c (main):
2739         s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
2740         * tests/simple-proxy.c (main): Likewise
2741
2742         * tests/timeserver.c: Update for SoupSocket's "new_connection"
2743         signal, and for SoupAddress changes.
2744
2745 2003-08-14  Dan Winship  <danw@ximian.com>
2746
2747         * libsoup/soup-connection.c: New, split out from soup-context and
2748         made into a GObject.
2749         (soup_connection_disconnect): Disconnects the connection and emits
2750         a signal. (Replaces the old "keep_alive" flag.)
2751         (soup_connection_is_connected): Checks if the connection is still
2752         connected
2753         (connection_died): Just disconnect, rather than freeing the
2754         connection. This way if anyone else is still referencing it they
2755         won't end up with an invalid pointer.
2756
2757         * libsoup/soup-context.c: Make this a GObject, remove all the
2758         SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
2759         SoupContext can keep track of connection auth stuff there without
2760         SoupConnection needing to care. Various other updates.
2761
2762         * libsoup/soup-private.h: Remove SoupContext and SoupConnection
2763         definitions.
2764
2765         * libsoup/*.c, tests/get.c: Update for context/connection changes
2766
2767         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
2768         definition to deal with the fact that there's no
2769         soup_connection_get_context any more.
2770
2771         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
2772         with connection persistence here.
2773         (soup_queue_read_done_cb): Do it here instead. Disconnect the
2774         connection when appropriate.
2775         (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
2776         Reference-count the connection properly. (I think.)
2777
2778         * libsoup/soup-marshal.list: New, for SoupConnection's
2779         "disconnected" signal.
2780
2781         * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
2782
2783         * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
2784         GLIB_GENMARSHAL gets set too.
2785
2786 2003-08-14  Dan Winship  <danw@ximian.com>
2787
2788         * libsoup/soup-error.c: Fix a spelling mistake.
2789
2790         * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
2791
2792 2003-08-12  Dan Winship  <danw@ximian.com>
2793
2794         * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
2795         of the interfaces around a little bit.
2796
2797         * libsoup/soup-auth-basic.c: subclass for Basic auth
2798
2799         * libsoup/soup-auth-digest.c: subclass for Digest auth
2800
2801         * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
2802         the code from soup-ntlm.c here, and make it private.
2803
2804         * libsoup/soup-ntlm.c: gone
2805
2806         * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
2807         here, and change the signature of SoupAuthorizeFn.
2808
2809         * libsoup/soup-context.c: Use g_object_unref to free auths, use
2810         methods instead of directly access private fields.
2811
2812         * libsoup/soup-queue.c: Likewise
2813
2814         * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
2815         NTLM references. We have no plans to implement server-side NTLM
2816         auth.
2817
2818         * tests/auth-test.c (identify_auth): Update for auth api changes
2819
2820 2003-08-12  Dan Winship  <danw@ximian.com>
2821
2822         * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
2823         call
2824
2825         * libsoup/soup-address.c: Make this a GObject.
2826         (soup_address_ref, soup_address_unref): Gone.
2827         (soup_address_copy): Gone. Wasn't being used anyway.
2828
2829         * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
2830         here from soup-address.c, so that soup-address doesn't need to
2831         worry about trying to cache zero-ref addresses.
2832
2833         * libsoup/soup-socket.c: Make this a GObject. Use "guint"
2834         consistently for port numbers.
2835         (soup_socket_ref, soup_socket_unref): Gone.
2836
2837         * libsoup/soup-private.h: Change the SoupSocket definition to be
2838         SoupSocketPrivate. (Still need to keep this here since soup-server
2839         pokes around in its internals.)
2840         (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
2841
2842         * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
2843         reader/writer rather than leaking them.
2844
2845         * libsoup/*: Use GObject methods for socket/address refcounting
2846         
2847         * tests/auth-test.c (main)
2848         * tests/timeserver.c (main): Call g_type_init.
2849
2850         * tests/get.c (main): Call g_type_init.
2851         (get_url, got_url): Fix some bugs that could make -r mode get into
2852         infinite loops downloading the same files over and over. Plug some
2853         memory leaks to make this more useful for valgrinding libsoup.
2854
2855         * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
2856         handler for SIGINT so we can exit cleanly, since valgrind won't
2857         give a leak report if you don't. Plug a few memory leaks.
2858
2859         * tests/simple-proxy.c (main): Likewise 
2860
2861 2003-08-12  Dan Winship  <danw@ximian.com>
2862
2863         Pull over some new test programs from the soup-refactoring branch,
2864         along with the SoupUri changes they depend on.
2865
2866         * tests/simple-httpd.c: A really simple HTTP server, to test the
2867         server code.
2868
2869         * tests/simple-proxy.c: An even simpler HTTP proxy
2870
2871         * tests/get.c: Add "-r" flag to recursively get files (thereby
2872         testing multiple-connections-at-once code). Also good for setting
2873         up a tree to use with simple-httpd.
2874
2875         * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
2876         normal case)
2877
2878         * tests/uri-parsing.c: Regression test for the new soup-uri.c
2879
2880         * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
2881         pull in some optimizations from camel-url. Also, make SoupProtocol
2882         a GQuark so we can still compare them with ==, but we can also
2883         recognize any protocol.
2884         (soup_uri_new_with_base): New, to merge base and relative URIs
2885         (soup_uri_to_string): Update this. Change the "show_password" flag
2886         (which we always passed FALSE for) to "just_path", for places that
2887         want the path+query without the protocol, host, etc.
2888
2889         * libsoup/soup-queue.c (soup_get_request_header): Just use
2890         soup_uri_to_string to generate the request URI.
2891
2892         * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
2893         "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
2894         the URI by hand badly.
2895         * libsoup/soup-server-auth.c (parse_digest): Likewise
2896
2897         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
2898         switch() to an series of if()s since SOUP_PROTOCOL_* aren't
2899         constants any more.
2900
2901         * libsoup/soup-context.c (soup_context_uri_hash,
2902         soup_context_uri_equal): s/querystring/query/
2903
2904 2003-08-12  Dan Winship  <danw@ximian.com>
2905
2906         * configure.in: Bump API version to 2.2 and package version to
2907         2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
2908         libgnutls-config to find GNUTLS.
2909
2910         * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
2911
2912         * Makefile.am: Update for pc file rename
2913
2914         * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
2915         and libsoup-ssl-proxy stuff.
2916
2917         * libsoup/soup-ssl-proxy.c
2918         * libsoup/soup-nss.[ch]
2919         * libsoup/soup-openssl.[ch]: gone
2920
2921         * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
2922
2923         * tests/Makefile.am (get_LDADD, timeserver_LDADD,
2924         auth_test_LDADD): Update libsoup version
2925
2926 2003-08-07  Dan Winship  <danw@ximian.com>
2927
2928         * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
2929         soup_auth_invalidate): These are all really SoupContext functions,
2930         so move them to soup-context.c (and rename them appropriately).
2931         (soup_auth_get_protection_space): New method to get the
2932         "protection space" of an auth (paths where it is valid).
2933         (soup_auth_invalidate): New method to try to un-authenticate an
2934         auth (so we can keep the domain info cached even if the auth info
2935         is wrong).
2936         (basic_pspace_func): Basic protection space is all directories
2937         below the current one.
2938         (basic_invalidate_func): Clear the encoded username/password
2939         (digest_pspace_func): Digest protection space is either the whole
2940         server, or "what the domain parameter says" (though we don't deal
2941         with cross-host domains).
2942         (digest_invalidate_func): Return FALSE; bad digest auth info isn't
2943         cacheable.
2944         (digest_parse_func, digest_free): Set/free domain parameter
2945         (ntlm_pspace): NTLM protection space is always the whole server.
2946         (ntlm_invalidate): Clear the auth state.
2947         (soup_auth_new_ntlm): Make this non-static
2948         (SoupAuth): Replace the quad-state "status" field with an
2949         "authenticated" boolean.
2950         
2951         * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
2952         hash with separate "auth_realms" (path->realm) and "auths"
2953         (realm->auth) hashes. Also add a "use_ntlm" flag.
2954
2955         * libsoup/soup-context.c (soup_context_unref): Update SoupHost
2956         freeing code.
2957         (connection_free): Don't the connection's auth, just free it.
2958         (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
2959         does two-stage lookup (path->realm then realm->auth) and also
2960         deals with NTLM hacks.
2961         (soup_context_update_auth): Mostly formerly soup_auth_set_context,
2962         but also large parts of authorize_handler. Updates the auth hashes
2963         based on information from a 401 or 407 response. Does a better job
2964         than authorize_handler did of not throwing away good information.
2965         (soup_context_preauthenticate): New; fakes up auth info so that
2966         requests will end up using authentication without the server
2967         needing to return an error first.
2968         (soup_context_authenticate_auth): Moved out of authorize_handler
2969         so it can be used at request-sending time too, if we know that we
2970         need it. (That way we can avoid requeuing the request if it isn't
2971         going to be able to be authenticated.)
2972         (soup_context_invalidate_auth): Sort of like the old
2973         soup_auth_invalidate, but only destroys the auth data, while still
2974         remembering the path->realm mapping.
2975
2976         * libsoup/soup-message.c (authorize_handler): Mostly moved into
2977         soup_context_update_auth.
2978         (maybe_validate_auth): Remove this; it was only useful because of
2979         bugs elsewhere in the auth handling.
2980         
2981         * libsoup/soup-queue.c (soup_encode_http_auth): Update for
2982         soup_context_lookup_auth. If the returned auth isn't
2983         authenticated, call soup_context_authenticate_auth() on it.
2984
2985         * tests/auth-test.c: New (from soup-refactoring branch). Tests
2986         that the Basic/Digest auth code does the right thing. (TODO: find
2987         a good way to add NTLM tests too.)
2988
2989         * tests/Makefile.am (check_PROGRAMS): add auth-test
2990
2991 2003-07-29  Dan Winship  <danw@ximian.com>
2992
2993         * configure.in: 1.99.25 ("Potato and Leek Soup")
2994
2995         * libsoup/soup-message.c (requeue_read_finished,
2996         release_connection): Free the passed-in body data. Otherwise the
2997         response body ends up getting leaked on most 3xx and 4xx
2998         responses.
2999         (soup_message_cleanup): Remove a piece of code that didn't
3000         actually do anything and its associated confused comment.
3001
3002         * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
3003
3004         * libsoup/soup-context.c (connection_free): plug a non-occasional
3005         NTLM auth leak.
3006
3007 2003-06-26  Joe Shaw  <joe@ximian.com>
3008
3009         * configure.in: Version 1.99.24
3010
3011 2003-06-24  Dan Winship  <danw@ximian.com>
3012
3013         * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
3014         it, and (b) depends on lots of new things sometimes (like on RH9).
3015
3016         * libsoup/soup-openssl.c: 
3017         * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
3018         just #ifdef HAVE_OPENSSL since the header check doesn't get run in
3019         the pkgconfig case
3020
3021 2003-06-19  Dan Winship  <danw@ximian.com>
3022
3023         * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
3024         old read_tag before changing/clearing it.
3025         (soup_queue_write_done_cb): Likewise with the write_tag.
3026
3027         * libsoup/soup-transfer.c (issue_final_callback): ref the reader
3028         around the stop+callback.
3029         (soup_transfer_write_cb): Likewise.
3030
3031 2003-06-12  Dan Winship  <danw@ximian.com>
3032
3033         * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
3034         ref_count field.
3035         (soup_transfer_read, create_writer): Set initial ref_count to 2
3036         (one for soup-transfer, one for the caller).
3037         (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
3038         reader
3039         (soup_transfer_read_stop): Clears the GIOChannel callbacks and
3040         drops soup-transfer's ref.
3041         (soup_transfer_read_cancel): Now just a stop+unref
3042         (soup_transfer_write_ref, soup_transfer_write_unref,
3043         soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
3044
3045         * libsoup/soup-message.c (soup_message_cleanup): when setting up
3046         the "finish reading" callbacks, unref the reader so it will be
3047         destroyed once it's done reading.
3048         (soup_message_requeue): Likewise.
3049
3050         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
3051         prototype change (no longer returns a SoupTransferDone).
3052         (soup_queue_read_chunk_cb): Likewise.
3053
3054         * libsoup/soup-server.c (read_headers_cb): Likewise
3055
3056 2003-06-11  Dan Winship  <danw@ximian.com>
3057
3058         * libsoup/soup-transfer.c: Change all functions to take a
3059         SoupReader * or SoupWriter * instead of a guint.
3060
3061         * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
3062         write_tag pointers instead of guints.
3063
3064 2003-06-02  Chris Toshok  <toshok@ximian.com>
3065
3066         * libsoup/soup-ssl.c: remove #include for soup-nss.h
3067
3068 2003-06-02  Chris Toshok  <toshok@ximian.com>
3069
3070         * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
3071         (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
3072         (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
3073
3074 2003-06-02  Chris Toshok  <toshok@ximian.com>
3075
3076         * configure.in: Bump version to 1.99.23.
3077
3078 2003-05-30  Chris Toshok  <toshok@ximian.com>
3079
3080         * libsoup/soup-queue.c (soup_queue_error_cb): always force a
3081         reconnect when there's an error with ssl connection.  This fixes
3082         #43387, but it runs the risk of sending requests multiple times to
3083         the exchange server, and it results in lots of shorter lived
3084         connections and more forking (in the ssl proxy case), depending on
3085         the length of the operation.
3086
3087 2003-05-21  Dan Winship  <danw@ximian.com>
3088
3089         * configure.in: 1.99.22 (codename: French Onion Soup)
3090
3091 2003-05-20  Dan Winship  <danw@ximian.com>
3092
3093         * libsoup/soup-message.c (soup_message_requeue): Clear the
3094         write_tag as well so we don't double-cancel it. #43395.
3095
3096         * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
3097         be destroyed by the end of the func, so we have to call
3098         soup_connection_set_used at the beginning.
3099
3100         * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
3101         Call g_set_error() so that we don't SEGV immediately after
3102         returning G_IO_STATUS_ERROR.
3103
3104 2003-05-08  Joe Shaw  <joe@ximian.com>
3105
3106         * configure.in: Bump version to 1.99.21
3107
3108         * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
3109         tunnelling fails, the other message which shares our same
3110         connection will free it first, so set ours to NULL.
3111
3112 2003-05-08  Dan Winship  <danw@ximian.com>
3113
3114         * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
3115         return an NTLM request string. Otherwise return the "response"
3116         field (which should include the NTLM authenticate message)
3117         (ntlm_init): Don't bother setting "response" to the NTLM request
3118         string. Just leave it NULL in that case.
3119
3120         * libsoup/soup-message.c (authorize_handler): Never try to reuse
3121         an NTLM auth returned from soup_auth_lookup. Only set the auth on
3122         the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
3123         call soup_auth_set_context() on it just like for non-NTLM auth.
3124         The net effect of all of this is that now we record when a context
3125         needs NTLM auth just like with non-NTLM auth, so that that info
3126         gets preserved across connections.
3127         (soup_message_requeue): No longer need the hackery here to
3128         preserve the connection auth state.
3129
3130 2003-05-07  Dan Winship  <danw@ximian.com>
3131
3132         * libsoup/soup-context.c (soup_connection_set_in_use): New, to
3133         toggle the connection's in_use flag, and set up the death watch
3134         when it's not in use.
3135         (connection_death): This is only hooked up when the connection is
3136         not in use now, so don't need to check that. Should fix the
3137         infinite connection_death loop.
3138         (soup_connection_is_new): Keep a distinct "new" flag rather than
3139         defining "new" as "has been released at least once".
3140         (soup_connection_set_used): Mark a connection no-longer new.
3141         (soup_context_connect_cb): Mark the connection as new. Don't set
3142         up the death watch since it's in_use.
3143         (try_existing_connections): Use soup_connection_set_in_use.
3144         (soup_connection_release): Likewise
3145
3146         * libsoup/soup-message.c (requeue_read_finished): Call
3147         soup_connection_set_used so that the connection isn't still
3148         considered new when we send the message the second time.
3149
3150         * libsoup/soup-queue.c (soup_queue_error_cb): Call
3151         soup_connection_set_used (assuming we don't close the connection)
3152         (soup_queue_read_done_cb): Likewise.
3153
3154         * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
3155         nothing, call soup_transfer_read_error_cb rather than just
3156         cancelling, or else it will get cancelled again later.
3157
3158 2003-05-07  Dan Winship  <danw@ximian.com>
3159
3160         * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
3161         library doesn't depend on them, only the proxy does. #42473
3162
3163 2003-05-06  Dan Winship  <danw@ximian.com>
3164
3165         * src/libsoup/soup-message.c (global_handlers): Change the
3166         redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
3167         SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
3168         for "Location" to get around the non-64-bit-clean union
3169         initialization pointed out by Jeremy Katz <katzj@redhat.com>.
3170         (redirect_handler): Update for that.
3171
3172 2003-04-28  Dan Winship  <danw@ximian.com>
3173
3174         * configure.in: 1.99.20
3175
3176         * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
3177         we always call UNIGNORE_CANCEL. Might fix #41971
3178
3179 2003-04-25  Dan Winship  <danw@ximian.com>
3180
3181         * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
3182         suddenly gets an io error while reading or writing, assume it's a
3183         timeout or something, close the connection, and requeue the
3184         message.
3185
3186 2003-04-23  Dan Winship  <danw@ximian.com>
3187
3188         * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
3189         soup-transfer callbacks to keep reading off the connection unless
3190         we're actually going to keep the connection around afterward.
3191         Otherwise we can just close it.
3192
3193         * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
3194         thingy so that it's possible to cancel a read from inside a
3195         callback so that the above change actually works instead of just
3196         crashing.
3197
3198 2003-04-20  Rodney Dawes  <dobey@ximian.com>
3199
3200         * configure.in: Up version to 1.99.18
3201         * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
3202         
3203 2003-04-11  Dan Winship  <danw@ximian.com>
3204
3205         * libsoup/soup-context.c (soup_connection_purge_idle): New
3206         function to close all idle connections. (Needed for #41117 or else
3207         there's no way to force-discard NTLM authentication.)
3208
3209         * libsoup/soup-queue.c (soup_queue_shutdown): Use it
3210
3211 2003-04-10  Joe Shaw  <joe@ximian.com>
3212
3213         * libsoup/soup-queue.c (proxy_https_connect):
3214         proxy_https_connect_cb() might not get called if connecting to the
3215         proxy fails, and it causes us to double-free the connection.
3216         Always set the message's connection to NULL before freeing it.
3217
3218 2003-04-09  Dan Winship  <danw@ximian.com>
3219
3220         * configure.in: 1.99.17
3221
3222 2003-04-07  Dan Winship  <danw@ximian.com>
3223
3224         * libsoup/soup-context.c (connection_death): Revert Joe's changes.
3225         We can't release the connection there because there may be
3226         SoupMessages still pointing to it. (Needs to be revisited.)
3227
3228 2003-04-03  JP Rosevear  <jpr@ximian.com>
3229
3230         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
3231         error during waitpid
3232
3233         * libsoup/soup-address.c: ditto
3234
3235 2003-04-02  Joe Shaw  <joe@ximian.com>
3236
3237         * libsoup/soup-context.c (connection_death): Only drop the
3238         connection if we get an error condition on the channel.  Fixes a
3239         double-free.
3240
3241 2003-04-02  Joe Shaw  <joe@ximian.com>
3242
3243         * libsoup/soup-context.c (connection_death): Just call
3244         soup_connection_release() from here and return whether the
3245         connection is in use.
3246
3247 2003-03-31  Ian Peters  <itp@ximian.com>
3248
3249         * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
3250         case of EAGAIN or EINTR, since shutting down an SSL connection
3251         requires more than just closing a socket.
3252
3253 2003-03-28  Dan Winship  <danw@ximian.com>
3254
3255         * libsoup/soup-message.c (soup_message_set_context): If the new
3256         context points to a different server from the old context, call
3257         soup_message_cleanup. Otherwise it tries to reuse the old
3258         connection...
3259
3260 2003-03-25  Joe Shaw  <joe@ximian.com>
3261
3262         * configure.in: Bump up to 1.99.16
3263
3264 2003-03-24  Joe Shaw  <joe@ximian.com>
3265
3266         * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
3267         slightly better error message on various SSL failures than the
3268         previous message.
3269
3270         * soup-queue.c (soup_queue_error_cb): Throw the
3271         SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
3272
3273 2003-03-21  Joe Shaw  <joe@ximian.com>
3274
3275         * soup-server.c: Use non-deprecated g_main_loop_* calls
3276         throughout.
3277         (soup_server_unref): Don't unref the main loop if it's NULL.
3278         Fixes a glib warning.
3279
3280 2003-03-18  Dan Winship  <danw@ximian.com>
3281
3282         * configure.in: comment out NSS checks. The NSS code doesn't work
3283         and there are no current plans to fix it.
3284
3285         * README (Features): Mention GnuTLS, remove NSS and the rest of
3286         the "Planned Features" section.
3287
3288         * MAINTAINERS: remove Alex
3289
3290         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
3291         timeout to 10 seconds (and get rid of the 3 tries) so we don't
3292         fail to connect just because the server is slow/far away.
3293
3294 2003-03-17  Joe Shaw  <joe@ximian.com>
3295
3296         * configure.in: Bump up to 1.99.15.
3297
3298 2003-03-12  Ian Peters  <itp@ximian.com>
3299
3300         * libsoup/soup-gnutls.c: because creating client credentials is
3301         expensive, keep the same one around as long as possible, only
3302         recreating it if the ssl_ca_file changes.  Wrap
3303         gnutls_certificate_credentials in a refcounted struct to avoid
3304         freeing it while another established connection may potentially
3305         need it (say, to rehandshake).
3306
3307 2003-03-11  Frank Belew  <frb@ximian.com>
3308
3309         * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't 
3310         use pkgconfig
3311
3312 2003-03-10  Joe Shaw  <joe@ximian.com>
3313
3314         * configure.in: Bump up to 1.99.14.
3315
3316         * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
3317         libsoup/soup-ssl.c: Add support for GnuTLS.  Patch from Ian
3318         Peters.
3319
3320 2003-03-07  Joe Shaw  <joe@ximian.com>
3321
3322         * configure.in: Bump up to 1.99.13.
3323
3324         * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
3325         the list of conditions to watch.  If the remote end hangs up the
3326         connection, we'll get a successful read of 0 bytes, not a HUP.
3327         The connection will have to be released by the point we check for
3328         it in connection_death().
3329
3330         * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
3331         (apparently) errant resetting of the read and write tags.  I think
3332         this might have been causing some reentrancy and crashes.
3333
3334         * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
3335         channel to NULL encoding and not buffered.
3336
3337         * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
3338         incorrect comments.
3339
3340 2003-02-28  Joe Shaw  <joe@ximian.com>
3341
3342         * configure.in: Bump up to 1.99.12.
3343
3344         * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
3345         header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
3346         this case we probably don't want to call the error callback, we
3347         just want to act like our transfer was cancelled.
3348
3349 2003-02-27  Joe Shaw  <joe@ximian.com>
3350
3351         Try to apply some order to the iochannel refcounting...
3352
3353         * configure.in: Bump up to 1.99.11.
3354
3355         * libsoup/soup-context.c (soup_connection_get_iochannel): The
3356         connections needs to own a reference to the iochannel!  If we're
3357         using HTTPS, release the ref we get from soup_socket_get_iochannel
3358         and replace it with the ref we get from soup_ssl_get_iochannel().
3359         Then, always ref the channel that we return (ugh, but that's the
3360         soup way).
3361         (connection_free): Release the connection's ref to the iochannel.
3362
3363         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
3364         iochannel. The reference we pass back will be owned by the
3365         connection.
3366         (soup_ssl_hup_waitpid): Release our ref.
3367
3368 2003-02-27  Joe Shaw  <joe@ximian.com>
3369
3370         * configure.in: Bump up to 1.99.10.
3371
3372         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
3373         iochannel, return to the status quo.  Sigh.
3374
3375 2003-02-26  Joe Shaw  <joe@ximian.com>
3376
3377         * configure.in: Bump up to 1.99.9.
3378
3379         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
3380         it's causing problems with HTTPS and proxies; the iochannel
3381         refcounting is waaaaaay horked.
3382
3383 2003-02-26  Frank Belew  <frb@ximian.com>
3384
3385         * libsoup/Makefile.am: added workaround to link ssl-proxy statically
3386
3387 2003-02-11  Joe Shaw  <joe@ximian.com>
3388
3389         * configure.in: Bump up to 1.99.8 for snaps.
3390
3391         * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
3392         It returns the address to the resulting hostent or NULL on failure,
3393         unlike Linux which returns an error code.
3394
3395 2003-02-11  Joe Shaw  <joe@ximian.com>
3396
3397         * configure.in: Bump up to 1.99.7 for snaps.
3398
3399         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
3400         the error string from OpenSSL if we can't establish a connection.
3401
3402 2003-02-04  Joe Shaw  <joe@ximian.com>
3403
3404         * configure.in: Bump up to 1.99.6 for snaps.
3405
3406         * libsoup/soup-server.c (destroy_message): We already assigned
3407         chan, so don't reassign it, and unref it in all cases.
3408         (issue_bad_request): Always unref after a call to
3409         soup_socket_get_iochannel(), because it refs it.
3410         (conn_accept): Fix some funky GIOChannel reffing here.
3411
3412         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
3413         g_io_channel_ref() on the socket.  This is the exact opposite of
3414         what we want to do.  Create a temporary structure containing the
3415         parent pid and the old socket and unref the socket when our
3416         callback is called.  This should fix GIOChannels being leaked on
3417         SSL connections.
3418
3419         * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
3420         main loop quits.
3421
3422 2003-01-22  Joe Shaw  <joe@ximian.com>
3423
3424         * configure.in: Bump up to 1.99.5 for the snaps.
3425
3426         * libsoup/soup-address.c (soup_address_new): If we found the
3427         address in our hash, we need to return NULL or else Soup will
3428         think we're doing an async lookup and do some cancellation on
3429         us.  Besides, we were returning the wrong type anyway and it
3430         was crashing things.
3431
3432 2003-01-17  Joe Shaw  <joe@ximian.com>
3433
3434         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
3435         uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
3436         out, so keep trying until we succeed.
3437
3438 2003-01-10  Joe Shaw  <joe@ximian.com>
3439
3440         * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
3441         strings and print out the error when the cert can't verify.
3442
3443 2003-01-09  Dan Winship  <danw@ximian.com>
3444
3445         * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
3446         overrun noticed by valgrind
3447
3448 2002-12-20  Joe Shaw  <joe@ximian.com>
3449
3450         * libsoup/soup-server.c (soup_server_new_with_host): Added.
3451         Starts a server only on the interface specified, instead of all
3452         network interfaces.
3453
3454 2002-12-16  Jeremy Katz  <katzj@redhat.com>
3455
3456         * configure.in: use $libdir instead of /usr/lib when looking for
3457         libraries
3458
3459 2002-12-11  Joe Shaw  <joe@ximian.com>
3460
3461         * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
3462         Don't set a variable to NULL and then immediately try to
3463         dereference it.
3464
3465 2002-12-09  Joe Shaw  <joe@ximian.com>
3466
3467         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
3468         timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
3469         we don't hang forever if we don't get more data.
3470
3471         * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
3472         or else we'll hang forever in SSL_connect() if the other side
3473         hangs up.
3474
3475         * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
3476         release the connection on message free, even if the connection was
3477         unsuccessful.
3478
3479 2002-12-03  Joe Shaw  <joe@ximian.com>
3480
3481         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
3482         g_io_channel_set_close_on_unref() on the second half of the socket
3483         pair so we don't leak file descriptors.
3484
3485 2002-12-03  Frank Belew  <frb@ximian.com>
3486
3487         * libsoup/soup-address.c: add signal.h to the list of headers to 
3488         pick up SIGKILL
3489         
3490 2002-11-25  Joe Shaw  <joe@ximian.com>
3491
3492         * Makefile.am: Build the tests directory again
3493
3494 2002-11-21  Rodney Dawes  <dobey@ximian.com>
3495
3496         * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
3497         
3498 2002-11-20  Michael Meeks  <michael@ximian.com>
3499
3500         * configure.in: require autoconf 2.52 not 2.53.
3501
3502 2002-11-18  Dan Winship  <danw@ximian.com>
3503
3504         * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
3505         since it's apparently non-portable. Use s6_addr instead.
3506         (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
3507
3508         * libsoup/soup-error.c: Fix spelling of
3509         SOUP_ERROR_MOVED_PERMANENTLY and its description.
3510
3511         * libsoup/soup-message.c (soup_message_get_request_header, etc):
3512         Remove long-deprecated API.
3513
3514         * libsoup/soup-socket.c (soup_socket_connect): remove unused
3515         variable.
3516
3517         * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
3518         * libsoup/soup-server.c (cgi_read): Likewise
3519         * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
3520         Likewise.
3521         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
3522         * libsoup/soup-transfer.c (soup_transfer_read_cb,
3523         soup_transfer_write_cb): Likewise.
3524
3525         * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
3526         instead of IPv4. (Tested on OS X.)
3527
3528 2002-11-15  Dan Winship  <danw@ximian.com>
3529
3530         * libsoup/*: Change old Helix Code refs to Ximian (and update
3531         copyright dates).
3532
3533 2002-11-15  Frank Belew  <frb@ximian.com>
3534
3535         * tests/Makefile.am: uncomment lines to make timeserver build 
3536         correctly
3537         
3538 2002-11-14  Joe Shaw  <joe@ximian.com>
3539
3540         * libsoup/soup-address.c (soup_address_new): When we get an
3541         address from the hash, call our address lookup callback or else
3542         the connection will hang.
3543
3544 2002-11-13  Dan Winship  <danw@ximian.com>
3545
3546         * tests/timeserver.c: Oops, commit this.
3547
3548         * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
3549
3550 2002-11-13  Joe Shaw  <joe@ximian.com>
3551
3552         * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
3553         (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
3554         instead of bindir.
3555
3556         * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
3557         to properly shut down the SSL connection before closing the
3558         socket.
3559
3560         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
3561         iochannels before quitting the main loop.
3562
3563         * tests/Makefile.am: disable building timeserver, the source file
3564         wasn't added.
3565
3566 2002-11-12  Dan Winship  <danw@ximian.com>
3567
3568         * configure.in: Check for IPv6 support in networking headers.
3569
3570         * libsoup/soup-address.c: Make the internal structure of
3571         SoupAddress entirely private, and make SoupAddress be more like a
3572         hostent and less like a sockaddr. (Ie, make it not have a port
3573         associated with it.) Document undocumented functions. Add
3574         completely-untested support for IPv6.
3575         (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
3576         SoupAddress and a port.
3577         (soup_address_ipv4_any, soup_address_ipv6_any): Return static
3578         addresses corresponding to the IPv6 and IPv6 "any" addresses.
3579         (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
3580         (soup_address_make_sockaddr): Now constructs a new sockaddr, which
3581         may be a sockaddr_in or sockaddr_in6.
3582         (soup_address_gethostname, soup_address_gethostaddr): Remove
3583         these. They aren't reliable, especially on multihomed hosts.
3584         (soup_gethostbyname, soup_gethostbyaddr): support IPv6
3585         (soup_address_new): Keep pending lookups in a separate hash table
3586         from completed lookups. Fix a bug when canceling a lookup when
3587         there was more one outstanding request for it.
3588         (soup_address_lookup_in_cache): Removed.
3589
3590         * libsoup/soup-socket.c: Add a port field to SoupSocket (since
3591         it's not in SoupAddress any more).
3592         (soup_socket_connect): Simplify this. Don't use
3593         soup_address_lookup_in_cache, just call soup_address_new, since we
3594         already know the code can deal with the callback being invoked
3595         immediately.
3596         (soup_socket_new_sync, soup_socket_new): Take a port argument.
3597         (soup_socket_server_new): Take a SoupAddress to use as the local
3598         address to bind to. This lets the caller choose between the IPv4
3599         and IPv6 "any" addresses, and also lets you bind to a single
3600         interface of a multi-homed machine.
3601         (soup_socket_server_accept, soup_socket_server_try_accept): Merge
3602         the common code.
3603
3604         * libsoup/soup-server.c (soup_server_new): Pass
3605         soup_address_ipv4_any() to soup_socket_server_new().
3606
3607         * libsoup/soup-socks.c (soup_connect_socks_proxy,
3608         soup_socks_write): Fix up for the API changes, but it won't work
3609         with IPv6 yet.
3610
3611         * tests/timeserver.c: Another really simple test, for the server
3612         socket code.
3613
3614         * tests/Makefile.am: build timeserver
3615
3616 2002-11-11  Dan Winship  <danw@ximian.com>
3617
3618         * libsoup/soup-address.c: Move the SoupAddress code from
3619         soup-socket.c and soup-socket-unix.c to here.
3620
3621         * libsoup/soup-socket.c: Move the remaining code from
3622         soup-socket-unix.c here.
3623
3624         * libsoup/soup-socket-unix.c: Gone
3625
3626         * tests/get.c: really really trivial test program
3627
3628         * configure.in (AC_OUTPUT):
3629         * Makefile.am (SUBDIRS): add tests/
3630
3631 2002-11-05  Dan Winship  <danw@ximian.com>
3632
3633         * Split libsoup out of soup. ChangeLog.old contains the original
3634         soup ChangeLog.
3635
3636         * Makefile.am, etc: Fix things up to work with the new directory
3637         layout. Disable docs until we fix them.
3638
3639         * autogen.sh: Use gnome-autogen.sh
3640
3641         * configure.in: Require autoconf 2.53. Remove stuff that was only
3642         needed for httpd or wsdl code. Remove glib1 support. Bump version
3643         to 2.0.
3644
3645         * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
3646         in ${includedir}/soup-2.0
3647         
3648         * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
3649         SOAP-specific stuff, Windows support, and other things that
3650         weren't being maintained.
3651
3652         * soup-config.in, soupConf.sh: Kill these. We only support
3653         pkg-config now.