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