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