Define two new signals, request_queued and request_unqueued, to provided a
[platform/upstream/libsoup.git] / ChangeLog
1 2008-03-15  Dan Winship  <danw@gnome.org>
2
3         * libsoup/soup-session.c: Define two new signals, request_queued
4         and request_unqueued, to provided a clearer (and
5         clearly-documented) lifecycle for messages, helping us (and other
6         people) avoid bugs like #522601, SoupSession::authenticate signal
7         emitted multiple times per message (reported and analyzed by Tommi
8         Komulainen).
9
10         * libsoup/soup-logger.c:
11         * libsoup/soup-auth-manager.c:
12         * libsoup/soup-auth-manager-ntlm.c: Use request_queued/unqueued
13
14         * tests/auth-test.c (do_async_auth_test): add a regression test
15
16 2008-03-14  Dan Winship  <danw@gnome.org>
17
18         * libsoup/soup-message-client-io.c (get_request_headers): Fix Host
19         header syntax when the host is an IPv6 address literal. Noticed
20         while poking at #522519.
21
22 2008-03-14  Dan Winship  <danw@gnome.org>
23
24         * libsoup/soup-message-private.h (SoupMessagePrivate): add
25         an orig_http_version field.
26
27         * libsoup/soup-message.c (soup_message_init): initialize
28         orig_http_version.
29         (soup_message_set_http_version): If called before the status code
30         is received, set orig_http_version too.
31         (soup_message_cleanup_response): Restore orig_http_version, so
32         that we don't send an HTTP/1.0 request in response to an HTTP/1.0
33         redirect. #521848, Tommi Komulainen.
34
35         * libsoup/soup-message-server-io.c (get_response_headers):
36         actually output "HTTP/1.0", not "HTTP/1.1", if the message's http
37         version is 1.0.
38
39         * tests/redirect-test.c (server_callback): Add a regression test;
40         set http_version to 1.0 when returning a redirect, but require it
41         to be 1.1 when processing the following request
42
43 2008-03-13  Xan Lopez  <xan@gnome.org>
44
45         * libsoup/soup-address.c:
46         * libsoup/soup-auth-domain-basic.c:
47         * libsoup/soup-auth-domain-digest.c:
48         * libsoup/soup-auth-domain.c:
49         * libsoup/soup-auth.c:
50         * libsoup/soup-connection.c:
51         * libsoup/soup-message.c:
52         * libsoup/soup-server.c:
53         * libsoup/soup-session.c:
54         * libsoup/soup-socket.c:
55
56         Use G_OBJECT_WARN_INVALID_PROPERTY_ID in all get/set_property functions.
57
58         Bug #522115
59         
60 2008-03-13  Xan Lopez  <xan@gnome.org>
61
62         * tests/dns.c: (main):
63         * tests/get.c: (main):
64         * tests/getbug.c: (main):
65         * tests/simple-httpd.c: (main):
66         * tests/simple-proxy.c: (main):
67         * tests/ssl-test.c: (main):
68         * tests/test-utils.c: (test_init):
69
70         g_thread_init should be called before any other glib function. (#522117)
71
72 2008-03-10  Dan Winship  <danw@gnome.org>
73
74         * configure.in: 2.4.0!
75
76         * NEWS: update
77
78 2008-02-28  Dan Winship  <danw@gnome.org>
79
80         * libsoup/soup-session.c (finalize): free priv->user_agent.
81         #518798, Wouter Cloetens.
82         (redirect_handler): PROPFIND is defined to be "safe and
83         idempotent", so allow automatic redirects of it. (Pointed out by
84         Christian Kellner. FIXME: need a way for apps to declare
85         additional safe methods). Also, treat 302 like 307, not like 303,
86         because that behavior is universal in the real world, despite the
87         spec's protests.
88
89         * tests/redirect-test.c (tests): update POST 302 behavior check
90
91         * tests/Makefile.am (TESTS): oops, add redirect-test so it gets
92         run by "make check"/"make distcheck"
93
94         * tests/ssl-test.c: Re-revert the change from 2008-02-09; the
95         problem with ssl-test.c was not that soup_gnutls_init() wasn't
96         thread-safe, it's that the server thread doesn't do anything that
97         would ever cause soup_gnutls_init() to be called, and so if the
98         client thread doesn't start first, the server thread will run
99         without initializing GNUTLS.
100
101 2008-02-27  Benjamin Otte  <otte@gnome.org>
102
103         * libsoup/soup-socket.c: (read_from_network), (soup_socket_read),
104         (soup_socket_read_until), (soup_socket_write):
105         ensure that nread/nwrote parameters aren't NULL. They are also
106         properly set on error paths now.
107
108 2008-02-25  Dan Winship  <danw@gnome.org>
109
110         * configure.in: 2.3.4
111
112         * NEWS: Update
113
114 2008-02-25  Dan Winship  <danw@gnome.org>
115
116         * docs/reference/Makefile.am (DOC_MODULE): rename from libsoup to
117         libsoup-2.4
118         (TARGET_DIR): don't need to override this now
119
120         * docs/reference/libsoup-2.4.types:
121         * docs/reference/libsoup-2.4-docs.txt:
122         * docs/reference/libsoup-2.4-overrides.txt:
123         * docs/reference/libsoup-2.4-sections.txt: Rename these from
124         unversioned, to match DOC_MODULE
125
126         Fixes doc installation to work with devhelp again. #518384, Mart
127         Raudsepp.
128
129 2008-02-25  Benjamin Otte  <otte@gnome.org>
130
131         * libsoup/soup-address.h:
132         * libsoup/soup-auth-domain.h:
133         * libsoup/soup-auth.h:
134         * libsoup/soup-message.h:
135         * libsoup/soup-server.h:
136         * libsoup/soup-session-async.h:
137         * libsoup/soup-session-sync.h:
138         * libsoup/soup-session.h:
139         * libsoup/soup-socket.h:
140         * libsoup/soup-types.h:
141         * libsoup/soup-uri.h:
142         use an underscore for struct definitions. Fixes bug #518317.
143
144 2008-02-20  Sebastian Dröge  <slomo@circular-chaos.org>
145
146         * libsoup.pc.in: Add gobject-2.0 and gio-2.0 to Requires.
147         Move libxml-2.0 and the SSL dependency to Requires.private
148         as no header is including them. Fixes bug #517631.
149
150 2008-02-11  Dan Winship  <danw@gnome.org>
151
152         * configure.in: post-release bump to 2.3.3
153
154 2008-02-11  Dan Winship  <danw@gnome.org>
155
156         * configure.in: 2.3.2
157         (SOUP_CURRENT): bump for API changes
158
159         * NEWS: update
160
161 2008-02-09  Dan Winship  <danw@gnome.org>
162
163         * Misc gtk-doc fix-ups
164
165 2008-02-09  Dan Winship  <danw@gnome.org>
166
167         * libsoup/soup-misc.h: remove prototype for
168         soup_signal_connect_once, which is only used by soup-connection
169         now, and will go away once that code is rewritten.
170
171         * libsoup/soup-connection.c: prototype it here now (the definition
172         is still in soup-misc.c)
173
174 2008-02-09  Dan Winship  <danw@gnome.org>
175
176         * libsoup/soup-auth-manager-ntlm.c: mark the DES magic number
177         arrays const
178
179         * libsoup/soup-date.c (months, days): add an extra "const" to each
180         of these declarations, as one "const" is apparently not enough.
181         (soup_date_to_time_t): remove redundant copy of days_before array.
182
183         * libsoup/soup-dns.c (soup_dns_init): use g_once_init_enter/leave
184
185         * libsoup/soup-gnutls.c (soup_ssl_supported)
186         (soup_gnutls_channel_funcs): Mark these const
187         (soup_gnutls_init, init_dh_params): Use g_once_init_enter/leave
188
189         * libsoup/soup-status.c (reason_phrases): mark this const
190
191         * tests/ssl-test.c: Remove the workaround for soup_gnutls_init()
192         not being thread-safe, since it is now.
193
194 2008-02-08  Dan Winship  <danw@gnome.org>
195
196         * libsoup/soup-message-headers.c (SoupMessageHeadersIter)
197         (soup_message_headers_iter_init, soup_message_headers_iter_next):
198         Add an iterator type for SoupMessageHeaders.
199
200         * libsoup/soup-message-client-io.c (get_request_headers):
201         * libsoup/soup-message-server-io.c (get_response_headers): Use
202         SoupMessageHeadersIter.
203
204         * libsoup/soup-logger.c (print_request, print_response): Use
205         SoupMessageHeadersIter. And take advantage of the simplification
206         to fix the kludge where 'direction' was stored as a field in
207         SoupLoggerPrivate rather than being an argument to
208         soup_logger_print.
209
210         * tests/get.c (get_url):
211         * tests/header-parsing.c (check_headers):
212         * tests/simple-httpd.c (server_callback): Use
213         SoupMessageHeadersIter
214
215 2008-02-06  Dan Winship  <danw@gnome.org>
216
217         * libsoup/soup-server.c (soup_server_add_auth_domain): Ref the
218         auth domain when adding it.
219
220         * tests/continue-test.c (setup_server):
221         * tests/server-auth-test.c (main): Add unrefs here to avoid
222         leaking now
223
224 2008-02-06  Dan Winship  <danw@gnome.org>
225
226         * libsoup/soup-message.c (soup_message_set_chunk_allocator): New
227         method that lets the application set a callback function to use to
228         allocate SoupBuffers for reading into, so as to avoid needing
229         extra copies.
230
231         * libsoup/soup-message-body.c (soup_buffer_new_with_owner): new,
232         to create a SoupBuffer pointing to memory owned by another object,
233         with a GDestroyNotify to unref/free that object when the
234         SoupBuffer is freed.
235         (soup_buffer_get_owner): Returns the owner of a buffer created
236         with soup_buffer_new_with_owner.
237         (soup_buffer_free, etc): update SoupBuffer code for owned buffers.
238
239         Suggested by Wouter Cloetens, #513810.
240
241         * tests/simple-httpd.c (do_get): Use mmap() and
242         soup_buffer_new_with_owner(), as a demo/test.
243
244 2008-02-06  Dan Winship  <danw@gnome.org>
245
246         * libsoup/soup-date.c (soup_date_to_time_t): clamp the result to
247         the time_t range, and document that. Remove the #ifdef HAVE_TIMEGM
248         branch.
249
250         * configure.in: remove check for timegm
251
252 2008-02-04  Dan Winship  <danw@gnome.org>
253
254         * libsoup/Makefile.am: Fix the handling of soup-enum-types.h to
255         ensure that it gets built before the things that depend on it.
256
257 2008-02-03  Benjamin Otte  <otte@gnome.org>
258
259         * libsoup/soup-socket.c: update documentation to new API
260
261 2008-02-02  Dan Winship  <danw@gnome.org>
262
263         * libsoup/soup-session.c: fix default connections-per-host again;
264         it was defined in two places. Add SOUP_SESSION_USER_AGENT property
265         (setup_message): set the User-Agent request header on the request
266
267         * libsoup/soup-server.c: add SOUP_SERVER_SERVER_HEADER property
268         (start_request): set the Server response header on the request.
269
270         * tests/get.c:
271         * tests/simple-httpd.c: set the User-Agent/Server headers
272
273 2008-02-02  Dan Winship  <danw@gnome.org>
274
275         * libsoup/soup-headers.c (soup_headers_parse_request): if the
276         request headers contain an unrecognized Expect: header, return
277         SOUP_STATUS_EXPECTATION_FAILED. Also, process Connection headers
278         in HTTP/1.0 messages as required by 2616 14.10.
279         (soup_headers_parse_response): Likewise handle Connection headers
280         in HTTP/1.0 messages
281
282         * tests/header-parsing.c: test those things
283
284 2008-02-02  Dan Winship  <danw@gnome.org>
285
286         * libsoup/soup-session.c (redirect_handler): Misc fixes: don't
287         redirect on "300 Multiple Choices", "304 Not Modified", "305 Use
288         Proxy", or any unrecognized status code. Don't redirect unsafe
289         methods on 301, 302, or 307. Redirect POST to GET on 303.
290
291         * tests/redirect-test.c: test of redirection handling behavior.
292
293 2008-02-02  Dan Winship  <danw@gnome.org>
294
295         * libsoup/soup-method.h (SOUP_METHOD_GET, etc): Fix these so that
296         direct comparisons against them actually *are* faster than doing
297         strcmp, as the docs claim.
298
299         * libsoup/soup-uri.h (SOUP_URI_SCHEME_HTTP,
300         SOUP_URI_SCHEME_HTTPS): likewise
301
302 2008-02-01  Dan Winship  <danw@gnome.org>
303
304         * libsoup/soup-address.c: Use GObject properties.
305         (soup_address_new, soup_address_new_from_sockaddr)
306         (soup_address_new_any): Make these just wrappers around
307         g_object_new.
308
309         * libsoup/soup-message-body.c (soup_message_body_get_type):
310         * libsoup/soup-message-headers.c (soup_message_headers_get_type):
311         * libsoup/soup-server.c (soup_client_context_get_type): 
312         Register these as boxed types, for language bindings.
313
314         * libsoup/soup-date.c (soup_date_get_type):
315         * libsoup/soup-message-body.c (soup_buffer_get_type):
316         * libsoup/soup-value-utils.c (soup_byte_array_get_type):
317         * libsoup/soup-uri.c (soup_uri_get_type): Upgrade to the latest
318         yummiest type-registering idiom.
319
320 2008-02-01  Dan Winship  <danw@gnome.org>
321
322         * libsoup/soup-connection.c (soup_connection_disconnect):
323         Reorganize this; emitting DISCONNECTED may cause the session to
324         unref the connection, causing it to be destroyed, so do everything
325         else before that. #437835 and dups. Also, call
326         soup_message_cleanup_response() when requeuing an IO_ERROR-ed
327         message, so soup_session_send_message() will requeue it rather
328         than treating it as failed.
329
330         * docs/reference/Makefile.am (TARGET_DIR): override this to
331         include the API version, to fix the last remaining parallel
332         install issue between libsoup 2.2 and 2.4. #512810, Daniel
333         Gryniewicz.
334
335         * tests/query-test.c (do_test): don't use "stdout" as a variable
336         name; it's allowed to be a macro  (and it is one on Solaris).
337         #513602, patch from Jeff Cai.
338
339 2008-01-31  Dan Winship  <danw@gnome.org>
340
341         * libsoup/soup-date.c (soup_date_to_time_t): new
342
343         * libsoup/soup-form.c (soup_form_decode): Remove "_urlencoded"
344         from name. (And add back-compat #define.)
345         (soup_form_encode): New, takes varargs parameters for each form
346         construction.
347         (soup_form_encode_hash, soup_form_encode_datalist): renamed, with
348         back-compat #defines
349         (soup_form_request_new, soup_form_request_new_from_hash)
350         (soup_form_request_new_from_datalist): New methods to construct a
351         GET or POST message with form data.
352
353         * libsoup/soup-uri.c (soup_uri_set_query_from_fields): New, takes
354         varargs like soup_form_encode().
355
356         * libsoup/soup-value-utils.c (soup_value_hash_new_with_vals)
357         (soup_value_hash_insert_vals, soup_value_hash_lookup_vals): New
358         routines to work with multiple value hash values at once.
359         (soup_value_array_new): tiny wrapper, for naming consistency
360         (soup_value_array_new_with_vals, soup_value_array_append_vals):
361         New routines to work with multiple value array values at once.
362
363 2008-01-28  Dan Winship  <danw@gnome.org>
364
365         * configure.in: post-release bump to 2.3.1
366
367 2008-01-28  Dan Winship  <danw@gnome.org>
368
369         * configure.in: Bump version to 2.3.0.1
370
371         * NEWS: Update
372
373         * docs/reference/Makefile.am (content_files): include
374         porting-2.2-2.4.xml
375
376 2008-01-28  Dan Winship  <danw@gnome.org>
377
378         * libsoup/soup-message.c (soup_message_set_auth)
379         (soup_message_set_proxy_auth): Use soup_message_headers_replace(),
380         not soup_message_headers_append(), since only a single
381         Authorization/Proxy-Authorization header is allowed. #512517.
382
383         * libsoup/soup-auth-manager-ntlm.c (ntlm_request_started): Don't
384         set an NTLM Authorization header if the message already has a
385         Basic or Digest one.
386
387         * tests/ntlm-test.c: Add some Basic auth and mixed NTLM/Basic auth
388         tests
389
390 2008-01-28  Wouter Bolsterlee  <wbolster@svn.gnome.org>
391
392         * docs/reference/libsoup-docs.sgml:
393
394         Changed section titles so that they actually show
395         something useful in DevHelp.
396
397 2008-01-27  Dan Winship  <danw@gnome.org>
398
399         * libsoup/soup-dns.c (resolver_thread): fix mutex use to avoid a
400         race condition
401
402         * libsoup/soup-xmlrpc.c (soup_xmlrpc_build_faultv):
403         (soup_xmlrpc_set_response, soup_xmlrpc_set_fault):
404         (soup_xmlrpc_parse_method_call): Fix misc server-side stuff
405         (soup_xmlrpc_parse_method_response): Fix fault parsing
406
407         * libsoup/soup-xmlrpc.h (SoupXMLRPCFault): add semi-standard fault
408         codes from
409         http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
410
411         * tests/xmlrpc-server.php (sum): return a <fault> if the arguments
412         are wrong (so that xmlrpc-test can test that case).
413         (dateChange): change to take two parameters, a date and a struct,
414         instead of putting the date in the struct, since we weren't
415         previously testing multiple parameter handling.
416
417         * tests/xmlrpc-test.c (main): Add a -u flag to specify an
418         alternate URL.
419         (do_xmlrpc): Remove level 3 debug output, which is now redundant
420         with the SoupLogger stuff.
421         (test_dateChange): update for dateChange prototype change
422         (test_fault_malformed, test_fault_method, test_fault_args): test
423         handling of faults
424
425         * tests/xmlrpc-server-test.c: Test the server-side XML-RPC API (by
426         implementing the same methods as xmlrpc-server.php and then
427         using xmlrpc-test)
428
429 2008-01-27  Dan Winship  <danw@gnome.org>
430
431         * libsoup/soup-headers.c (soup_header_parse_quality_list): fix to
432         not sometimes read beyond the end of the string.
433
434         * libsoup/soup-message-body.c (soup_message_body_append): When
435         appending a 0-length SOUP_MEMORY_TAKE buffer, we need to free the
436         passed-in buffer rather than just ignoring it.
437
438         * libsoup/soup-message-headers.c (soup_message_headers_free): Fix
439         leak introduced by patch for 511980.
440
441         * libsoup/soup-server.c (got_headers): fix leak when decoding path
442
443         * libsoup/soup-session.c (finalize): free ntlm_manager
444
445         * tests/libsoup.supp: update for libsoup 2.4, glib 2.14, etc
446
447         * tests/header-parsing.c (do_qvalue_tests):
448         * tests/uri-parsing.c (main): more cleanup
449
450 2008-01-27  Dan Winship  <danw@gnome.org>
451
452         * libsoup/soup-logger.c (soup_logger_attach): Fix session ids by
453         using weak refs for the logger cleanup rather than trying to use
454         the same qdata for two different things.
455         (print_request, print_response): use full type names in the
456         Soup-Debug line, since SoupSessionSync and SoupSessionAsync get
457         numbered separately.
458
459 2008-01-27  Dan Winship  <danw@gnome.org>
460
461         * libsoup/soup-session-async.c (final_finished): Don't run the
462         queue again if the callback destroyed the session. #511868, Stef
463         Walter.
464
465 2008-01-25  Srinivasa Ragavan  <sragavan@novell.com>
466
467         ** Fix for bug #511980
468
469         * libsoup/soup-message-headers.c: (soup_message_headers_clear):
470         Instead of destroying the hashtable, just remove the contents of the
471         table.
472
473 2008-01-23  Tor Lillqvist  <tml@novell.com>
474
475         * configure.in: Allow autogening even without AM_PATH_LIBGCRYPT
476         available
477
478         * libsoup/soup-date.c (soup_date_new_from_time_t): Correct use of
479         gmtime().
480
481         * libsoup/soup-headers.c (soup_headers_parse_status_line): Return
482         FALSE if neither HTTP nor ICY. Avoids crash in
483         tests/header-parsing.
484
485         * libsoup/soup-socket.c: On Windows SHUT_RDWR is called SD_BOTH.
486         (set_nonblocking): Fix typo.
487
488         * tests/continue-test.c: Seems to build fine without <pthread.h>,
489         so drop that.
490
491 2008-01-18  Dan Winship  <danw@gnome.org>
492
493         * tests/server-auth-test.c: test SOUP_AUTH_DOMAIN_REMOVE_PATH
494
495 2008-01-18  Dan Winship  <danw@gnome.org>
496
497         * configure.in: require glib 2.15.3, not 2.15.0, since
498         AM_PATH_GLIB_2_0 didn't know about gio until post-2.15.2. Pointed
499         out by Matthew Barnes, #510216.
500
501 2008-01-18  Dan Winship  <danw@gnome.org>
502
503         * libsoup/soup-auth-domain.c
504         (soup_auth_domain_set_generic_auth_callback):
505         (soup_auth_domain_check_password): add a new generic auth callback
506         that can be used with any subclass to do cleartext password
507         checking against messages. Suggested by Mathias Hasselmann.
508
509         * libsoup/soup-auth-domain-basic.c: Implement generic auth
510
511         * libsoup/soup-auth-domain-digest.c: Implement generic auth.
512         (soup_auth_domain_digest_evil_check_password): Gone, use the
513         generic version now.
514
515 2008-01-17  Dan Winship  <danw@gnome.org>
516
517         * libsoup/soup-auth-digest.c (soup_auth_digest_compute_hex_urp)
518         (soup_auth_digest_compute_hex_a1)
519         (soup_auth_digest_compute_response): cast the second arg to
520         g_checksum_update to (guchar *) to avoid warnings
521
522 2008-01-16  Dan Winship  <danw@gnome.org>
523
524         * libsoup/soup-headers.c (soup_headers_parse_status_line): Deal
525         with Shoutcast servers, which return "ICY 200 OK", but are
526         otherwise straight HTTP/1.0. #502325, Wouter Cloetens.
527
528         * tests/header-parsing.c (resptests): add a test for it
529
530 2008-01-16  Dan Winship  <danw@gnome.org>
531
532         * libsoup/soup-auth-manager.c (authorize_handler, etc): Allow the
533         session authenticate signal to be handled asynchronously, by
534         pausing the message and then authenticating the auth later.
535         (auth_type_compare_func): make this work. oops.
536         (extract_challenge): plug leak
537
538         * libsoup/soup-auth-manager-ntlm.c: Make this work async too.
539
540         * libsoup/soup-headers.c (soup_header_parse_list):
541         (soup_header_parse_param_list): plug leaks
542
543         * tests/auth-test.c (do_async_auth_test): test async auth
544
545         * docs/reference/client-howto.xml (Handling Authentication):
546         mention async auth
547
548 2008-01-16  Dan Winship  <danw@gnome.org>
549
550         * configure.in: Bomb out if glib 2.15.0 isn't found.
551         (AM_PATH_GLIB_2_0 doesn't do this itself.)
552
553 2008-01-15  Dan Winship  <danw@gnome.org>
554
555         * libsoup/soup-auth-manager-ntlm.c: Replaces SoupConnectionNTLM;
556         now works as a SoupSession::request_started watcher.
557
558         * libsoup/soup-connection.c: remove the no-longer-needed
559         "authenticate" signal
560
561         * libsoup/soup-session.c: Use a SoupAuthManagerNTLM if USE_NTLM is
562         set. Remove connection-authenticate-signal references.
563
564 2008-01-15  Dan Winship  <danw@gnome.org>
565
566         * Merge libsoup-2.4 branch to trunk
567         
568 2008-01-15  Dan Winship  <danw@gnome.org>
569
570         * libsoup/soup-dns.c (resolve_status): Fix the logic here
571
572 2008-01-15  Dan Winship  <danw@gnome.org>
573
574         * docs/reference/porting-2.2-2.4.xml: add a few more updates
575
576 2008-01-15  Dan Winship  <danw@gnome.org>
577
578         * libsoup/soup-auth-digest.c: Use GChecksum for MD5
579
580         * libsoup/soup-md5-utils.[ch]: gone
581
582 2008-01-15  Dan Winship  <danw@gnome.org>
583
584         * libsoup/soup-server.c (soup_server_run_async):
585         (soup_server_quit): Don't ref/unref the server here. It doesn't
586         match the way other things work. #494128, Mathias Hasselmann.
587
588 2008-01-14  Dan Winship  <danw@gnome.org>
589
590         * libsoup/soup-address.h:
591         * libsoup/soup-auth-domain-basic.h:
592         * libsoup/soup-auth-domain-digest.h:
593         * libsoup/soup-auth-domain.h:
594         * libsoup/soup-auth.h:
595         * libsoup/soup-logger.h:
596         * libsoup/soup-message.h:
597         * libsoup/soup-server.h:
598         * libsoup/soup-session-async.h:
599         * libsoup/soup-session-sync.h:
600         * libsoup/soup-session.h:
601         * libsoup/soup-socket.h: Add padding for future expansion to class
602         structs
603
604 2008-01-14  Dan Winship  <danw@gnome.org>
605
606         * libsoup/soup-uri.c: Add more documentation.
607         (soup_uri_is_https): gone, replaced by SOUP_URI_SCHEME_HTTP /
608         SOUP_URI_SCHEME_HTTPS
609         (soup_uri_new): allow passing NULL to get back an "empty" SoupURI.
610         (soup_uri_to_string): rename just_path to just_path_and_query, to
611         avoid fooling people.
612         (soup_uri_decode, soup_uri_normalize): Change these to return the
613         decoded/normalized string rather than modifying it in place.
614         (soup_uri_set_scheme, etc): provide setters for SoupURI parts.
615         (soup_uri_set_query_from_form): set uri->query via
616         soup_form_encode_urlencoded().
617
618 2008-01-14  Dan Winship  <danw@gnome.org>
619
620         * configure.in: require glib 2.15.0, and gio
621
622         * libsoup/soup-dns.c (soup_dns_lookup_resolve)
623         (soup_dns_lookup_resolve_async): Add GCancellables, and support
624         cancellation of DNS lookups.
625         (resolve_address, resolve_name): If we get a DNS failure (eg,
626         because we're disconnected from the network), don't cache that
627         result, just try again next time someone asks. [#508593]
628
629         * libsoup/soup-address.c (soup_address_resolve_async)
630         (soup_address_resolve_sync): Add GCancellables, pass them to
631         soup-dns.
632
633         * libsoup/soup-socket.c (soup_socket_connect_async)
634         (soup_socket_connect_sync): Add GCancellables and implement
635         cancellation.
636         (soup_socket_start_ssl, soup_socket_start_proxy_ssl)
637         (soup_socket_read, soup_socket_read_until, soup_socket_write): add
638         GCancellables, though these routines don't actually implement
639         cancellation yet.
640         (soup_socket_disconnect): Don't close() the socket if someone is
641         doing I/O on it, as that creates a race condition. (The fd number
642         might be quickly recycled.) Instead, keep the socket open but
643         dead, via shutdown().
644
645 2008-01-14  Benjamin Otte  <otte@gnome.org>
646
647         * libsoup/soup-socket.c: (soup_socket_class_init): clarify docs for
648         new-connection signal.
649
650 2008-01-14  Dan Winship  <danw@gnome.org>
651
652         * tests/test-utils.c: renamed from apache-wrappers and expanded.
653         (test_init): do option parsing and general setup
654         (test_cleanup): print error count and do cleanup
655         (debug_printf): define here rather than in each test, and rename
656         from dprintf [#501631]
657         (soup_test_server_new): create a SoupServer, optionally in its own
658         thread, and clean it up when exiting.
659         (soup_test_session_new): create a SoupSession, optionally with
660         an attached SoupLogger (if requested via command line)
661         
662         * tests/*.c: use test-utils
663
664 2008-01-13  Dan Winship  <danw@gnome.org>
665
666         * libsoup/soup-logger.c: New HTTP debug logging object. (Based on
667         E2K_DEBUG and its clones.)
668
669         * libsoup/soup-message.c (soup_message_class_init)
670         (soup_message_add_header_handler)
671         (soup_message_add_status_code_handler): Change things around a
672         little; remove the "requeuing or cancelling the message stops
673         signal emission" rule, and instead make that be a feature of just
674         the header and status code handlers. (Makes the basic signal
675         handlers behave more predictably.)
676
677 2008-01-11  Dan Winship  <danw@gnome.org>
678
679         * libsoup/soup-auth-domain.c (soup_auth_domain_set_filter):
680         * libsoup/soup-auth-domain-basic.c
681         (soup_auth_domain_basic_set_auth_callback):
682         * libsoup/soup-auth-domain-digest.c
683         (soup_auth_domain_digest_set_auth_callback):
684         * libsoup/soup-message.c (soup_message_cleanup_response)
685         (soup_message_set_flags, soup_message_set_http_version)
686         (soup_message_set_uri, soup_message_set_status)
687         (soup_message_set_status_full): 
688         * libsoup/soup-message-client-io.c (parse_response_headers): 
689         * libsoup/soup-message-server-io.c (parse_request_headers):
690         Call g_object_notify() when changing properties.        
691
692         * libsoup/soup-session.c (soup_session_class_init): bump the
693         default value of SOUP_SESSION_MAX_CONNS_PER_HOST down to 2, per
694         RFC 2616.
695
696         * libsoup/soup-message-body.c (soup_buffer_copy): When copying a
697         TEMPORARY buffer, keep a reference to the copy, so that a second
698         copy will get that same buffer, rather than actually copying it
699         again.
700
701         * libsoup/soup-types.h: remove SoupMessageFilter, which doesn't
702         exist any more
703
704 2008-01-07  Dan Winship  <danw@gnome.org>
705
706         * libsoup/soup-session.c (soup_session_class_init): Change
707         request_started signal to have a SoupSocket as its last parameter.
708
709         * libsoup/soup-server.c: Fix request_* signals to all be (server,
710         msg, client) rather than (server, client, msg).
711
712 2008-01-07  Dan Winship  <danw@gnome.org>
713
714         * docs/reference/porting-2.2-2.4.xml: Notes on porting from 2.2 to
715         2.4
716
717 2008-01-07  Dan Winship  <danw@gnome.org>
718
719         * libsoup/*.c: Move gtk-doc stuff from docs/reference/tmpl/ to the
720         C files themselves. Some updates.
721
722         * docs/reference/Makefile.am: fix (kludge?) this up to not require
723         tmpl/ to exist
724
725         * docs/reference/client-howto.xml: 
726         * docs/reference/server-howto.xml: update
727
728 2008-01-06  Dan Winship  <danw@gnome.org>
729
730         * libsoup/soup-soap-message.c:
731         * libsoup/soup-soap-response.c: For the second time, remove SOAP
732         support from libsoup... These APIs are not really all that helpful
733         in the grand scheme of SOAPiness, and are only used by the
734         Evolution GroupWise backend, which can just import this code and
735         integrate it better there.
736
737         * libsoup/soup-misc.c (soup_xml_real_node): 
738         * libsoup/soup-xmlrpc.c: Move soup_xml_real_node out of soup-misc
739         to soup-xmlrpc, and make it private. libxml is no longer exposed
740         in the public API.
741
742 2008-01-06  Dan Winship  <danw@gnome.org>
743
744         * libsoup/soup-date.c (soup_date_new_from_now): new method to
745         generate a date relative to now.
746         (soup_date_new, etc): document SoupDate methods
747
748         * libsoup/soup-server.c (got_headers): set Date header, as
749         required by RFC 2616
750
751 2008-01-06  Dan Winship  <danw@gnome.org>
752
753         * libsoup/soup-server.c (got_headers): if raw_paths isn't set,
754         decode the request's uri->path before doing anything else
755         (soup_server_class_init): add "raw-paths" property, to tell
756         SoupServer to NOT decode the Request-URI path.
757
758         * libsoup/soup-auth-domain.c (soup_auth_domain_covers): Revert
759         earlier path-decoding change; that happens at the SoupServer level
760         now.
761
762 2008-01-06  Dan Winship  <danw@gnome.org>
763
764         * libsoup/soup-message-body.c (soup_buffer_get_type): Register
765         SoupBuffer as a boxed type.
766
767         * libsoup/soup-message.c (soup_message_class_init): Use
768         SOUP_TYPE_BUFFER in got_chunk signal definition
769
770         * libsoup/soup-server.c (soup_client_context_get_type): Register
771         SoupClientContext as a pointer type
772         (soup_server_class_init): use SOUP_TYPE_CLIENT_CONTEXT in signal
773         definitions.
774
775         * libsoup/soup-marshal.list: clean this up
776
777 2008-01-06  Dan Winship  <danw@gnome.org>
778
779         * libsoup/soup-server.c (SoupClientContext): Make this opaque.
780         (soup_client_context_get_socket)
781         (soup_client_context_get_auth_domain)
782         (soup_client_context_get_auth_user): New accessors
783         (soup_server_class_init): Make the signals take a
784         SoupClientContext rather than a SoupSocket.
785         (start_request, check_auth, call_handler, request_finished): Clean
786         these up by using a SoupClientContext to communicate between them.
787         (soup_server_add_handler): tweak the argument order to match the
788         gtk standard (callback, user_data, destroynotify).
789
790 2008-01-06  Dan Winship  <danw@gnome.org>
791
792         * libsoup/soup-address.c: remove the "dns_result" signal, which
793         was just an implementation detail of soup_address_resolve_async().
794
795 2008-01-06  Dan Winship  <danw@gnome.org>
796
797         * libsoup/*.c: misc documentation updates/gtk-doc fixes
798
799         * libsoup/soup-server.c: finally start documenting this properly.
800
801         * libsoup/soup-status.h (SoupStatusClass): kill this, since
802         soup_message_add_status_class_handler() is gone now.
803
804         * libsoup/soup-status.c (soup_status_get_phrase): Update docs to
805         explain that you probably don't want to use this.
806
807         * libsoup/soup-misc.h (SOUP_SSL_ERROR, SoupSSLError): Move these
808         here, since soup-ssl.h isn't installed.
809
810         * docs/references: start updating this...
811
812 2008-01-04  Dan Winship  <danw@gnome.org>
813
814         * libsoup/soup-message-body.c (soup_buffer_new)
815         (soup_message_body_append): Reorder the arguments to match
816         soup_message_set_request/response, so it's not confusing.
817
818         * libsoup/soup-message.c (wrote_chunk): remove the "chunk" arg
819         from the signal, as it turns out to be *in*convenient, since most
820         callers use this signal to mean "need another chunk", so they want
821         it to have the same prototype as "wrote_headers", which means
822         "need first chunk".
823
824 2008-01-04  Dan Winship  <danw@gnome.org>
825
826         * libsoup/soup-auth-domain.c: add documentation
827         (soup_auth_domain_set_filter): take a GDestroyNotify, for better
828         bindability
829
830         * libsoup/soup-auth-domain-basic.c:
831         * libsoup/soup-auth-domain-digest.c: Add documentation. Replace
832         authentication signals with more-easily-bindable authentication
833         callbacks (with GDestroyNotifys).
834         (soup_auth_domain_digest_evil_check_password): Add this for the
835         benefit of code that depends on being able to do the equivalent
836         of the old soup_server_auth_check_passwd().
837
838 2008-01-02  Dan Winship  <danw@gnome.org>
839
840         * libsoup/soup-message-body.h (SoupMessageBody): add data and
841         length parameters like SoupBuffer, to make this easier for callers
842         to use.
843
844         * libsoup/soup-message-body.c (soup_message_body_append)
845         (soup_message_body_append_buffer)
846         (soup_message_body_truncate): Update body->length
847         (soup_message_body_flatten): Fill in body->data (and NUL-terminate
848         it as an added bonus).
849
850         * libsoup/soup-message.c (got_body): flatten the newly-gotten
851         body.
852         (soup_message_get_request, soup_message_get_response): gone
853         
854         * libsoup/soup-message-client-io.c (get_request_headers): 
855         * libsoup/soup-message-server-io.c (get_response_headers): 
856         * libsoup/soup-soap-message.c (soup_soap_message_parse_response):
857         * tests/*.c: simplify
858
859 2008-01-02  Dan Winship  <danw@gnome.org>
860
861         * libsoup/Makefile.am (soup_headers): oops, move soup-auth.h here
862
863 2008-01-02  Dan Winship  <danw@gnome.org>
864
865         * libsoup/soup-form.c: new HTML-form-related methods (just URI
866         decoding/encoding at the moment).
867
868         * libsoup/soup-server.h (SoupServerCallback): change the prototype
869         to include the decoded path and query rather than the undecoded
870         URI.
871
872         * libsoup/soup-server.c (call_handler): %-decode the URI path
873         before looking up a handler. Decode query if available. Pass path
874         and query to the callback.
875
876         * libsoup/soup-auth-domain.c (soup_auth_domain_covers): fix this
877         to %-decode the URI path before testing it
878
879         * libsoup/soup-message-body.c (soup_message_body_append): allow
880         0-length appends
881
882         * tests/query-test.c: URI query parsing test
883
884 2008-01-02  Dan Winship  <danw@gnome.org>
885
886         * libsoup/soup-uri.c:
887         * libsoup/soup-uri.h: Change all the "const SoupURI *" to just
888         "SoupURI *", since the const is just there to be annoying.
889
890         * */*.c: update
891
892 2008-01-02  Dan Winship  <danw@gnome.org>
893
894         * libsoup/soup-message-body.c (soup_message_body_get_length)
895         (soup_message_body_get_chunk): Use goffset rather than gsize for
896         references to the entire size of the message body. (SoupBuffer
897         still uses gsize, so individual chunks can only be G_MAXSIZE
898         long.)
899         
900         * libsoup/soup-message-headers.c
901         (soup_message_headers_get_content_length):
902         (soup_message_headers_set_content_length): Likewise, use goffset.
903
904 2008-01-02  Dan Winship  <danw@gnome.org>
905
906         * libsoup/soup-message-headers.c (soup_message_headers_get):
907         Renamed from soup_message_headers_find, and with new behavior; now
908         multiple headers with the same name are automatically merged
909         together into a single comma-separated value, to ensure that apps
910         treat multivalued headers the same regardless of how upstream
911         servers generate them.
912         (soup_message_headers_find_nth): no longer needed/wanted
913
914         * libsoup/soup-auth-manager.c: Update to deal with
915         SoupMessageHeaders change. (Ugh.)
916
917         * tests/header-parsing.c: Update multiple-values test, and undo a
918         change that mistakenly got committed while debugging something
919         earlier.
920
921 2008-01-01  Dan Winship  <danw@gnome.org>
922
923         * libsoup/soup-auth-manager.c:
924         * libsoup/soup-dns.c: 
925         * libsoup/soup-gnutls.c: 
926         * libsoup/soup-message.c: 
927         * libsoup/soup-message-io.c: 
928         * libsoup/soup-message-queue.c: 
929         * libsoup/soup-misc.c: 
930         * libsoup/soup-path-map.c: 
931         * libsoup/soup-server.c: 
932         * libsoup/soup-session.c: 
933         * libsoup/soup-session-sync.c: 
934         * libsoup/soup-socket.c: Use g_slice.
935
936 2008-01-01  Dan Winship  <danw@gnome.org>
937
938         * libsoup/soup-session.c (soup_session_cancel_message): add a
939         "status_code" argument rather than having the caller set the
940         status code separately, to prevent a race condition.
941
942 2008-01-01  Dan Winship  <danw@gnome.org>
943
944         * libsoup/soup-session.c (soup_session_queue_message): change the
945         callback type to include the SoupSession as a parameter as well.
946
947         * *.c: update
948
949 2007-12-31  Dan Winship  <danw@gnome.org>
950
951         * libsoup/soup-session.c (soup_session_class_init): change
952         the "authenticate" signal to include a SoupAuth rather than its
953         components, and to have a "retrying" parameter rather than
954         separating "authenticate" and "reauthenticate".
955
956         * libsoup/soup-connection.c (soup_connection_class_init): Likewise
957
958         * libsoup/soup-auth-manager.c (authenticate_auth): update
959
960         * libsoup/soup-auth.c: make various attributes into gobject
961         properties.
962         (soup_auth_is_for_proxy): check whether an auth is plain or proxy
963         (soup_auth_get_host): get the hostname associated with an auth
964
965         * libsoup/soup-auth-ntlm.c: dummy class used by SoupConnectionNTLM
966         in the authenticate signal
967
968         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): update for
969         authenticate signals changes; use a fake SoupAuthNTLM to assist.
970
971 2007-12-20  Dan Winship  <danw@gnome.org>
972
973         * libsoup/soup-message.c (soup_message_add_header_handler)
974         (soup_message_add_status_code_handler): Make these be wrappers
975         around g_signal_connect() rather than having a completely separate
976         system.
977         (soup_message_class_init): improve signal docs. Use
978         "got_foo_signal_wrapper" to wrap the got-foo signals.
979         (got_foo_signal_wrapper): Wraps the marshaller for the got-foo
980         signals and cancels the signal emission if the message gets
981         cancelled or requeued.
982         (got_informational, got_headers, got_chunk, got_body): remove
983         no-longer-needed default implementations.
984
985         * libsoup/soup-message-handlers.c: gone
986
987         * tests/ntlm-test.c (do_message): Simplify now that callback
988         processing doesn't happen in two separate phases.
989
990 2007-12-20  Dan Winship  <danw@gnome.org>
991
992         * libsoup/soup-auth-domain.c:
993         * libsoup/soup-auth-domain-basic.c:
994         * libsoup/soup-auth-domain-digest.c: New server-side auth system.
995
996         * libsoup/soup-server.c: remove SoupServerAuth / SoupAuthContext
997         stuff, add SoupAuthDomain support.
998         (SoupServerCallbackFn): improve the args here
999         (SoupClientContext): renamed from SoupServerContext and made less
1000         redundant
1001
1002         * libsoup/soup-server-auth.c: gone!
1003
1004         * libsoup/soup-auth-digest.c (soup_auth_digest_parse_algorithm)
1005         (soup_auth_digest_get_algorithm, soup_auth_digest_parse_qop)
1006         (soup_auth_digest_get_qop, soup_auth_digest_compute_hex_urp)
1007         (soup_auth_digest_compute_hex_a1)
1008         (soup_auth_digest_compute_response): New routines shared between
1009         client-side and server-side digest auth.
1010
1011         * tests/server-auth-test.c: test server-side auth, using curl for
1012         the client side
1013
1014         * configure.in: check for curl, for server-auth-test
1015
1016 2007-12-20  Dan Winship  <danw@gnome.org>
1017
1018         * libsoup/soup-headers.c (soup_header_parse_list)
1019         (soup_header_parse_quality_list): New methods to parse list-type
1020         headers (with optional qvalues) correctly.
1021         (soup_header_parse_param_list): Rename to match the other methods,
1022         and update the semantics a bit.
1023         (soup_header_contains): Correctly check for a token in a list
1024
1025         * libsoup/soup-message.c (soup_message_is_keepalive):
1026         * libsoup/soup-message-client-io.c (get_request_headers):
1027         * libsoup/soup-message-server-io.c (parse_request_headers): Use
1028         soup_header_contains() with Connection headers.
1029
1030         * tests/header-parsing.c (do_qvalue_tests): add
1031         soup_header_parse_quality_list() test
1032
1033 2007-12-20  Dan Winship  <danw@gnome.org>
1034
1035         * libsoup/soup-auth-manager.c: Move auth-related code from
1036         SoupSession and SoupAuth here, and make various cleanups and
1037         beginnings of cleanups.
1038
1039         * libsoup/soup-session.c: lots of stuff moved to
1040         soup-auth-manager.c
1041
1042         * libsoup/soup-auth.c (soup_auth_new_from_headers): partly moved
1043         to soup-auth-manager.c, partly renamed to soup_auth_new().
1044         (soup_auth_update): new method to update an existing auth based on
1045         a new WWW-Authenticate/Proxy-Authenticate header. Also replaces
1046         the old "construct" method.
1047
1048         * libsoup/soup-auth-digest.c (update): Implement. If the new auth
1049         has stale=true, don't invalidate the auth, just update the nonce.
1050         (get_authorization): add a header handler to the message to catch
1051         Authentication-Info/Proxy-Authentication-Info headers so that if
1052         there's a nextnonce, we can start using it. #471380.
1053
1054         * libsoup/soup-auth-basic.c (update): Implement. (Updating an
1055         existing Basic auth always invalidates it.)
1056
1057         * tests/http.conf.in:
1058         * tests/auth-test.c: add a test for digest nonce handling
1059
1060 2007-12-20  Dan Winship  <danw@gnome.org>
1061
1062         * libsoup/soup-path-map.c: New type representing a sparse
1063         path->something mapping
1064
1065         * libsoup/soup-server.c: Use SoupPathMap to record handlers. Make
1066         SoupServerHandler a private type.
1067         (soup_server_new): Rewrite this to just be a thin wrapper, and put
1068         all of the code into a constructor override. #491653
1069         (soup_server_add_handler): Turn the "unregister" arg into a
1070         GDestroyNotify, for better bindability.
1071
1072 2007-12-19  Dan Winship  <danw@gnome.org>
1073
1074         * libsoup/soup-server.c: define new request_started, request_read,
1075         request_finished, and request_aborted signals, for finer-grained
1076         tracking than normal handlers allow.
1077         (check_auth): split this out of call_handler, and run it
1078         immediately after "got_headers", not "got_body", so that we can
1079         preemptively reject "Expect: 100-continue" messages that will
1080         require auth.
1081
1082         * libsoup/soup-message-io.c (io_write, io_read): Fix up
1083         100-continue processing
1084
1085         * tests/continue-test.c: new test of client/server 100-continue
1086         processing
1087
1088 2007-12-19  Dan Winship  <danw@gnome.org>
1089
1090         * libsoup/soup-socket.c: Cleanup. Remove the "connect_result"
1091         signal. Make local_address and remote_address
1092         into (construct-only) properties.
1093         (soup_socket_connect_async, soup_socket_connect_sync): Replace
1094         soup_socket_connect. _async takes a callback+user_data (like the
1095         old soup_socket_client_new_async), but doesn't implement the
1096         callback in terms of a connect_result signal.
1097         (soup_socket_client_new_async, soup_socket_client_new_sync): Gone.
1098         (Unused since the async_context addition anyway). Replaced by the
1099         new construct properties and connect methods.
1100         (soup_socket_read, soup_socket_read_until, soup_socket_write):
1101         Make these actually take a GError rather than doing an ugly hack
1102         to preserve the old API.
1103         (SOUP_SOCKET_FLAG_NODELAY, SOUP_SOCKET_FLAG_REUSEADDR)
1104         (SOUP_SOCKET_FLAG_CLOEXEC): kill these off (all three are always
1105         TRUE now); SoupSocket is libsoup's socket API; it's not
1106         necessarily intended to be generically useful for everyone.
1107
1108         * *.c: Update for SoupSocket changes
1109
1110 2007-12-19  Dan Winship  <danw@gnome.org>
1111
1112         * libsoup/soup-server-message.c: Kill!
1113
1114         * libsoup/soup-message-server-io.c (parse_request_headers):
1115         Generate the full request URL from the socket's data, since we no
1116         longer have soup_server_message_get_server().
1117
1118         * libsoup/soup-server.c (request_finished, call_handler)
1119         (start_request, new_connection): update
1120
1121 2007-12-19  Dan Winship  <danw@gnome.org>
1122
1123         * libsoup/soup-message-headers.c: Add some more fields to
1124         SoupMessageHeaders, and start caching the parsed values of certain
1125         important headers.
1126         (soup_message_headers_get/set_encoding): replaces old SoupMessage
1127         methods, and only deals with the declared transfer encoding, not
1128         the wire encoding.
1129         (soup_message_headers_get/set_content_length): Handle
1130         Content-Length.
1131         (soup_message_headers_get_expectations): Handle Expect. (Replaces
1132         the SOUP_MESSAGE_EXPECT_CONTINUE flag).
1133
1134         * libsoup/soup-message.c (soup_message_get_request_encoding):
1135         (soup_message_get_response_encoding):
1136         (soup_message_set_response_encoding): replaced by
1137         SoupMessageHeaders methods.
1138
1139         * libsoup/soup-message-client-io.c:
1140         * libsoup/soup-message-server-io.c:
1141         * libsoup/soup-message-io.c: Update for SoupMessageHeaders changes
1142         with encoding/content-length stuff.
1143
1144 2007-12-19  Dan Winship  <danw@gnome.org>
1145
1146         * libsoup/soup-message-body.c (SoupMessageBody): new opaque type
1147         for request/response bodies allowing less hacky handling of
1148         chunked encoding.
1149         (SoupBuffer): refcounted buffer type
1150
1151         * libsoup/soup-message.h (SoupMessage): turn request and response
1152         members into SoupMessageBody.
1153         (SoupOwnership, SoupDataBuffer): gone, replaced by
1154         SoupMessageBody/SoupBuffer.
1155
1156         * libsoup/soup-message.c (soup_message_wrote_chunk)
1157         (soup_message_got_chunk): add the chunk as a signal param rather
1158         than having it be visible in msg->request/response.
1159         (soup_message_add_chunk, soup_message_add_final_chunk)
1160         (soup_message_pop_chunk): replaced by SoupMessageBody methods now.
1161
1162 2007-12-19  Dan Winship  <danw@gnome.org>
1163
1164         * libsoup/soup-xmlrpc.c:
1165         * libsoup/soup-value-utils.c: Oops. Change the API a bunch so this
1166         works on x86; apparently I was doing illegal things with va_lists
1167         before that only work on x86_64.
1168
1169 2007-12-14  Dan Winship  <danw@gnome.org>
1170
1171         * libsoup/soup-message.c: use GObject properties for SoupMessage
1172         fields.
1173
1174         * libsoup/soup-message-server-io.c: 
1175         * libsoup/soup-soap-message.c: update for that
1176
1177 2007-12-14  Dan Winship  <danw@gnome.org>
1178
1179         * libsoup/soup-uri.c: Rename from SoupUri to SoupURI. Use the
1180         slice allocator and register as a boxed type.
1181         (SoupURI): Rename "protocol" field to "scheme" and "passwd" to
1182         "password". Make scheme an interned string. Replace
1183         SOUP_PROTOCOL_HTTPS with soup_uri_is_https().
1184
1185         * *.c: update
1186         
1187 2007-12-14  Dan Winship  <danw@gnome.org>
1188
1189         * libsoup/Makefile.am: Use glib-mkenums to build soup-enum-types.c
1190         and soup-enum-types.h
1191
1192         * libsoup/soup-address.h (SoupAddressFamily): redo this definition
1193         again, to make glib-mkenums happy.
1194
1195 2007-12-13  Dan Winship  <danw@gnome.org>
1196
1197         * libsoup/soup-xmlrpc.c: New easier-to-use and
1198         easier-to-do-language-bindings-of XML-RPC code.
1199
1200         * libsoup/soup-xmlrpc-message.c: 
1201         * libsoup/soup-xmlrpc-response.c: gone
1202
1203         * libsoup/soup-value-utils.c: Utilites for working with
1204         GValueArray, and GHashTables of GValues, used by soup-xmlrpc.
1205
1206         * tests/getbug.c: 
1207         * tests/xmlrpc-test.c: Update to use new XML-RPC stuff
1208
1209 2007-12-13  Dan Winship  <danw@gnome.org>
1210
1211         * libsoup/soup-date.c: Make a SoupDate type, and redo in terms of
1212         that rather than struct tm and time_t. Also be much more liberal
1213         when parsing.
1214
1215         * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_write_datetime): 
1216         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_datetime):
1217         Use SoupDate.
1218
1219         * tests/date.c: Use SoupDate, test parsing lots more formats
1220
1221         * tests/xmlrpc-test.c: update for SoupDate
1222
1223 2007-12-12  Dan Winship  <danw@gnome.org>
1224
1225         * libsoup/soup-message.c: 
1226         * libsoup/soup-message-private.h: Remove SoupMessageStatus,
1227         msg->status, and soup_message_io_* from the public API, as they
1228         all really belong to the session, not the message. (For now
1229         they've just been moved to soup-message-private.h, but some day
1230         they'll be fully refactored away from SoupMessage.)
1231
1232         * libsoup/soup-server.c (soup_server_pause_message)
1233         (soup_server_unpause_message): 
1234         * libsoup/soup-session.c (soup_session_pause_message)
1235         (soup_session_unpause_message): session/server-level methods to
1236         replace soup_message_io_pause() and soup_message_io_unpause().
1237
1238         * libsoup/soup-server-message.c: Remove some unused methods
1239
1240         * */*.c: Update
1241
1242 2007-12-05  Dan Winship  <danw@gnome.org>
1243
1244         * libsoup/soup-connection.c:
1245         * libsoup/soup-session.c: replace message filters with a
1246         "request_started" signal
1247
1248         * libsoup/soup-message-filter.c: gone
1249
1250         * libsoup/soup-types.h (SOUP_MAKE_INTERFACE): no longer needed
1251
1252 2007-12-05  Dan Winship  <danw@gnome.org>
1253
1254         * libsoup/soup-uri.c: Update for RFC 3986 changes, bgo 266516, and
1255         general conformance
1256         (soup_uri_get_protocol): match protocols case-insensitively
1257         (soup_uri_new_with_base): Don't fully %-decode the fragment,
1258         query, and path, but do %-decode anything which isn't supposed to
1259         be encoded. Recognize IPv6 address literals. Use stricter
1260         "../"-stripping rules on the path. Reject URIs with junk between
1261         the port number and the path.
1262         (soup_uri_to_string): Update for the fact that the host might be
1263         an IPv6 literal, and for the fact that path, query, and fragment
1264         are now pre-escaped.
1265         (soup_uri_equal): compare hostnames case-insensitively
1266         (uri_encoded_char): update to match RFC 3986
1267         (append_uri_encoded): use uppercase hex letters as recommended by
1268         RFC 3986.
1269         (soup_uri_normalize): decode only %-escapes that don't belong
1270         there.
1271
1272         * docs/reference/tmpl/soup-uri.sgml: add some more SoupUri docs
1273
1274         * tests/uri-parsing.c: Add new tests from RFC 3986, RFC 2732, RFC
1275         2616, bgo 266516, and elsewhere. Update some tests to match new
1276         parsing/unparsing rules.
1277
1278 2007-12-05  Dan Winship  <danw@gnome.org>
1279
1280         * libsoup/soup-message.c (soup_message_new)
1281         (soup_message_new_from_uri): g_intern_string() the method name
1282         rather than assuming it's static. Also remove the NULL==GET
1283         assumption.
1284
1285         * libsoup/soup-method.c:
1286         * libsoup/soup-method.h: remove the SOUP_METHOD_ID_* macros, and
1287         have the SOUP_METHOD_* macros return interned strings
1288
1289         * libsoup/soup-server.h (SoupServerContext): remove method_id
1290         field.
1291
1292         * libsoup/soup-server-message.c (finalize): no longer needed,
1293         since smsg->method is now an interned string just like with a
1294         normal SoupMessage.
1295
1296         * libsoup/soup-soap-message.c (soup_soap_message_new_from_uri):
1297         remove NULL==GET assumption
1298
1299         * *.c: update
1300
1301 2007-12-05  Dan Winship  <danw@gnome.org>
1302
1303         * libsoup/soup-message.h (SoupHTTPVersion): rename (from
1304         SoupHttpVersion)
1305
1306         * libsoup/soup-message-headers.c: New opaque type representing
1307         message headers, and new methods that work on it. Uses an array
1308         rather than a hash table, to preserve header ordering as required
1309         by RFC 2616. (Also fixes the API wart that
1310         "soup_message_get_header", etc, did not actually take a
1311         SoupMessage.)
1312
1313         * libsoup/soup-message.c: Kill off old header-manipulating
1314         methods.
1315
1316         * libsoup/soup-headers.c (soup_headers_parse_request): return a
1317         guint rather than gboolean, so we can properly return
1318         SOUP_STATUS_HTTP_VERSION_NOT_SUPPORTED where appropriate. Also fix
1319         up HTTP-Version parsing to conform with the RFC.
1320         (soup_headers_parse_status_line): Likewise update HTTP-Version
1321         parsing.
1322         
1323         * libsoup/soup-message-server-io.c (parse_request_headers): set
1324         return status appropriately on parse errors
1325
1326         * tests/header-parsing.c: update / add more tests
1327
1328         * *.c: update
1329
1330 2007-12-05  Dan Winship  <danw@gnome.org>
1331
1332         * libsoup/soup-misc.c: remove deprecated base64 methods
1333
1334         * tests/auth-test.c (identify_auth): oops, update to use
1335         g_base64_decode.
1336
1337 2007-12-05  Dan Winship  <danw@gnome.org>
1338
1339         * libsoup/Makefile.am (libsoupinclude_HEADERS): remove
1340         soup-connection.h and soup-message-queue.h
1341
1342         * libsoup/soup-types.h: remove SoupConnection and SoupMessageQueue
1343         which are no longer public
1344
1345         * libsoup/soup.h: sync this to reality for the first time in years
1346
1347         * libsoup/soup-session.c (soup_session_get_queue): Add this, for
1348         subclasses, as the queue is no longer a public part of the session
1349         struct.
1350
1351         * libsoup/soup-message.h:
1352         * libsoup/soup-message-private.h: Move soup_message_send_request()
1353         and soup_message_receive_request() to soup-message-private.h,
1354         remove soup_message_send_request_internal().
1355
1356         * libsoup/soup-session-private.h: Move "protected" SoupSession
1357         methods (soup_session_get_connection,
1358         soup_session_try_prune_connection) here from soup-session.h
1359         Add soup_session_get_queue.
1360
1361 2007-12-05  Dan Winship  <danw@gnome.org>
1362
1363         * configure.in: bump version to 2.3.0 and SOUP_API_VERSION to 2.4,
1364         and drop AGE/CURRENT/REVISION all to 0.
1365
1366         * libsoup/Makefile.am: Rename library to libsoup-2.4.la
1367
1368         (start of libsoup-2.4 branch)
1369
1370 2007-11-26  Dan Winship  <danw@gnome.org>
1371
1372         * configure.in: 2.2.104
1373
1374         * NEWS: update
1375
1376 2007-11-21  Dan Winship  <danw@gnome.org>
1377
1378         * libsoup/soup-message-io.c (soup_message_io_cleanup): make this
1379         non-static.
1380
1381         * libsoup/soup-message.c (finalize): Use soup_message_io_cleanup()
1382         rather than soup_message_io_stop(), to avoid leaks when finalizing
1383         an unfinished message. (Another part of #498509, Wouter Cloetens.)
1384
1385 2007-11-20  Dan Winship  <danw@gnome.org>
1386
1387         Fix up SOUP_SESSION_ASYNC_CONTEXT. #498509, Wouter Cloetens
1388
1389         * libsoup/soup-message-io.c (soup_message_io_unpause): don't leak
1390         the async_context
1391
1392         * libsoup/soup-server.c (soup_server_quit): disconnect the
1393         "new_connection" handler.
1394         (soup_server_get_async_context): Convenience method to return the
1395         server's async_context.
1396
1397         * libsoup/soup-server-message.c: don't circularly ref the server,
1398         there's no need anyway.
1399
1400         * libsoup/soup-session.c (soup_session_get_async_context):
1401         Convenience method to return the session's async_context.
1402
1403         * libsoup/soup-session-async.c (queue_message): call run_queue in
1404         the session's async_context, not the main context.
1405         (send_message): don't leak the async_context
1406
1407         * libsoup/soup-session-sync.c (queue_message_thread): don't leak
1408         the async_context
1409
1410         * tests/context-test.c: test that SOUP_SESSION_ASYNC_CONTEXT works
1411         and doesn't leak
1412
1413 2007-11-20  Dan Winship  <danw@gnome.org>
1414
1415         * libsoup/soup-connection.c (soup_connection_connect_async): don't
1416         leak the SoupAddress.
1417
1418         * libsoup/soup-dns.c (soup_dns_lookup_resolve_async): fix a leak
1419         when re-looking up an address
1420
1421         * libsoup/soup-session.c (soup_session_abort): close all
1422         connections in addition to cancelling messages (needed because
1423         connections currently end up holding a ref on their session,
1424         preventing them from being destroyed).
1425
1426         * tests/auth-test.c:
1427         * tests/ntlm-test.c:
1428         * tests/proxy-test.c:
1429         * tests/pull-api.c:
1430         * tests/ssl-test.c:
1431         * tests/xmlrpc-test.c: clean up more memory on exit, to help find
1432         leaks in the library
1433
1434         * tests/libsoup.supp: add a zillion new suppressions so we
1435         can use --leak-resolution=med
1436
1437 2007-11-16  Dan Winship  <danw@gnome.org>
1438
1439         * libsoup/soup-message-io.c (read_body_chunk): Fix the guards
1440         around the got_chunk emission so that it doesn't get messed up if
1441         you pause the I/O from the got_chunk handler. (#452280, Marco
1442         Barisione).
1443         (soup_message_io_pause, soup_message_io_unpause): Update docs
1444         again; these are now allowed with client-side I/O as well. Fix
1445         unpause() to unpause asynchronously on async sockets.
1446         
1447         * libsoup/soup-session-async.c (send_message): Iterate session's
1448         async_context, not the default main context.
1449
1450         * tests/pull-api.c: Test/sample of creating a pull-style API using
1451         SoupSessionAsync.
1452
1453         * tests/index.txt: new file to act as DirectoryIndex for the
1454         tests. (In particular, pull-api wants this to be largeish.)
1455
1456 2007-10-28  Dan Winship  <danw@gnome.org>
1457
1458         * configure.in: 2.2.103
1459
1460         * NEWS: update
1461
1462 2007-10-28  Dan Winship  <danw@gnome.org>
1463
1464         * libsoup/soup-server.c (start_request, request_finished): ref the
1465         socket around the processing of the message, since otherwise it
1466         might already be freed when request_finished runs. #459896.
1467
1468         * libsoup/soup-message-io.c (soup_message_io_pause)
1469         (soup_message_io_unpause): Clarify the docs here; this is for
1470         server-side use only. Inspired by #452280.
1471
1472         * docs/reference/server-howto.xml: You need to watch the
1473         "finished" signal on the message if using soup_message_io_pause()
1474         or chunked encoding, because the client might disconnect while
1475         you're paused. Clarification inspired by #471385.
1476
1477         * tests/simple-proxy.c (client_msg_failed): Fix this to DTRT since
1478         server-howto.xml points to it as an example of what to do.
1479
1480 2007-10-28  Dan Winship  <danw@gnome.org>
1481
1482         * libsoup/soup-session.c (finalize): free proxy-related stuff
1483
1484         * libsoup/soup-session-async.c (idle_run_queue): clean up the weak
1485         pointer. (From the dev repo, but identical to a patch from Rob
1486         Bradford in #484988.)
1487
1488         * tests/*.c: fix leaks
1489
1490 2007-10-28  Dan Winship  <danw@gnome.org>
1491
1492         * tests/auth-test.c:
1493         * tests/date.c:
1494         * tests/header-parsing.c:
1495         * tests/ntlm-test.c:
1496         * tests/proxy-test.c:
1497         * tests/uri-parsing.c:
1498         * tests/xmlrpc-test.c: Make these less verbose by default (to make
1499         it easier to see what failed when a "make check" fails).
1500
1501 2007-10-15  Dan Winship  <danw@gnome.org>
1502
1503         * configure.in: 2.2.102
1504
1505         * NEWS: update
1506
1507 2007-10-08  Dan Winship  <danw@gnome.org>
1508
1509         * libsoup/soup-nossl.c: Update for current soup-ssl.h prototypes
1510
1511         * tests/proxy-test.c (run_test): wrap https tests in #if HAVE_SSL
1512
1513 2007-10-05  Dan Winship  <danw@gnome.org>
1514
1515         * configure.in: 2.2.101
1516
1517         * NEWS: update
1518
1519         * tests/httpd.conf.in: 
1520         * tests/Makefile.am: 
1521         * tests/ssl-test.c: srcdir != builddir fixes
1522
1523 2007-10-05  Dan Winship  <danw@gnome.org>
1524
1525         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't crash
1526         if the authenticate callback returns a username and no password
1527         (even though it's not supposed to do that). #480987
1528
1529 2007-09-24  Dan Winship  <danw@gnome.org>
1530
1531         * libsoup/soup-auth.h (SoupAuth): add "realm" field to the struct.
1532         (SoupAuthClass) remove "get_realm" virtual method.
1533
1534         * libsoup/soup-auth.c (soup_auth_new_from_header_list): Parse the
1535         WWW-Authenticate/Proxy-Authenticate header here, set realm, and
1536         pass the params hash to the construct method.
1537         (soup_auth_get_info): Return an identifier for the auth:
1538         "SCHEME:REALM"
1539
1540         * libsoup/soup-auth-basic.c:
1541         * libsoup/soup-auth-digest.c: update
1542
1543         * libsoup/soup-session.c (invalidate_auth, update_auth_internal):
1544         use soup_auth_get_info().
1545
1546 2007-09-24  Dan Winship  <danw@gnome.org>
1547
1548         * libsoup/soup-date.c (soup_date_parse): minor rfc850-date parsing
1549         improvement suggested by RFC2616 19.3.
1550
1551         * libsoup/soup-headers.c (soup_headers_parse_request): allow
1552         erroneous trailing whitespace after HTTP version. #475169
1553
1554         * libsoup/soup-message-server-io.c (parse_request_headers): fix
1555         the parsing of the Host header to assume it already includes the
1556         port (which it should; the only reason this ever worked is because
1557         SoupUri ignores the second port number when parse_request_headers
1558         generates a URL like "http://localhost:9999:9999/").
1559
1560         * tests/header-parsing.c (reqtests): add a test for #475169
1561
1562 2007-09-23  Dan Winship  <danw@gnome.org>
1563
1564         * libsoup/soup-message.c (soup_message_class_init): remove a
1565         mysterious partial sentence in the ::wrote-chunk docstring.
1566         #458116
1567
1568         * docs/reference/libsoup-sections.txt: Remove documentation of MD5
1569         methods, which are not public. #440092
1570
1571 2007-09-23  Dan Winship  <danw@gnome.org>
1572
1573         * libsoup/soup-message.c (soup_message_set_auth)
1574         (soup_message_set_proxy_auth): Only remove the Authorization /
1575         Proxy-Authorization header from the message if it was previously
1576         set by soup_message_set_auth(). (Eg, not if it was added by
1577         SoupConnectionNTLM.) #471389
1578
1579         * libsoup/soup-connection-ntlm.h: fix a search-and-replace-o
1580
1581         * tests/ntlm-test.c: Simple NTLM regression test; doesn't really
1582         test the crypto/encoding bits, just that the right headers are
1583         being sent at the right times.
1584
1585 2007-09-14  Dan Winship  <danw@gnome.org>
1586
1587         Make "make check" pass on Fedora 7:
1588
1589         * configure.in: update apache/php tests with additional filenames
1590
1591         * tests/httpd.conf.in: updates for configure.in changes and
1592         slightly-more-recent apache
1593
1594         * tests/ssl-test.c (start_writing): fix uninitialized struct field
1595         (main): start server after setting up client since otherwise
1596         there's a race condition since soup_gnutls_init() isn't actually
1597         thread-safe. (FIXME)
1598
1599         * tests/xmlrpc-server.php: rewrite to not use $HTTP_RAW_POST_DATA
1600         (which only exists if register_globals is set)
1601
1602 2007-06-01  Dan Winship  <danw@novell.com>
1603
1604         * libsoup/soup-message-filter.h (SOUP_IS_MESSAGE_FILTER_CLASS):
1605         fix. noted by "cascardo" on libsoup-list.
1606
1607 2007-05-16  Jonathon Jongsma  <jjongsma@gnome.org>
1608
1609         * libsoup/*.h: add G_BEGIN_DECLS / G_END_DECLS to all installed
1610         headers so that libsoup can be used from C++ programs. #438776
1611
1612 2007-04-16  Dan Winship  <danw@novell.com>
1613
1614         * libsoup/soup-ssl.h: Make a real SoupSSLCredentials type rather
1615         than just using gpointer
1616
1617         * libsoup/soup-server.c (SoupServerPrivate): use it
1618
1619         * libsoup/soup-session.c (SoupSessionPrivate): use it
1620
1621         * libsoup/soup-gnutls.c: Use it, and consistently use "creds"
1622         rather than "cred" as the abbreviation for "credentials".
1623
1624         * docs/reference/libsoup-sections.txt:
1625         * docs/reference/tmpl/soup-misc.sgml: 
1626         * docs/reference/tmpl/soup-ssl.sgml: update
1627         
1628 2007-03-29  Dan Winship  <danw@novell.com>
1629
1630         * libsoup/soup-session-sync.c (queue_message): Implement this by
1631         sending the message (synchronously) in another thread and then
1632         queueing the callback back in the main thread.
1633
1634         * libsoup/soup-session.c (soup_session_queue_message): update docs
1635         to be more explicit about what thread the callback occurs in
1636
1637 2007-03-17  Dan Winship  <danw@novell.com>
1638
1639         * libsoup/soup-message.c (soup_message_set_auth)
1640         (soup_message_get_auth, soup_message_set_proxy_auth)
1641         (soup_message_get_proxy_auth): get/set auth/proxy_auth info for a
1642         message.
1643
1644         * libsoup/soup-session.c (add_auth): Use soup_message_set_auth and
1645         soup_message_set_proxy_auth.
1646         (update_auth_internal): Call soup_message_get_auth or
1647         soup_message_get_proxy_auth to determine the message's prior auth,
1648         rather than calling lookup_auth() again, since it isn't guaranteed
1649         to return the same thing now as it did when the message was
1650         originally sent. Fixes erroneous 401s when queuing multiple
1651         messages at once to an as-yet-unauthenticated-to server. #271540
1652
1653         * libsoup/soup-session-async.c (queue_message): don't run the
1654         queue right away, do it at idle time. Otherwise in some cases
1655         (especially errors), the message callbacks could be invoked before
1656         queue_message returns.
1657
1658         * tests/auth-test.c: add a regression test for #271540.
1659
1660 2007-03-17  Dan Winship  <danw@novell.com>
1661
1662         * configure.in: require glib 2.12. check for timegm().
1663
1664         * libsoup/soup-date.c (soup_mktime_utc): Use timegm if available.
1665         (soup_date_iso8601_parse): use g_time_val_from_iso8601. #337010,
1666         patch from Emmanuele Bassi.
1667
1668         * libsoup/soup-types.h: remove local copy of
1669         G_GNUC_NULL_TERMINATED since we now depend on a new-enough copy of
1670         glib.
1671
1672         * libsoup/soup-misc.c (soup_base64_encode_close)
1673         (soup_base64_encode_step, soup_base64_encode)
1674         (soup_base64_decode_step): Make these just be wrappers around the
1675         glib base64 methods. (For now; eventually they'll just go away.)
1676
1677         * libsoup/soup-auth-basic.c (authenticate): 
1678         * libsoup/soup-auth-digest.c (authenticate):
1679         * libsoup/soup-connection-ntlm.c (soup_ntlm_parse_challenge)
1680         (soup_ntlm_response): 
1681         * libsoup/soup-server-auth.c (soup_server_auth_new): 
1682         * libsoup/soup-soap-message.c (soup_soap_message_write_base64): 
1683         * libsoup/soup-xmlrpc-message.c
1684         (soup_xmlrpc_message_write_base64): 
1685         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_base64):
1686         Use glib base64 methods
1687
1688 2007-03-16  Dan Winship  <danw@novell.com>
1689
1690         * libsoup/soup-message.c (soup_message_get_response_encoding):
1691         update the handling of CONNECT: it has no response body by
1692         default, but does have a body if its headers say so.
1693
1694         * tests/proxy-test.c: test libsoup's behavior when talking to
1695         proxies.
1696
1697         * tests/httpd.conf.in: Load mod_proxy and mod_ssl, and add
1698         sections configuring them, for proxy-test
1699
1700         * configure.in: update the apache-module-dir-finding code to deal
1701         with the fact that some modules (eg, mod_ssl) might only be in the
1702         mpm-specific module dir, while others (eg, mod_php5) might only be
1703         in the generic module dir.
1704
1705 2007-03-12  Dan Winship  <danw@novell.com>
1706
1707         * tests/Makefile.am (INCLUDES): add $(LIBGNUTLS_CFLAGS) for
1708         ssl-test. #417617, patch from Elijah Newren.
1709
1710 2007-03-12  Dan Winship  <danw@novell.com>
1711
1712         * libsoup/soup-session-sync.c (wait_for_connection): if
1713         soup_connection_connect_sync() returns SOUP_STATUS_TRY_AGAIN, then
1714         try again. (Duh.) Fixes SSL-via-proxy-when-using-synchronous-I/O-
1715         where-the-proxy-closes-the-connection-when-returning-407. (Reported
1716         by Varadhan.)
1717
1718         * tests/get.c: Rewrite to use soup_session_send_message rather
1719         than soup_session_queue_message, and add a "-s" flag to use
1720         SoupSessionSync rather than SoupSessionAsync (so we can test bugs
1721         in the sync code paths).
1722
1723 2007-03-08  Dan Winship  <danw@novell.com>
1724
1725         * libsoup/soup-gnutls.c (do_handshake): don't return
1726         G_IO_STATUS_AGAIN if we're doing blocking I/O; just keep retrying
1727         until the handshake is complete.
1728         (soup_gnutls_read, soup_gnutls_write): if we get
1729         GNUTLS_E_REHANDSHAKE, call do_handshake() immediately rather than
1730         returning G_IO_STATUS_AGAIN; if the socket is blocking then
1731         G_IO_STATUS_AGAIN is wrong, and if the socket is non-blocking, we
1732         might already need to return SOUP_SSL_ERROR_HANDSHAKE_NEEDS_WRITE
1733         or SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ.
1734
1735         #415402, based on a patch from Jacob Berkman.
1736
1737         * tests/ssl-test.c: basic ssl test. In particular, tests that
1738         rehandshake requests are handled correctly during both synchronous
1739         and asynchronous I/O. Might eventually test other stuff too...
1740
1741         * configure.in: 
1742         * tests/Makefile.am: updates for ssl-test
1743
1744 2007-02-19  Dan Winship  <danw@novell.com>
1745
1746         * configure.in: Get gcrypt libs/cflags.
1747
1748         * libsoup/Makefile.am (INCLUDES, libsoup_2_2_la_LIBADD): add
1749         gcrypt flags. Patch from "Cygwin Ports Maintainer", #384498
1750
1751 2007-02-12  Dan Winship  <danw@novell.com>
1752
1753         * configure.in: 2.2.100
1754
1755 2007-02-12  Dan Winship  <danw@novell.com>
1756
1757         * libsoup/soup-headers.c (soup_headers_parse_status_line): Fix
1758         this to handle "\0"-terminated status lines (eg, from WebDAV
1759         responses), like the docs say it does. #406997
1760         (soup_headers_parse): Balance that out by rejecting internal "\0"s
1761         here.
1762         (soup_headers_parse_request, soup_headers_parse_response): Update
1763         docs to warn that @dest may be modified even on error. (This was
1764         always true, it just wasn't documented.)
1765
1766 2007-01-16  Dan Winship  <danw@novell.com>
1767
1768         * tests/header-parsing.c (do_request_tests, do_response_tests):
1769         initialize "errors" to 0. duh. Pointed out by Michael Wolf.
1770
1771 2007-01-08  Dan Winship  <danw@novell.com>
1772
1773         * configure.in: 2.2.99
1774
1775         * NEWS: update
1776
1777 2007-01-06  Dan Winship  <danw@novell.com>
1778
1779         * libsoup/soup-headers.c (soup_headers_parse): Rewrite this to be
1780         easier to understand and more correct, and make the "str" param
1781         const rather than overwriting it during parsing.
1782         (soup_headers_parse_request, soup_headers_parse_response):
1783         Likewise, make "str" param const. Fix the doc comment to describe
1784         the correct constraint on str. Make the parsing slightly more
1785         lenient as per sections 4.1 and 19.3 of RFC 2616.
1786
1787         * tests/header-parsing.c: new regression test, for Request-Line,
1788         Status-Line, and message-header parsing.
1789
1790         Inspired by #391970 (crash in SoupServer when certain invalid
1791         requests are received).
1792
1793 2006-12-05  Dan Winship  <danw@novell.com>
1794
1795         * libsoup/soup-message.c (soup_message_set_uri): Remove the calls
1796         to soup_message_io_stop() here; the corresponding calls were
1797         needed back in the SoupContext days, but they are wrong now and
1798         cause async-redirects-to-other-hosts to fail. #382251. Also
1799         clarify docs with respect to soup_session_requeue_message().
1800
1801         * libsoup/soup-message-io.c (soup_message_io_stop): Clarify docs
1802
1803         * libsoup/soup-session.c (finalize): Free ssl_creds. Pointed out
1804         by Chris Austin.
1805
1806 2006-11-20  Dan Winship  <danw@novell.com>
1807
1808         * configure.in: 2.2.98
1809
1810         * NEWS: update
1811
1812 2006-11-20  Dan Winship  <danw@novell.com>
1813
1814         Patch from Andrew W. Nosenko:
1815
1816         * libsoup/soup-message-client-io.c (parse_response_headers): Avoid
1817         memory leak when parse_response_headers() is called on a message
1818         that has a 'reason_phrase' already for some reason.
1819
1820         * libsoup/soup-gnutls.c (soup_gnutls_free): Avoid memory leak:
1821         hostname was not freed.
1822         (soup_ssl_wrap_iochannel): Avoid memory leak: SoupGNUTLSChannel
1823         'chan' was not freed in case of initialization error. Avoid double
1824         close of the "real" (plain, non-ssl) channel FD.
1825         
1826         * libsoup/soup-socket.c (soup_socket_start_proxy_ssl): Avoid
1827         memory leak: the "real" (plain, non-ssl) GIOChannel was never
1828         "finally" unreffed (one more *_ref() than *_unref()) in case of
1829         ssl-wrapping.
1830
1831 2006-11-20  Dan Winship  <danw@novell.com>
1832
1833         * libsoup/soup-connection-ntlm.c (send_request): 
1834         * libsoup/soup-session-sync.c (queue_message): 
1835         * libsoup/soup-status.c (reason_phrases): Add some missing
1836         "static"s. Patch from Matthias Clasen, #376387
1837
1838         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_type)
1839         (soup_xmlrpc_value_get_string): <value>foo</value> should mean the
1840         same thing as <value><string>foo</string></value>. Pointed out by
1841         Todd Kulesza. #364490
1842
1843 2006-11-06  Dan Winship  <danw@novell.com>
1844
1845         * configure.in: Bump version to 2.2.97. Bump AGE and CURRENT for
1846         addition of soup_xml_real_node.
1847
1848         * NEWS: update
1849
1850 2006-11-06  Dan Winship  <danw@novell.com>
1851
1852         * libsoup/soup-misc.c (soup_xml_real_node): new method to find a
1853         "real" (ie, not comment or whitespace) xml node
1854
1855         * libsoup/soup-soap-response.c (parse_parameters) 
1856         (soup_soap_response_from_string) 
1857         (soup_soap_parameter_get_first_child) 
1858         (soup_soap_parameter_get_next_child): Use soup_xml_real_node.
1859         Based on a patch from Andrew W. Nosenko.
1860
1861         * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_from_string):
1862         don't call xmlKeepBlanksDefault, which changes libxml's behavior
1863         globally! Instead, use soup_xml_real_node() when traversing the
1864         xml tree.
1865
1866         * libsoup/soup-xmlrpc-response.c
1867         (soup_xmlrpc_response_from_string): don't call
1868         xmlKeepBlanksDefault.
1869         (exactly_one_child): rewrite in terms of soup_xml_real_node()
1870         (which means it handles comments now as well)
1871         (soup_xmlrpc_value_get_struct)
1872         (soup_xmlrpc_value_array_get_iterator)
1873         (soup_xmlrpc_value_array_iterator_prev)
1874         (soup_xmlrpc_value_array_iterator_next): Use soup_xml_real_node.
1875
1876 2006-11-05  Dan Winship  <danw@novell.com>
1877
1878         * libsoup/soup-headers.c (soup_headers_parse_request): document
1879         this (in particular, point out that str+len must point to exactly
1880         the right place). Allow req_method and req_path to be NULL.
1881         (soup_headers_parse_status_line, soup_headers_parse_response):
1882         document. Also, change "status_phrase" argument to "reason_phrase"
1883         to match the spec. Inspired by #339889.
1884
1885 2006-11-03  Dan Winship  <danw@novell.com>
1886
1887         * libsoup/*.c: fix lots of warnings. Partially from patches from
1888         Andrew W. Nosenko, and also some fixes from libsoup-pre214-branch.
1889         
1890 2006-11-03  Dan Winship  <danw@novell.com>
1891
1892         * Makefile.am (uninstall-local): uninstall the pkgconfig file.
1893         Based on #356809 from Matthew Barnes.
1894
1895         * libsoup/soup-server.c (get_property): Fix leaks pointed out by
1896         Paolo Borelli. #351500
1897
1898         * libsoup/soup-uri.c (soup_uri_get_protocol): Fix an off by one
1899         pointed out by Andrew W. Nosenko.
1900
1901         * configure.in: Use pkgconfig to find gnutls. Remove old static
1902         linking stuff that was only needed for rcd.
1903
1904         * acinclude.m4: remove gnutls stuff
1905
1906         * libsoup.pc.in: Use Requires rather than putting xml/ssl
1907         dependencies directly into Libs/Cflags. From Mikhail Zabaluev.
1908         #343340.
1909
1910         * libsoup/Makefile.am (libsoup_2_2_la_LDFLAGS): fix build on
1911         cygwin. From "Cygwin Ports maintainer", #321827.
1912
1913 2006-07-24  Dan Winship  <danw@novell.com>
1914
1915         * configure.in: 2.2.96. bump AGE and CURRENT for new API
1916
1917         * NEWS: update
1918
1919         * libsoup/soup-xmlrpc-message.c (soup_xmlrpc_message_from_string):
1920         New, from Fernando Herrera, bug 348532.
1921
1922 2006-07-21  Dan Winship  <danw@novell.com>
1923
1924         * libsoup/soup-auth.c (soup_auth_new_from_header_list): if the
1925         constructed auth doesn't have a realm, it's invalid, as per RFC
1926         2617. Based on a patch from Nate Nielsen on libsoup-list.
1927         (soup_auth_get_realm): remove "if available" from docs; all auths
1928         always have a realm.
1929
1930         * libsoup/soup-message-server-io.c (get_response_headers): If the
1931         server handler set a Content-Length header on the message, don't
1932         add a second one. (Preserves compatibility with an old hacky way
1933         that people might have been handling HEAD from SoupServer.)
1934
1935         * README: update to mention mailing list and bugzilla
1936
1937         * HACKING: kill this since there's nothing here that isn't either
1938         obvious, or redundant with the README
1939
1940 2006-07-21  Dan Winship  <danw@novell.com>
1941
1942         * libsoup/soup-server-message.c (soup_server_message_init):
1943         initialize encoding to SOUP_TRANSFER_CONTENT_LENGTH rather than
1944         SOUP_TRANSFER_UNKNOWN, since SOUP_TRANSFER_UNKNOWN has never
1945         actually worked here, and so there was an undocumented requirement
1946         that you manually set the encoding on every response
1947         (which SoupServer itself was not doing on internal errors).
1948         Problem pointed out by Dennis Jacobfeuerborn on libsoup-list.
1949         (soup_server_message_set_encoding): reject the new
1950         SoupTransferEncoding values, for compatibility
1951
1952         * libsoup/soup-message.h (SoupTransferEncoding): Clarify that
1953         SOUP_TRANSFER_UNKNOWN is essentially an error value, since in the
1954         public API, it always has been, due to bugs. Add some new values,
1955         currently just for internal use: SOUP_TRANSFER_NONE (for cases
1956         like HEAD which never have a body), SOUP_TRANSFER_EOF (to replace
1957         SOUP_TRANSFER_UNKNOWN), and SOUP_TRANSFER_BYTERANGES (which isn't
1958         actually implemented yet).
1959
1960         * libsoup/soup-message.c (soup_message_get_request_encoding,
1961         soup_message_get_response_encoding): figure out the body encoding
1962         being used by the request/response, including all the tricky
1963         cases like HEAD/1xx/etc.
1964         (soup_message_is_keepalive): if the response encoding is
1965         SOUP_TRANSFER_EOF, then the message isn't keepalive.
1966
1967         * libsoup/soup-message-client-io.c (parse_response_headers): use
1968         soup_message_get_response_encoding.
1969
1970         * libsoup/soup-message-server-io.c (parse_request_headers): use
1971         soup_message_get_request_encoding.
1972         (get_response_headers): use both soup_server_message_get_encoding
1973         and soup_message_get_response_encoding, to properly distinguish
1974         between the wire encoding and the alleged-by-headers encoding
1975         (which differ for HEAD, etc).
1976
1977         * libsoup/soup-message-io.c (io_error, read_body_chunk):
1978         s/SOUP_TRANSFER_UNKNOWN/SOUP_TRANSFER_EOF/.
1979         (io_body_state): if encoding is SOUP_TRANSFER_NONE, jump right to
1980         SOUP_MESSAGE_IO_STATE_FINISHING.
1981
1982         * libsoup/soup-server.c (request_finished): Check
1983         soup_socket_is_connected() *before* soup_message_is_keepalive(),
1984         since the message will be invalid if the client unexpectedly
1985         dropped the connection.
1986
1987         * tests/simple-httpd.c (server_callback): handle HEAD requests.
1988         Remove no-longer-necessary soup_server_message_set_encoding()
1989         call.
1990
1991         * tests/get.c: add -d (debug) flag to print headers, and -h flag
1992         to do a HEAD rather than GET
1993
1994 2006-07-10  Dan Winship  <danw@novell.com>
1995
1996         * configure.in: 2.2.95.1, and bump SOUP_AGE/SOUP_CURRENT this
1997         time. Pointed out by Daniel Holbach.
1998         
1999 2006-07-10  Dan Winship  <danw@novell.com>
2000
2001         * configure.in: 2.2.95
2002
2003         * NEWS: update
2004
2005 2006-06-19  Dan Winship  <danw@novell.com>
2006
2007         * tests/Makefile.am (noinst_PROGRAMS): don't build xmlrpc-test
2008         unless we have apache/php/xmlrpc-epi. Fixes the build. #345342
2009
2010         * configure.in: fix some quoting
2011
2012 2006-06-14  Dan Winship  <danw@novell.com>
2013
2014         * configure.in: add tests for apache mod_php5 and xmlrpc-epi-php
2015
2016         * tests/xmlrpc-test.c: XML-RPC regression test
2017
2018         * tests/xmlrpc-server.php: PHP server for xmlrpc-test
2019
2020         * tests/httpd.conf.in: add php stuff
2021
2022         * tests/apache-wrapper.c (apache_cleanup): Use "graceful-stop"
2023         rather than "stop", so that it stops listening on the socket
2024         before exiting, so that we can immediately start another apache
2025         (eg, in "make check").
2026
2027         * libsoup/soup-date.c (soup_mktime_utc): Fix a bug in leap-year
2028         counting.
2029
2030         * libsoup/soup-xmlrpc-message.c
2031         (soup_xmlrpc_message_write_datetime): rename from
2032         "..._write_time", to make it consistent with the XML-RPC type name
2033         and the corresponding SoupXmlrpcResponse method. Also, fix it to
2034         use the same ISO 8601 format as the spec, and use the right value
2035         for the seconds field.
2036         (soup_xmlrpc_message_write_base64): Change the buf arg to a
2037         gconstpointer rather than a const char *.
2038
2039         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_base64):
2040         Return a GByteArray containing the decoded data, rather than
2041         the base64-encoded string.
2042         (soup_xmlrpc_value_dump_internal): Update for that (and don't
2043         leak it).
2044         (soup_xmlrpc_value_array_get_iterator,
2045         soup_xmlrpc_value_array_iterator_get_value): Make these actually
2046         work.
2047
2048 2006-06-12  Dan Winship  <danw@novell.com>
2049
2050         * configure.in: 2.2.94
2051
2052         * NEWS: update
2053
2054 2006-06-12  Dan Winship  <danw@novell.com>
2055
2056         * docs/reference/client-howto.xml: 
2057         * docs/reference/server-howto.xml: New client and server API
2058         tutorials.
2059
2060         * docs/reference/*: reorganize, regenerate, fill in some missing
2061         pieces, etc
2062
2063         * libsoup/soup-connection.c (soup_connection_new): document the
2064         varargs param
2065
2066         * libsoup/soup-date.h: sync prototypes to declarations for gtk-doc.
2067
2068         * libsoup/soup-headers.c (soup_headers_parse_response): fix typo
2069         in doc.
2070
2071 2006-06-12  Dan Winship  <danw@novell.com>
2072
2073         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_int,
2074         soup_xmlrpc_value_get_double): Further fixes from Brent Smith.
2075         #344458.
2076         (soup_xmlrpc_value_get_boolean): Similar fix, plus actually set
2077         the output parameter and make the return value match the other
2078         get_* methods.
2079
2080 2006-06-09  Dan Winship  <danw@novell.com>
2081
2082         * configure.in: Add tests for apache, output tests/httpd.conf
2083
2084         * tests/htdigest: 
2085         * tests/htpasswd: 
2086         * tests/httpd.conf.in: Apache 2.2 config files for auth-test
2087
2088         * tests/apache-wrapper.c (apache_init, apache_cleanup): functions
2089         to start/stop apache
2090
2091         * tests/auth-test.c: Use apache-wrapper functions to start a local
2092         apache process to test authentication against, since the auth-test
2093         tree at developer.ximian.com went missing a long time ago. #311825
2094
2095         * tests/Makefile.am (auth_test_SOURCES): use apache-wrapper.c
2096         (TESTS): include auth-test if HAVE_APACHE.
2097
2098         * libsoup/soup-session.c (lookup_auth): Fix this in the case of a
2099         URI pointing to a directory rather than a file.
2100
2101 2006-06-08  Dan Winship  <danw@novell.com>
2102
2103         * libsoup/soup-xmlrpc-response.c (soup_xmlrpc_value_get_int,
2104         soup_xmlrpc_value_get_double, soup_xmlrpc_value_get_boolean):
2105         Check return value of strtol/g_ascii_strtod correctly. #344222,
2106         patch from Brent Smith.
2107
2108 2006-06-07  Dan Winship  <danw@novell.com>
2109
2110         * libsoup/soup-xmlrpc-response.c
2111         (soup_xmlrpc_response_from_string): record whether or not the
2112         response was a fault.
2113         (soup_xmlrpc_response_is_fault): test that. #343973, patch from
2114         Brent Smith.
2115
2116 2006-05-29  Dan Winship  <danw@novell.com>
2117
2118         * configure.in: 2.2.93
2119
2120         * NEWS: update
2121
2122 2006-05-29  Dan Winship  <danw@novell.com>
2123
2124         * libsoup/soup-message-io.c (SoupMessageIOState): add a new state
2125         "FINISHING" which means "done I/O, but not yet done processing and
2126         cleanup" before "DONE" (which now always means "completely done").
2127         (soup_message_io_stop): disconnect the socket if the read state is
2128         "< FINISHING", not "!= DONE".
2129         (io_error): on an EOF-that-signals-end-of-data, set state to
2130         FINISHING and run io_read().
2131         (io_read, io_write): remove the g_return_if_fails from before.
2132         s/DONE/FINISHING/ in most places. In the FINISHING handler, stop
2133         listening for the readable/writable signal (eg, so we don't end up
2134         reading a following pipelined request), and set the state to DONE.
2135         (soup_message_io_unpause): Only reconnect the readable/writable
2136         signals if the io state isn't DONE. Guard the calls to
2137         io_read/io_write better so that it's safe to call this even after
2138         they are both DONE, since it may be easier for us to test that
2139         than for the caller to.
2140
2141         Fixes 334469, 342640, and another bug caused by the earlier
2142         workaround to 334469. Based on patches and analysis from William
2143         Jon McCann and Armin Bauer.
2144
2145         * tests/simple-proxy.c (main): add g_thread_init (NULL) to make
2146         this work again. (Pointed out by Alex Larsson)
2147
2148 2006-05-26  Dan Winship  <danw@novell.com>
2149
2150         * libsoup/soup-socket.c: #include <sys/time.h> for struct timeval.
2151         #342048
2152
2153         * libsoup/soup-connection.c (soup_connection_connect_sync): Start
2154         SSL after CONNECTing! Doh. Part of bnc #174255.
2155         (SoupConnectionMode): new enum for the three types of
2156         SoupConnection (direct, proxy, tunnel).
2157         (set_property): set priv->mode according to proxy_uri and
2158         conn_uri.
2159         (socket_connect_result, soup_connection_connect_sync): use
2160         priv->mode to decide whether or not to tunnel.
2161         (send_request): Only pass TRUE for is_proxy to
2162         soup_message_send_request if mode is PROXY, not if it's TUNNEL.
2163         (Also part of bnc #174255).
2164
2165 2006-05-26  Dan Winship  <danw@novell.com>
2166
2167         * libsoup/soup-message-io.c (soup_message_io_in_progress): tests
2168         if IO is currently in progress on a message.
2169
2170         * libsoup/soup-session-async.c (run_queue): don't process messages
2171         that are io_in_progress. #342545, fix based on analysis from Wang
2172         Xin. (In the future we may want to re-fix this by adding a
2173         REQUEUED message status separate from QUEUED.)
2174
2175 2006-05-22  Dan Winship  <danw@novell.com>
2176
2177         * libsoup/soup-session.c (cleanup_hosts): Don't free the hosts
2178         while holding host_lock; that's not allowed and can cause
2179         deadlock. #309867. Based on a patch from Veerapuram Varadhan for
2180         part of bnc #174255.
2181
2182 2006-04-10  Dan Winship  <danw@novell.com>
2183
2184         * configure.in: bump version to 2.2.92
2185
2186         * NEWS: update
2187
2188 2006-04-10  Dan Winship  <danw@novell.com>
2189
2190         * libsoup/soup-message-io.c (io_write, io_read): g_return_if_fail
2191         if these get called after the IO is done. This isn't supposed to
2192         happen, but apparently does. Workaround for #334469.
2193
2194         * libsoup/soup-auth-digest.c (qop_types, algorithm_types):
2195         NULL-terminate these so we don't crash when trying to parse an
2196         invalid value. (Flip side of the previous #328615 patch.)
2197
2198 2006-04-02  Dan Winship  <danw@novell.com>
2199
2200         * libsoup/soup-server-auth.c (soup_server_auth_context_challenge):
2201         Write out correct digest algorithm value. #328615.
2202
2203         * libsoup/soup-headers.c (soup_headers_parse_request): Rewrite
2204         Request-Line-parsing code to not have a lame max length. #335040.
2205
2206         * Makefile.am (install-data-local): Install the .pc file mode 644,
2207         not 755. #330878
2208
2209         * libsoup/soup-auth-digest.c:
2210         * libsoup/soup-auth.c:
2211         * libsoup/soup-message-client-io.c:
2212         * libsoup/soup-message-server-io.c:
2213         * libsoup/soup-message.c:
2214         * libsoup/soup-method.c:
2215         * libsoup/soup-server-auth.c:
2216         * tests/get.c: replace locale-ish strcasecmps with
2217         g_ascii_strcasecmp
2218
2219         * libsoup/*.c: fix most signed/unsigned mismatch warnings
2220
2221 2006-03-03  Dan Winship  <danw@novell.com>
2222
2223         * configure.in: bump version to 2.2.91.
2224
2225         * NEWS: Update
2226
2227 2006-03-03  Dan Winship  <danw@novell.com>
2228
2229         * libsoup/soup-dns.c (soup_dns_lookup_resolve_async): Take a
2230         GMainContext as well, and update the resolution code to dispatch
2231         each lookup result in the correct context.
2232
2233         * libsoup/soup-address.c (soup_address_resolve_async_full): New
2234         method that takes a GMainContext to pass to
2235         soup_dns_lookup_resolve_async.
2236
2237         * libsoup/soup-socket.c (soup_socket_connect): Use
2238         soup_address_resolve_async_full. Fixes a problem reported by Armin
2239         Bauer.
2240
2241         * configure.in: update to require glib 2.6, since apparently the
2242         code does.
2243
2244 2006-02-25  Veerapuram Varadhan <vvaradhan@novell.com>
2245
2246         * libsoup/soup-connection.c:
2247         * libsoup/soup-session.c:
2248         * libsoup/soup-socket.c: add a "timeout" property,
2249         which gets passed from server to socket, and session to connection
2250         to socket, allowing blocking non-responsive sync connections to 
2251         return.  Combination of "EAGAIN" && "Blocking" connection is treated
2252         as error and the connection will be terminated and the control 
2253         is returned to the caller immediately.
2254                 
2255 2006-02-02  Tor Lillqvist  <tml@novell.com>
2256
2257         * configure.in: Don't use getaddrinfo() etc or try to support IPv6
2258         on Windows, as they are present by default on XP only. We do want
2259         to support Windows 2000, too.
2260
2261 2005-12-21  Dan Winship  <danw@novell.com>
2262
2263         * libsoup/soup-date.c (soup_date_iso8601_parse): fix two bugs in
2264         the YYYYMMDD case.
2265
2266         * tests/date.c: add three more ISO 8601 cases, to exercise all the
2267         code paths.
2268
2269         #324671, from Emmanuele Bassi
2270         
2271 2005-11-25  Dan Winship  <danw@novell.com>
2272
2273         * README: sync to text on wiki, and point to wiki
2274
2275         * TODO: moved to http://live.gnome.org/LibSoup_2fToDo
2276
2277 2005-11-17  Dan Winship  <danw@novell.com>
2278
2279         * libsoup/soup-message-io.c (io_cleanup): clear priv->io_data
2280         right away, to protect against this being re-entered mid-cleanup
2281         (when we unref the connection). #321208, based on a patch from
2282         Jedy Wang.
2283
2284 2005-11-16  Dan Winship  <danw@novell.com>
2285
2286         * libsoup/soup-xmlrpc-message.c
2287         (soup_xmlrpc_message_start_member): add the "name" element to the
2288         struct member. #321362, patch from Sebastian Bauer.
2289
2290 2005-11-10  Dan Winship  <danw@novell.com>
2291
2292         * configure.in: bump version to 2.2.90. This will not be
2293         officially released, but once these patches have gotten some
2294         testing they may be pulled up to the gnome-2-12 branch.
2295
2296         * libsoup/soup-connection.c:
2297         * libsoup/soup-server.c: 
2298         * libsoup/soup-session.c: 
2299         * libsoup/soup-socket.c: add an "async-context" property,
2300         which gets passed from server to socket, and session to connection
2301         to socket, allowing async usage outside the main thread. Based on
2302         patches from Armin Bauer and JĂ¼rg Billeter.
2303
2304         * libsoup/soup-misc.c (soup_add_io_watch, soup_add_idle,
2305         soup_add_timeout): utility routines to add watches, idles, and
2306         timeouts to non-default GMainContexts.
2307
2308         * libsoup/soup-message-io.c (io_write): set the read state
2309         appropriately after writing a "100 Continue" response
2310         (io_read): More 100-Continue stuff. I don't think this is quite
2311         right so it will probably change again later.
2312
2313 2005-11-01  Dan Winship  <danw@novell.com>
2314
2315         * docs/reference/libsoup-docs.sgml: tell it to generate an index
2316
2317         * docs/reference/tmpl/*.sgml: regen with newer gtk-doc
2318
2319 2005-11-01  Dan Winship  <danw@novell.com>
2320
2321         * libsoup/soup-connection.c (set_current_request,
2322         clear_current_request): Cast the argument to
2323         g_object_add/remove_weak_pointer to the wrong type, to make gcc
2324         4.1 happy, because C is stupid and "void **" means "a pointer to a
2325         void *", not "a pointer to any kind of pointer".
2326
2327         * libsoup/soup-xmlrpc-response.c
2328         (soup_xmlrpc_value_dump_internal): fix gccism. #320349, from
2329         Roland Illig.
2330
2331 2005-10-27  Dan Winship  <danw@novell.com>
2332
2333         * libsoup/soup-socket.c (soup_socket_client_new_async,
2334         soup_socket_client_new_sync): unref the SoupAddress passed to
2335         soup_socket_connect to avoid a leak. Based on a patch from Wang
2336         Xin.
2337         (socket_read_watch, read_from_network, socket_write_watch,
2338         soup_socket_write): request and handle G_IO_ERR and G_IO_HUP
2339         events when polling, since poll() will return them whether or not
2340         you asked for them, but glib will ignore them unless you did,
2341         which will result in CPU suckage if such an error occurs. #319305,
2342         patch from Jonathan Matthew.
2343
2344 2005-10-27  Dan Winship  <danw@novell.com>
2345
2346         bgo #316313 / bnc #116762, and probably also bgo #318252
2347
2348         * libsoup/soup-message-io.c (soup_message_io_stop): clear io->conn
2349         after releasing it, to make sure we can't accidentally release it
2350         twice.
2351
2352         * libsoup/soup-connection.c (clear_current_request): Call
2353         soup_message_io_stop() on the cleared request.
2354
2355         * libsoup/soup-connection-ntlm.c (ntlm_authorize_post): do a
2356         little dance here to make sure the session can't queue another
2357         message on the connection while we're in the process of requeuing
2358         the original one.
2359
2360 2005-08-30  Tor Lillqvist  <tml@novell.com>
2361
2362         * libsoup-zip.in: Include documentation in developer zipfile.
2363
2364 2005-08-22  Dan Winship  <danw@novell.com>
2365
2366         * libsoup/soup-soap-message.c (soup_soap_message_class_init): Call
2367         g_type_class_add_private.
2368
2369         * configure.in: Bump to 2.2.6.1
2370
2371         * NEWS: update
2372
2373 2005-08-22  Dan Winship  <danw@novell.com>
2374
2375         * configure.in: Bump to 2.2.6. Bump SOUP_AGE and SOUP_CURRENT for
2376         soup_server_get_socket() addition.
2377
2378         * NEWS: update
2379
2380 2005-08-22  Dan Winship  <danw@novell.com>
2381
2382         * libsoup/soup-connection.c (set_current_request,
2383         clear_current_request): Fix g_object_add/remove_weak_pointer usage
2384         to prevent a crash when canceling a request. From Tambet.
2385
2386 2005-08-16  Dan Winship  <danw@novell.com>
2387
2388         Fix a connection leak reported by Tambet.
2389
2390         * libsoup/soup-connection.c (send_request): rather than tracking
2391         the message progress via signals, call
2392         soup_message_send_request_internal() and have it call
2393         soup_connection_release() when it's done.
2394         (request_restarted, request_done): gone
2395         (clear_current_request): handle disconnecting (if necessary) and
2396         updating last_used time here.
2397         (soup_connection_release): Call clear_current_request().
2398         (dispose): Call clear_current_request()
2399
2400         * libsoup/soup-message-client-io.c
2401         (soup_message_send_request_internal): New. Takes a SoupConnection
2402         in addition to the other args, and passes that on to
2403         soup-message-io.
2404
2405         * libsoup/soup-message-io.c (SoupMessageIOData): add a
2406         SoupConnection field.
2407         (io_cleanup): if io->conn is set, unref it.
2408         (soup_message_io_stop): if io->conn is set, and we ended in a
2409         clean state, call soup_connection_release() on it.
2410         (soup_message_io_client): Add a SoupConnection arg, which gets
2411         reffed and stored in io->conn.
2412
2413         * TODO: misc updates
2414
2415 2005-08-15  Dan Winship  <danw@novell.com>
2416
2417         * libsoup/soup-connection.h (soup_connection_new):
2418         * libsoup/soup-server.h (soup_server_new):
2419         * libsoup/soup-session-async.h (soup_session_async_new_with_options): 
2420         * libsoup/soup-session-sync.h (soup_session_sync_new_with_options): 
2421         * libsoup/soup-socket.h (soup_socket_new): use G_GNUC_NULL_TERMINATED.
2422
2423         * libsoup/soup-types.h (G_GNUC_NULL_TERMINATED): steal the
2424         definition of this from glib 2.8 for use when compiling against
2425         glib 2.6.
2426
2427 2005-08-15  Tambet Ingo  <tambet@ximian.com>
2428
2429         * libsoup/soup-socket.c (update_fdflags, set_property): Fix compilation
2430         errors.
2431
2432         * libsoup/soup-server.c (soup_server_get_listener): ditto.
2433
2434 2005-08-12  Dan Winship  <danw@novell.com>
2435
2436         * libsoup/soup-server.c (soup_server_get_listener): new method to
2437         get the server's listening socket.
2438
2439         * libsoup/soup-socket.c: add a new "cloexec" property, to set
2440         FD_CLOEXEC on the socket. Update everything for that.
2441
2442 2005-08-05  Dan Winship  <danw@novell.com>
2443
2444         * libsoup/soup-socket.c (finalize): Free priv->read_buf. From
2445         Tambet.
2446         (soup_socket_connect): Make sure that get_iochannel() gets called
2447         if the connect succeeds right away, or the socket will fail on
2448         the first read or write. [#312540]
2449
2450 2005-08-01  Dan Winship  <danw@novell.com>
2451
2452         * configure.in: drop version back down to 2.2.5 and
2453         SOUP_API_VERSION back to 2.2; due to various snafus, there has
2454         never yet been an official release of the 2.4 API and the GNOME
2455         2.12 betas have been shipping with libsoup 2.2 tarballs (while
2456         jhbuild has been using 2.4, with evolution and related packages
2457         having configure hacks to build against either). As there never
2458         ended up being any API-incompatible changes in the 2.4 series, we
2459         can just merge it back into the 2.2 series and kill off 2.4.
2460
2461         * NEWS: Copy in the 2.2-series news from the gnome-2-10 branch,
2462         and add new NEWS
2463
2464         * libsoup-zip.in: s/2.2/@SOUP_API_VERSION@/
2465
2466         * libsoup/Makefile.am (libsoupincludedir, lib_LTLIBRARIES,
2467         libsoup_2_2_la_LDFLAGS, libsoup_2_2_la_LIBADD,
2468         libsoup_2_2_la_SOURCES): s/4/2/ in all the places automake won't
2469         let us use a variable.
2470
2471 2005-08-01  Dan Winship  <danw@novell.com>
2472
2473         * libsoup/soup-md5-utils.c (soup_md5_final_hex): Finalize a
2474         SoupMD5Context and write out the digest in hex digits.
2475
2476         * libsoup/soup-auth-digest.c (authenticate, compute_response):
2477         * libsoup/soup-server-auth.c (check_digest_passwd): Use that,
2478         rather than duplicating the code in both places here.
2479
2480         Patch from Wim Lewis.
2481         
2482 2005-07-15  Dan Winship  <danw@novell.com>
2483
2484         * libsoup/soup-session.c (redirect_handler): Allow relative URIs,
2485         since some servers are lame. Based on a patch from Jean-Yves
2486         Lefort. [#270688]
2487
2488         * tests/uri-parsing.c: add some more tests to make sure that
2489         things that should be %-escaped do get %-escaped
2490
2491 2005-07-06  Tor Lillqvist  <tml@novell.com>
2492
2493         * libsoup/soup-date.c (soup_gmtime): Mention in the doc comment
2494         that gmtime() is thread-safe on Windows.
2495         (soup_date_generate): Use soup_gmtime() instead of gmtime_r().
2496
2497 2005-06-14  Dan Winship  <danw@novell.com>
2498
2499         * configure.in: check for gmtime_r
2500
2501         * libsoup/soup-date.c: date/time-manipulation functions
2502
2503         * libsoup/soup-xmlrpc-message.c: 
2504         * libsoup/soup-xmlrpc-response.c: XMLRPC message classes, from
2505         Mariano Suarez-Alvarez, Fernando Herrera, and Jeff Bailey.
2506         [#300227]
2507
2508         * tests/date.c: soup-date test code
2509
2510         * tests/getbug.c: XMLRPC test code. (Should be switched to use
2511         bugzilla.gnome.org once bgo supports XMLRPC.)
2512
2513         * TODO: XMLRPC is implemented now (but shares the problem with
2514         SOAP that the API is not very good).
2515
2516 2005-06-14  Dan Winship  <danw@novell.com>
2517
2518         * libsoup/*.[ch]: add/fix gtk-doc comments, make functions match
2519         prototypes, etc
2520
2521         * docs/reference/*: update, fix, etc
2522
2523 2005-06-13  Tor Lillqvist  <tml@novell.com>
2524
2525         * configure.in: Check also for inet_ntop(). Pre-cache knowledge
2526         that we do have inet_pton() and inet_ntop() on Windows (because we
2527         implement them ourselves in soup-dns.c).
2528         
2529         * libsoup/soup-dns.c (inet_pton, inet_ntop): Fix the Win32
2530         implementations, they were completely bogus.
2531         (soup_dns_ntop): Make it compile if HAVE_INET_NTOP.
2532
2533 2005-06-08  Dan Winship  <danw@novell.com>
2534
2535         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Fix this to
2536         use just the domain name for the domain, not the whole
2537         DOMAIN\username. Based on a patch by Jeroen Hautekeete in #306877.
2538
2539 2005-05-26  Dan Winship  <danw@novell.com>
2540
2541         * libsoup/soup-session.c (cleanup_hosts): lock host_lock around
2542         this, since it can be called from set_property(). Possible fix for
2543         bnc #81641.
2544
2545 2005-05-05  Dan Winship  <danw@novell.com>
2546
2547         * docs/reference/Makefile.am (SCANGOBJ_OPTIONS): Use
2548         --type-init-func to force g_thread_init to be called. [#302674]
2549
2550 2005-04-18  Tor Lillqvist  <tml@novell.com>
2551
2552         * configure.in: Call AC_LIBTOOL_WIN32_DLL. Check for Win32, set
2553         Automake conditional OS_WIN32. Pre-cache information that we do
2554         have getaddrinfo(), getnameinfo(), and IPv6 on Win32. (The tests
2555         wouldn't notice as they don't include the necessary headers or
2556         link with -lws2_32. Easiest to just pre-cache it.)
2557
2558         * libsoup-zip.in: New file, to build zipfile-based distribution of
2559         libsoup for Win32. 
2560
2561         * Makefile.am (EXTRA_DIST)
2562         * configure.in (AC_OUTPUT): Add libsoup-zip(.in).
2563
2564         * libsoup/Makefile.am: Use -no-undefined on Win32. Link with
2565         WinSock library -lws2_32.
2566         
2567         * libsoup/soup-portability.h: New file. On Unix it includes the
2568         traditional BSD socket etc headers. On Win32 it includes
2569         winsock2.h and ws2tcpip.h.
2570
2571         * libsoup/*.c
2572         * libsoup/*.h: Correspondingly, don't include the BSD socket API
2573         headers directly.
2574
2575         * libsoup/soup-address.h
2576         * libsoup/soup-dns.h: Include soup-portability.h
2577
2578         * libsoup/soup-address.c (soup_address_class_init): This function
2579         should get called before libsoup uses the WinSock API, so this is
2580         a good place to call WSAStartup().
2581         
2582         * libsoup/soup-auth-digest.c (get_protection_space): Use
2583         g_strsplit() instead of the relatively unportable strtok_r().
2584
2585         * libsoup/soun-dns.c: Remove unused headers. Implement
2586         inet_pton() and inet_ntop() on Win32 using WSAStringToAddress()
2587         and WSAAddressToString().
2588
2589         * libsoup/soup-socket.c (SOUP_CLOSE_SOCKET, SOUP_IS_SOCKET_ERROR,
2590         SOUP_IS_INVALID_SOCKET, SOUP_IS_CONNECT_STATUS_INPROGRESS):
2591         Portability macros.
2592         (soup_socket_class_init): Call soup_address_get_type() to make
2593         sure WSAStartup() gets called (through soup_address_class_init()).
2594         (update_fdflags): Use ioctlsocket(FIONBIO) on Win32.
2595         (soup_socket_write): Conditionalize SIGPIPE use.
2596         
2597         * tests/get.c: mkdir() is different in Microsoft's C library.
2598
2599         * tests/simple-httpd.c: Rename TRY_AGAIN label to AGAIN to avoid
2600         some clash with winsock2.h (which includes windows.h). The Win32
2601         headers pollute the namespace wildly.
2602
2603 2005-04-15  Dan Winship  <danw@novell.com>
2604
2605         * libsoup/soup-dns.c (resolve_name): make this work with
2606         pre-EAI_OVERFLOW glibc [#300620]
2607
2608 2005-04-12  Dan Winship  <danw@novell.com>
2609
2610         * configure.in: Remove the various gethostbyname_r checks and just
2611         check for getnameinfo/getaddrinfo.
2612
2613         * libsoup/soup-dns.c: de-nastify. Make this use threads instead of
2614         forking. Change the API around a bunch in the process.
2615
2616         * libsoup/soup-address.c: Update for soup-dns changes
2617
2618         * tests/dns.c: take multiple hostnames on the command line and
2619         resolve them all at once (patch from tml)
2620
2621 2005-04-11  Dan Winship  <danw@novell.com>
2622
2623         * configure.in: require glib-2.0 >= 2.4.0
2624
2625         * libsoup/*.c: use G_DEFINE_TYPE and
2626         g_type_class_add_private/G_TYPE_INSTANCE_GET_PRIVATE
2627
2628         * libsoup/soup-types.h: kill SOUP_MAKE_TYPE and
2629         SOUP_MAKE_TYPE_WITH_IFACE
2630
2631         * tests/revserver.c: use GThread. (patch from tml)
2632
2633 2005-04-11  Dan Winship  <danw@novell.com>
2634
2635         * configure.in: bump version to 2.3.0. bump SOUP_API_VERSION to
2636         2.4
2637
2638         * libsoup.pc.in: rename from libsoup-2.2.pc.in
2639
2640         * Makefile.am (EXTRA_DIST, pkgconfig_DATA, install-data-local):
2641         install the .pc file by hand, renaming it to include the
2642         SOUP_API_VERSION
2643
2644         * libsoup/Makefile.am: s/2.2/2.4/
2645
2646 2005-03-09  Dan Winship  <danw@novell.com>
2647
2648         * libsoup/soup-gnutls.c (soup_gnutls_read): return G_IO_STATUS_EOF
2649         if gnutls returns 0. [#73352]
2650         (verify_certificate): put an #ifdef around
2651         GNUTLS_CERT_NOT_TRUSTED so it works with gnutls 1.2.x. [#57811]
2652
2653 2005-01-08  Not Zed  <NotZed@Ximian.com>
2654
2655         ** See ximian bug #70323.
2656
2657         * libsoup/soup-connection-ntlm.c: replace all unsigned long/long
2658         types with guint32, as the code needs 32 bit longs.
2659
2660 2004-10-20  Dan Winship  <danw@novell.com>
2661
2662         * libsoup/soup-gnutls.c: Commit the alleged changes from the 10-06
2663         commit, which somehow did not actually get committed then.
2664
2665         * libsoup/soup-connection.c (SoupConnectionPrivate): add a flag
2666         indicating whether or not the connection is connected.
2667         (tunnel_connect_finished): If successful, set connected. If the
2668         server returns a 3xx response, translate it to 407 (under the
2669         assumption that it's trying to redirect us to an HTML login page,
2670         as in bug 68531). Use soup_socket_start_proxy_ssl() rather than
2671         soup_socket_start_ssl().
2672         (socket_connect_result, soup_connection_connect_sync): If
2673         successful, set connected
2674         (soup_connection_disconnect): Don't emit "disconnected" if we
2675         aren't yet connected, or the message that was waiting for this
2676         connection may get stranded in the queue. (also part of 68531)
2677
2678         * libsoup/soup-socket.c (soup_socket_start_proxy_ssl): New, starts
2679         SSL and lets the caller pass the expected hostname. Fixes a
2680         problem where SSL certification validation would always fail if
2681         you used a proxy, because it was comparing the cert against the
2682         proxy's hostname. (68583)
2683
2684 2004-10-06  Dan Winship  <danw@novell.com>
2685
2686         * libsoup/soup-ssl.h (SoupSocketError): add
2687         SOUP_SSL_ERROR_CERTIFICATE.
2688
2689         * libsoup/soup-gnutls.c (do_handshake): Pass the GError to
2690         verify_certificate.
2691         (verify_certificate): Set the GError appropriately rather than
2692         spewing g_warnings.
2693
2694         * libsoup/soup-socket.c (read_from_network, soup_socket_write): If
2695         the GIOChannel operation returns an error, store it as GOBject
2696         data on the socket (as a hack so soup-message-io.c can access it
2697         without us needing to change SoupSocket's API).
2698
2699         * libsoup/soup-message-io.c (io_error): peek at the socket's
2700         "last_error" datum and set the message's status to SSL_FAILED
2701         (with the GError's message string) rather than IO_ERROR, if
2702         appropriate. For 64414.
2703
2704 2004-09-30  Dan Winship  <danw@novell.com>
2705
2706         * libsoup/soup-gnutls.c (soup_gnutls_init): Add this, with some
2707         extra initialization needed for libgcrypt 1.2 or higher. Fixes
2708         66342.
2709         (soup_ssl_get_client_credentials,
2710         soup_ssl_get_server_credentials): Call soup_gnutls_init().
2711
2712 2004-08-26  Dan Winship  <danw@novell.com>
2713
2714         * configure.in: Bump version to 2.2.0.
2715
2716         * AUTHORS: Update this to reflect the last 2 years.
2717
2718         * NEWS: Brief summary of 1.99.x -> 2.2 changes
2719
2720         * README, TODO: Updates
2721
2722 2004-08-26  Dan Winship  <danw@novell.com>
2723
2724         * libsoup/*: add/fix lots of gtk-doc comments
2725         
2726         * libsoup/soup-misc.c (soup_str_case_hash, soup_str_case_equal):
2727         Fix bug noticed while documenting. (We were using the
2728         locale-case-insensitive functions rather than the g_ascii_ ones.)
2729
2730         * libsoup/soup-message.h (SoupMessageFlags): remove the (never
2731         implemented) NO_PIPELINE and NO_COOKIE flags.
2732
2733         * docs/reference/tmpl/*.sgml: Regenerate, fill in some stuff.
2734         There are still problems here with gtk-doc not recognizing many of
2735         the objects in libsoup...
2736
2737 2004-08-13  JP Rosevear  <jpr@novell.com>
2738
2739         * configure.in: bump version, libtool number
2740
2741 2004-08-09  Dan Winship  <danw@novell.com>
2742
2743         * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
2744         use conn after emitting the "connect_result" signal, since it
2745         might be destroyed by that. Based on a patch from hpj.
2746
2747 2004-08-02  Dan Winship  <danw@novell.com>
2748
2749         * libsoup/soup-uri.h: Add flag "broken_encoding" to SoupUri.
2750
2751         * libsoup/soup-uri.c: (soup_uri_to_string): if broken_encoding is
2752         set, don't re-encode the URL parts. Based on a patch by
2753         Alfred.Peng@Sun.COM.
2754
2755 2004-07-19  JP Rosevear  <jpr@novell.com>
2756
2757         * configure.in: bump version, libtool number
2758
2759 2004-07-15  Dan Winship  <danw@novell.com>
2760
2761         * libsoup/soup-session-sync.c (send_message): Simplify this. If
2762         the message comes back from soup_connection_send_request not
2763         FINISHED, get a new connection rather than reusing the old one.
2764         This fixes a race condition in which a connection could end up
2765         double-booked, and fixes the handling of messages that get
2766         redirected to another server.
2767
2768 2004-07-13  Dan Winship  <danw@novell.com>
2769
2770         * libsoup/soup-session.c (connect_result): If the connection
2771         attempt succeeded, reserve the connection before releasing
2772         host_lock. Otherwise, another thread might find it in the
2773         connection pool before the caller can queue a message on it.
2774         #60693
2775
2776         * libsoup/soup-session-async.c (got_connection): Call
2777         soup_connection_release(), since we don't have a specific message
2778         in mind for the connection, so we need it to be considered idle.
2779
2780         * libsoup/soup-connection.c (soup_connection_release): New
2781         function, to undo a soup_connection_reserve().
2782         (soup_connection_send_request, soup_connection_reserve,
2783         soup_connection_authenticate, soup_connection_reauthenticate):
2784         Document these
2785
2786 2004-07-12  Dan Winship  <danw@novell.com>
2787
2788         * libsoup/soup-session-sync.c (send_message): signal the
2789         "connections available" condition after the message finishes. Duh.
2790
2791         * libsoup-2.2.pc.in (Cflags, Libs): add XML_CFLAGS and XML_LIBS
2792
2793 2004-07-08  Dan Winship  <danw@novell.com>
2794
2795         * libsoup/soup-soap-response.c: Revert previous change for now; it
2796         breaks the build on distros with older libxmls.
2797
2798 2004-07-08  Dan Winship  <danw@novell.com>
2799
2800         * tests/dict.c: Basic SOAP test, using Aonaware's SOAP->DICT
2801         gateway
2802
2803 2004-07-07  Fernando Herrera  <fherrera@onirica.com>
2804
2805         * libsoup/soup-soap-response.c: (finalize), (init),
2806         (soup_soap_response_from_string): Use a parse context for the
2807         xml document, so we can safely use the option to ignore
2808         blank spaces and '\n'.
2809
2810 2004-07-06  Dan Winship  <danw@novell.com>
2811
2812         * libsoup/soup-uri.c (soup_uri_new_with_base): if the protocol is
2813         http or https, require a hostname. For #61049
2814
2815         * tests/uri-parsing.c (rel_tests, do_uri): Update for that
2816
2817 2004-06-03  JP Rosevear <jpr@novell.com>
2818
2819         * configure.in: bump version to 2.1.11, libtool number
2820
2821 2004-06-01  Dan Winship  <danw@novell.com>
2822
2823         * libsoup/soup-address.c: Redo the various IPv4/IPv6-abstracting
2824         macros to not use ?: expressions as lvalues, since that's
2825         apparently a GNU extension.
2826         (soup_address_resolve_async): Use a timeout rather than an idle
2827         handler to poll the dns result. (soup-dns really should be
2828         rewritten to not require polling, but this is easier for now.)
2829         #59240
2830
2831         * libsoup/soup-server.c (call_handler): Don't use GNU-only
2832         non-constant structure initialization
2833
2834         * tests/dns.c: Simple test of the dns code
2835
2836         * tests/Makefile.am (noinst_PROGRAMS): build it
2837
2838 2004-05-19  JP Rosevear  <jpr@novell.com>
2839
2840         * configure.in (SOUP_API_VERSION): bump version, libtool numbers
2841
2842 2004-05-18  Dan Winship  <danw@novell.com>
2843
2844         * libsoup/soup-ssl.h:
2845         * libsoup/soup-nossl.c: define some GError codes and stuff
2846
2847         * libsoup/soup-gnutls.c: add missing #include <gnutls/x509.h>
2848         (do_handshake): when returning G_IO_STATUS_AGAIN, set the GError
2849         to SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ or _NEEDS_WRITE
2850         appropriately.
2851
2852         * libsoup/soup-socket.c (soup_socket_write): Handle
2853         SOUP_SSL_ERROR_HANDSHAKE_NEEDS_READ, by setting an io watch for
2854         G_IO_IN instead of G_IO_OUT. Fixes the rcd-sucking-up-all-cpu bug
2855         (#58434)
2856         (read_from_network): Handle the reverse case (which would cause
2857         hanging rather than spinning, and might be the cause of some
2858         connector 1.5 slowness?)
2859
2860 2004-05-11  Dan Winship  <danw@novell.com>
2861
2862         * libsoup/soup-misc.c (soup_signal_connect_once): Do this less
2863         kludgefully, using the magic of GClosure, to fix x86_64 problems
2864         reported by snorp.
2865
2866 2004-05-04  Sivaiah Nallagatla <snallagatla@novell.com>
2867
2868         * libsoup/soup-soap-message.c (finalize) : free
2869         the elements of priv structure before freeing priv
2870
2871 2004-04-20  Dan Winship  <danw@ximian.com>
2872
2873         * libsoup/soup-connection-ntlm.c (ntlm_authorize_post): if
2874         re-sending the message, call soup_message_restarted()
2875         (send_request): Connect to "restarted" signal, and remove the 401
2876         handlers from there; doing it here didn't work because if the
2877         connection was closed, the message would be re-sent on a new
2878         connection, but would still have the handlers from the old
2879         connection attached to it, which would make authentication fail.
2880
2881         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
2882         Copy the handler list before starting, to protect against handlers
2883         that modify the handler list.
2884
2885 2004-04-15  Dan Winship  <danw@ximian.com>
2886
2887         * libsoup/soup-connection.c (soup_connection_connect_sync):
2888         Connect to the socket's "disconnect" signal. (We were only doing
2889         this from the async version before, which meant that synchronous
2890         SoupConnections could outlive their sockets and start causing
2891         errors.) #57004
2892
2893         * libsoup/soup-connection-ntlm.c (send_request): Remove the old
2894         Authorization header before adding a new one.
2895
2896 2004-04-02  JP Rosevear  <jpr@ximian.com>
2897
2898         * configure.in: bump version, libtool number
2899
2900 2004-03-15  Dan Winship  <danw@ximian.com>
2901
2902         * libsoup/soup-soap-message.c (soup_soap_message_persist): Fix up
2903         types to kill a warning with -Wall -O2
2904
2905 2004-03-05  JP Rosevear <jpr@ximian.com>
2906
2907         * configure.in: bump version, libtool number
2908
2909 2004-03-02  Dan Winship  <danw@ximian.com>
2910
2911         * libsoup/soup-dns.c (check_hostent): Only loop on EINTR if
2912         bytes_read is -1, since the value of errno is irrelevant when
2913         bytes_read is 0. Probably #54960.
2914
2915 2004-03-01  Rodrigo Moya <rodrigo@ximian.com>
2916
2917         * libsoup/soup-soap-response.h: removed not-implemented function's
2918         prototype.
2919
2920 2004-02-27  Rodney Dawes  <dobey@ximian.com>
2921
2922         * configure.in:
2923         * libsoup/Makefile.am: Use a different variable for linking to the
2924         static version of gnutls, so we don't pull the .a files into the .pc
2925
2926         Fixes #53346
2927
2928 2004-02-20  Dan Winship  <danw@ximian.com>
2929
2930         * libsoup/soup-message-io.c (read_metadata, read_body_chunk,
2931         write_data): Pass gsize *, not guint *, to soup_socket_read/write,
2932         to make this work on 64-bit platforms. (Grr. C type checking
2933         sucks.) #54631
2934         
2935         * tests/revserver.c: Likewise
2936
2937 2004-02-18  Rodrigo Moya <rodrigo@ximian.com>
2938
2939         Fixes #54512
2940
2941         * libsoup/soup-soap-response.c (soup_soap_parameter_get_int_value):
2942         don't leak the value returned from xmlNodeGetContent().
2943         (soup_soap_parameter_get_string_value,
2944         soup_soap_parameter_get_property): return a g_strdup'ed
2945         string, not the value returned by xmlNodeGetContent, so that
2946         callers can use g_free, and not xmlFree.
2947
2948         * libsoup/soup-soap-response.h: made soup_parameter_get_property
2949         not return const.
2950
2951 2004-02-17  Dan Winship  <danw@ximian.com>
2952
2953         * libsoup/soup-soap-message.h (SOUP_IS_SOAP_MESSAGE_CLASS): Fix a
2954         typo. #54433, from Mariano Suarez-Alvarez.
2955
2956         * libsoup/soup-soap-response.h (SOUP_IS_SOAP_RESPONSE_CLASS):
2957         Likewise
2958
2959 2004-02-17  Rodney Dawes  <dobey@ximian.com>
2960
2961         * libsoup/soup-message.c (soup_message_new): HTTP connections require
2962         a hostname, and we also hash on the host for message queueing in the
2963         session, if the host is NULL we free the SoupUri and return NULL
2964
2965 2004-02-14  Dan Winship  <danw@ximian.com>
2966
2967         * configure.in: Use POSIX-compliant "test $foo = bar", rather than
2968         GNU-only "test $foo == bar". #54354, from Julio M. Merino Vidal.
2969
2970 2004-02-12  Joe Shaw  <joe@ximian.com>
2971
2972         * libsoup/soup-dns.c (check_hostent): Call read() in a do-while
2973         loop to prevent DNS errors from short reads.
2974
2975 2004-02-11  Joe Shaw  <joe@ximian.com>
2976
2977         * configure.in: Bumped version number to 2.1.7 and libtool
2978         current. 
2979
2980 2004-02-11  Dan Winship  <danw@ximian.com>
2981
2982         * libsoup/soup-connection.c (soup_connection_disconnect): Update
2983         Joe's comment here with a gory explanation of exactly what's going
2984         on. (It's not just an SSL bug either, it affects all connections.)
2985
2986 2004-02-10  Joe Shaw  <joe@ximian.com>
2987
2988         * libsoup/soup-connection.c (soup_connection_disconnect): Add a
2989         workaround for SSL connections which time-out but don't close the
2990         socket until we try sending data again later.
2991
2992         * libsoup/soup-socket.c (soup_socket_connect, soup_socket_listen):
2993         Don't free the sockaddr from soup_address_get_sockaddr(); we don't
2994         own it, the SoupAddress does.
2995
2996 2004-02-09  JP Rosevear  <jpr@ximian.com>
2997
2998         * configure.in: Bump libtool numbers
2999
3000 2004-02-05  Dan Winship  <danw@ximian.com>
3001
3002         * libsoup/soup-session.c (soup_session_add_filter): Ref the filter
3003         when adding it.
3004         (soup_session_remove_filter): And unref it here (we were already
3005         unreffing it in dispose().)
3006
3007 2004-02-05  Joe Shaw  <joe@ximian.com>
3008
3009         * libsoup/soup-dns.c (soup_dns_entry_unref): Don't try to free the
3010         hostent if it's NULL.
3011         (soup_dns_entry_check_lookup): If the entry is resolved, but the
3012         hostent is NULL, uncache it.
3013
3014 2004-02-04  Dan Winship  <danw@ximian.com>
3015
3016         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Always
3017         remove the WWW-Authenticate headers before returning, so the
3018         session won't fall back to Basic auth. Also, leave the connection
3019         in the "authenticating" state rather than setting it to
3020         "authenticated".
3021         (ntlm_authorize_post): Only requeue the message if it's in the
3022         "authenticating" state (and set it to "authenticated"). Fixes an
3023         "unepectedly disconnected" error if authentication fails.
3024
3025 2004-02-03  Dan Winship  <danw@ximian.com>
3026
3027         * libsoup/soup-message-io.c (io_cleanup): Call
3028         soup_message_io_stop so we don't get a callback on the io after
3029         it's been cleaned up.
3030
3031         * libsoup/soup-session.c (add_auth): Only remove the Authorization
3032         header if we have another one to add. (Otherwise it messes up
3033         SoupConnectionNTLM.)
3034
3035         * libsoup/soup-socket.c (read_from_buf): Use memmove rather than
3036         memcpy here, since the source and destination will overlap if
3037         *nread is small and read_buf->len is large. (Noticed by valgrind,
3038         #53625.)
3039
3040 2004-02-02  Joe Shaw  <joe@ximian.com>
3041
3042         * libsoup/soup-gnutls.c (soup_gnutls_close): Call gnutls_bye()
3043         with the GNUTLS_SHUT_WR flag (instead of RDWR) and check only for
3044         GNUTLS_E_INTERRUPTED.  GNUTLS_E_AGAIN will be returned by recv()
3045         when there are no messages on the wire on a non-blocking socket.
3046         This sends a SSL hangup message and then allows us to immediately
3047         close the socket.
3048
3049 2004-01-30  Rodrigo Moya <rodrigo@ximian.com>
3050
3051         * configure.in: bumped version number to 2.1.6.
3052
3053 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
3054
3055         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_property):
3056         new function.
3057
3058 2004-01-29  Rodrigo Moya <rodrigo@ximian.com>
3059
3060         * libsoup/soup-soap-response.[ch]
3061         (soup_soap_parameter_get_string_value): removed 'const' from return
3062         type.
3063
3064 2004-01-29  Joe Shaw  <joe@ximian.com>
3065
3066         * libsoup/soup-gnutls.c (verify_certificate): Initialize the
3067         certificate before we try to use it.  Ahem.
3068
3069 2004-01-23  Joe Shaw  <joe@ximian.com>
3070
3071         * configure.in: Bump version to 2.1.5 and SOUP_RELEASE to 2
3072
3073 2004-01-21  Joe Shaw  <joe@ximian.com>
3074
3075         * configure.in: Require at least GnuTLS 1.0.0.
3076
3077         * libsoup/soup-gnutls.c: Fix the use of deprecated GnuTLS
3078         functions.
3079         (verify_certificate): Use gnutls_x509_crt_import() and
3080         gnutls_x509_crt_check_hostname() instead of
3081         gnutls_x509_check_certificates_hostname().
3082         (init_dh_params): Use gnutls_dh_params_generate2() instead of
3083         gnutls_dh_params_generate() and gnutls_dh_params_set().
3084
3085 2004-01-20  Joe Shaw  <joe@ximian.com>
3086
3087         * libsoup/soup-gnutls.c (soup_gnutls_close): gnutls_bye() doesn't
3088         close the socket itself, so we need to do it or else our
3089         connections stay in CLOSE_WAIT forever.
3090
3091 2004-01-16  Jason Leach  <leach@wam.umd.edu>
3092
3093         * libsoup/Makefile.am: builddir != srcdir fixes.
3094
3095 2004-01-14  Joe Shaw  <joe@ximian.com>
3096
3097         * libsoup/soup-gnutls.c (verify_certificate): Remove the
3098         check for GNUTLS_CERT_CORRUPTED, it's not in 1.0.x.
3099
3100 2004-01-12  JP Rosevear  <jpr@ximian.com>
3101
3102         * configure.in: bump version and libtool revision
3103
3104 2004-01-12  Dan Winship  <danw@ximian.com>
3105
3106         * tests/simple-httpd.c (main): Add a g_thread_init() so this works
3107         again.
3108
3109 2004-01-10  Larry Ewing  <lewing@ximian.com>
3110
3111         * libsoup-2.2.pc.in (Libs): use LIBGNUTLS_LIBS in the substitution
3112         string.
3113
3114 2004-01-09  Joe Shaw  <joe@ximian.com>
3115
3116         * acinclude.m4: Include the libgnutls.m4 file.
3117
3118         * configure.in: Remove manual checking for libgnutls-config and
3119         use the AM_PATH_LIBGNUTLS so we can pass in a minimum required
3120         version, which is 0.9.7 for now.
3121
3122         * libsoup/Makefile.am: Some changes for the above change.
3123
3124         * libsoup/soup-gnutls.c: Check for HAVE_SSL, not
3125         HAVE_GNUTLS_GNUTLS_H.
3126         (verify_certificate): Uncomment the SSL certificate hostname
3127         check.
3128
3129         * libsoup/soup-session.c (set_property): Be smart about flushing
3130         our SSL credentials only when the CA file is set to something
3131         different than it was before.
3132
3133 2004-01-09  Harish K <kharish@novell.com>
3134         * libsoup/soup-soap-response.c (soup_soap_response_from_string): 
3135         added code to ignore Header element, if present, while creating 
3136         response objects.  
3137         
3138 2004-01-05  Dan Winship  <danw@ximian.com>
3139
3140         * configure.in: Remove no-longer-relevant socklen_t check
3141
3142         * libsoup/soup-address.c: Reorder #includes for FreeBSD (From Joe
3143         Marcus Clarke, #52566)
3144
3145         * libsoup/soup-dns.c: Likewise
3146
3147 2003-12-29  JP Rosevear <jpr@ximian.com>
3148
3149         * configure.in: bump version and libtool numbers
3150
3151 2003-12-22  Dan Winship  <danw@ximian.com>
3152
3153         * README, TODO: Update these
3154
3155 2003-12-22  Dan Winship  <danw@ximian.com>
3156
3157         * libsoup/soup-socket.c: Lots of thread-safety stuff, primarly so
3158         you can disconnect a socket from one thread while doing I/O in
3159         another.
3160
3161         * libsoup/soup-message-io.c (soup_message_io_cancel): Split into
3162         soup_message_io_stop() and io_cleanup(), to separate out the "stop
3163         reading/writing" and "free data" phases to allow thread-safe
3164         synchronous cancellation.
3165         (soup_message_io_finished): call both soup_message_io_stop() and
3166         io_cleanup()
3167         (io_error): Only set SOUP_STATUS_IO_ERROR on the message if it
3168         doesn't already have a transport error status (eg, CANCELLED).
3169         (new_iostate): Call io_cleanup() if needed.
3170
3171         * libsoup/soup-status.h: add "SOUP_STATUS_NONE" for 0, to make it
3172         clearer that it's not a status.
3173
3174         * libsoup/soup-message.c (finalize, restarted, finished,
3175         soup_message_set_uri): s/soup_message_io_cancel/soup_message_io_stop/
3176         (soup_message_cleanup_response): s/0/SOUP_STATUS_NONE/
3177
3178         * libsoup/soup-connection.c (send_request): Remove
3179         soup_message_io_cancel call.
3180
3181         * libsoup/soup-session-sync.c (send_message): Connect to the
3182         connection's "disconnected" signal rather than using a weak ref,
3183         since that's what we really care about, and it's possible that the
3184         connection may have an extra ref on it somewhere that would keep
3185         it from being destroyed even if it was disconnected.
3186
3187 2003-12-20  Joe Shaw  <joe@ximian.com>
3188
3189         * libsoup/soup-session.c (lookup_auth): If const_path is NULL un
3190         the non-proxy case, then use the root ("/").
3191
3192 2003-12-19  Dan Winship  <danw@ximian.com>
3193
3194         * libsoup/soup-message-filter.c: New. An interface for objects
3195         that want to act on every message passing through a session.
3196         (Initially being used for authentication, but could also be used
3197         for cache handling, cookie management, etc.)
3198
3199         * libsoup/soup-connection.c (class_init, etc): Add a message
3200         filter property.
3201         (send_request): If the connection has a message filter set, run
3202         it on the message before sending it.
3203         (soup_connection_connect_async, etc): When setting up a tunnel, if
3204         we get back a 407 and the session tries to requeue the message,
3205         either re-send it, or return SOUP_STATUS_TRY_AGAIN (depending on
3206         whether or not the proxy closed the connection).
3207         (soup_connection_connect_sync): Likewise
3208         (send_request, request_done): Ref/unref the connection
3209
3210         * libsoup/soup-session.c (soup_session_get_type): Implement the
3211         SoupMessageFilter interface.
3212         (soup_session_get_connection): Use the session as the connection's
3213         message filter
3214         (soup_session_add_filter, soup_session_remove_filter): Add/remove
3215         filters from the session
3216         (setup_message): do auth handling, and call each of the session's
3217         filters' setup_message methods as well.
3218         (soup_session_send_message_via): No longer needed.
3219         (connect_result): Handle SOUP_STATUS_TRY_AGAIN.
3220
3221         * libsoup/soup-session-async.c (run_queue): Use
3222         soup_connection_send_request, since soup_session_send_message_via
3223         is gone now.
3224
3225         * libsoup/soup-session-sync.c (send_message): Likewise
3226
3227         * libsoup/soup-message.c (soup_message_is_keepalive): A successful
3228         response to a CONNECT is always keepalive, even if it's HTTP/1.0
3229         with no Connection header.
3230
3231         * libsoup/soup-status.h: add SOUP_STATUS_TRY_AGAIN
3232
3233         * libsoup/soup-types.h: Add SoupMessageFilter, and macros for
3234         gobject interface types.
3235
3236         * tests/get.c (main): Add a -p flag to specify a proxy
3237
3238         * tests/simple-proxy.c: Fix #includes
3239
3240 2003-12-18  Dan Winship  <danw@ximian.com>
3241
3242         * libsoup/soup-connection.c (soup_connection_disconnect): Actually
3243         disconnect the socket rather than just unreffing it, since the IO
3244         code may be holding an extra ref on it.
3245         (send_request): connect to the "restarted" signal too
3246         (request_restarted): Deal with "Connection: close"
3247
3248         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Make this
3249         not go into an infinite loop if the server only supports Basic.
3250
3251 2003-12-17  Rodrigo Moya <rodrigo@ximian.com>
3252
3253         * libsoup/Makefile.am: install soup-message-queue.h with the rest
3254         of the headers.
3255
3256 2003-12-17  Dan Winship  <danw@ximian.com>
3257
3258         * configure.in: Add gthread to glib check
3259
3260         * libsoup/soup-session.c: Make this an abstract class.
3261
3262         * libsoup/soup-session-async.c: A SoupSession class for
3263         asynchronous gmain-based operation; replaces the old SoupSession.
3264
3265         * libsoup/soup-session-sync.c: A SoupSession class for synchronous
3266         blocking operation for use with threaded apps.
3267
3268         * libsoup/soup-types.h, libsoup/soup.h: add the new session
3269         subclasses
3270
3271         * libsoup/soup-connection.c (soup_connection_connect_sync): Don't
3272         try to unref the socket if the socket creation fails.
3273         (soup_connection_reserve): New, to explicitly mark a connection as
3274         being in use without queueing a message on it.
3275
3276         * libsoup/soup-dns.c (check_hostent): Oof. Fix the logic of the
3277         "block" flag to not be reversed.
3278
3279         * libsoup/soup-message.c (finished): set status to FINISHED here.
3280         (soup_message_cancel): Gone; needs to be done at the session
3281         level.
3282
3283         * libsoup/soup-message-queue.c: Add a mutex and make all of the
3284         operations thread-safe.
3285
3286         * libsoup/soup-socket.c (disconnect_internal): Make this
3287         thread-safe.
3288         (soup_socket_connect): Make the sync case work correctly.
3289
3290         * libsoup/Makefile.am: add the SoupSession subclasses
3291
3292         * tests/Makefile.am: libsoup depends on libgthread now, so
3293         revserver doesn't need to explicitly.
3294
3295         * tests/get.c, tests/auth-test.c, tests/simple-proxy.c: Use
3296         soup_session_async_new().
3297
3298 2003-12-16  Rodrigo Moya <rodrigo@ximian.com>
3299
3300         * libsoup/soup-soap-response.[ch] (soup_soap_parameter_get_int_value):
3301         new function.
3302
3303 2003-12-16  Joe Shaw  <joe@ximian.com>
3304
3305         * libsoup/soup-connection.c (socket_connect_result,
3306         soup_connection_connect_sync): Only set up a tunnel if the
3307         destination protocol is HTTPS.
3308
3309         * libsoup/soup-message.c (class_init): Add a default handler for
3310         wrote_body.
3311         (wrote_body): Run the SOUP_HANDLER_POST_REQUEST handlers here.
3312         (soup_message_cancel): Don't set the status to
3313         SOUP_STATUS_CANCELLED and call soup_message_finished() if the
3314         status is already SOUP_MESSAGE_STATUS_FINISHED.
3315
3316         * libsoup/soup-session.c (set_property): Don't cancel the session
3317         if the proxy URI set as a property isn't different from the old
3318         one.
3319         (get_host_for_message): Refactor some code so that we can easily
3320         get the right SoupSessionHost for proxies as well as from the
3321         message.
3322         (authenticate_auth): Take a gboolean proxy parameter.  Check it to
3323         see which URI (message URI or proxy URI) to use for
3324         authentication.  Add a long comment about lack of clarity in RFC
3325         2617 with respect to proxies and protection spaces.
3326
3327 2003-12-15  Dan Winship  <danw@ximian.com>
3328
3329         * libsoup/soup-socket.h (soup_socket_read, soup_socket_read_until,
3330         soup_socket_write): s/guint/gsize/ to match the definitions in
3331         soup-socket.c. #52167.
3332
3333 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
3334
3335         * libsoup/soup-soap-message.c: removed debugging of the messages here.
3336
3337 2003-12-12  Rodrigo Moya <rodrigo@ximian.com>
3338
3339         * libsoup/soup-soap-message.c (soup_soap_message_start_envelope):
3340         added information for SOAP-ENV namespace.
3341
3342 2003-12-10  Dan Winship  <danw@ximian.com>
3343
3344         * libsoup/soup-message-client-io.c (parse_response_headers): if we
3345         receive an HTTP/1.0 response to an HTTP/1.1 request, downgrade the
3346         message's http_version so the keep-alive handling is correct.
3347         Fixes a problem noticed almost simultaneously by Rodrigo and Joe.
3348
3349         * libsoup/soup-message.c (soup_message_restarted, etc): Add a
3350         "restarted" signal as suggested by Joe.
3351
3352         * libsoup/soup-message-io.c (soup_message_io_finished): emit
3353         either "restarted" or "finished" as appropriate
3354
3355         * libsoup/soup-session.c (soup_session_queue_message): Connect to
3356         "restarted" and run the queue if a message gets restarted
3357
3358         * libsoup/soup-status.h: Remove a stray comma that gtk-doc doesn't
3359         like.
3360
3361 2003-12-10  Tambet Ingo  <tambet@ximian.com>
3362
3363         * configure.in: Use autoconfig to check for socklen_t ...
3364
3365         * libsoup/soup-address.c: ... and remove it from here ...
3366
3367         * libsoup/soup-dns.c: ... and here.
3368
3369 2003-12-09  Rodrigo Moya <rodrigo@ximian.com>
3370
3371         * libsoup/soup-soap-message.c (soup_soap_message_persist):
3372         (soup_soap_message_parse_response): print out request/response's
3373         contents, if in debug mode.
3374
3375 2003-12-07  JP Rosevear  <jpr@ximian.com>
3376
3377         * configure.in: Bump version
3378
3379 2003-11-28  Rodrigo Moya <rodrigo@ximian.com>
3380
3381         * libsoup/soup-soap-response.[ch]
3382         (soup_soap_parameter_get_first_child,
3383         soup_soap_parameter_get_first_child_by_name,
3384         soup_soap_parameter_get_next_child,
3385         soup_soap_parameter_get_next_child_by_name): new functions to
3386         manage SoupSoapParameter's children.
3387         (soup_soap_response_get_first_parameter): dont return a GList, but
3388         a SoupSoapParameter contained in the GList.
3389
3390 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
3391
3392         * libsoup/soup-soap-response.[ch]
3393         (soup_soap_parameter_get_string_value): new function.
3394
3395 2003-11-26  Rodrigo Moya <rodrigo@ximian.com>
3396
3397         * libsoup/soup-soap-response.[ch]: added SoupSoapParameter
3398         structure, to "hide" the usage of xmlNode's.
3399         (soup_soap_parameter_get_name): functions to manage SOAP
3400         response parameters.
3401         (soup_soap_response_get_first_parameter,
3402         soup_soap_response_get_first_parameter_by_name,
3403         soup_soap_response_get_next_parameter,
3404         soup_soap_response_get_next_parameter_by_name):
3405         new functions for an easy access to the response's parameters.
3406         (soup_soap_response_from_string): removed warnings.
3407
3408 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
3409
3410         * libsoup/soup-soap-response.c (soup_soap_response_set_method_name):
3411         fixed typo.
3412
3413 2003-11-25  Rodrigo Moya <rodrigo@ximian.com>
3414
3415         * libsoup/soup-soap-response.[ch] (soup_soap_response_get_method_name,
3416         soup_soap_response_set_method_name, soup_soap_message_get_parameters):
3417         new functions.
3418         (finalize): NULL out new private fields.
3419         (soup_soap_response_from_string): added validation code.
3420
3421 2003-11-23  Rodrigo Moya <rodrigo@ximian.com>
3422
3423         * libsoup/soup-soap-response.[ch]: new class for managing SOAP
3424         responses.
3425
3426         * libsoup/soup-soap-message.[ch] (soup_soap_message_parse_response):
3427         new function.
3428
3429         * libsoup/Makefile.am: added new files.
3430
3431 2003-11-18  Rodney Dawes  <dobey@ximian.com>
3432
3433         * gtk-doc.make: Add gtk-doc.make to cvs for systems without gtk-doc
3434
3435 2003-11-18  Rodney Dawes  <dobey@ximian.com>
3436
3437         * acinclude.m4: Add GTK_DOC_CHECK
3438
3439 2003-11-18  Dan Winship  <danw@ximian.com>
3440
3441         * configure.in: Replace old gtk-doc test with GTK_DOC_CHECK()
3442         (AC_OUTPUT): add docs/Makefile, docs/reference/Makefile
3443
3444         * autogen.sh (REQUIRED_AUTOMAKE_VERSION): 1.6, for gtk-doc.make
3445
3446         * Makefile.am: updates for gtk-doc
3447         (SUBDIRS): add back "docs"
3448
3449         * docs/Makefile.am (EXTRA_DIST): remove, since those old docs
3450         aren't around any more
3451
3452         * docs/reference/*: set up gtk-doc
3453
3454         * libsoup/Makefile.am (INCLUDES): Change G_LOG_DOMAIN to
3455         "libsoup". Remove unused defines.
3456
3457         * libsoup/soup-connection.c: Fix doc comments
3458         * libsoup/soup-message.c: Likewise
3459         * libsoup/soup-misc.c: Likewise
3460         * libsoup/soup-socket.c: Likewise
3461         * libsoup/soup-uri.c: Likewise
3462
3463         * libsoup/soup-address.h: Fixes to please gtk-doc
3464         * libsoup/soup-connection.h: Likewise
3465         * libsoup/soup-message.h: Likewise
3466         * libsoup/soup-message-private.h: Likewise
3467         * libsoup/soup-misc.h: Likewise
3468         * libsoup/soup-server-auth.h: Likewise
3469         * libsoup/soup-socket.h: Likewise
3470         * libsoup/soup-status.h: Likewise
3471
3472 2003-11-18  Dan Winship  <danw@ximian.com>
3473
3474         * configure.in: Fix up the SSL checks some. Remove some useless
3475         old header checks.
3476
3477         * libsoup/soup-misc.h: declare soup_ssl_supported.
3478
3479         * libsoup/soup-gnutls.c: add soup_ssl_supported declaration.
3480
3481         * libsoup/soup-nossl.c: Not an SSL implementation, built if
3482         HAVE_SSL is not defined.
3483
3484         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): add soup-nossl.c
3485
3486         * libsoup/soup-socket.c (soup_socket_start_ssl): Return success or
3487         failure.
3488         (listen_watch): Deal with soup_socket_start_ssl failing.
3489
3490         * libsoup/soup-connection.c (tunnel_connect_finished,
3491         socket_connect_result, soup_connection_connect_sync): Deal with
3492         the soup_socket_start_ssl failing.
3493
3494         * libsoup/soup-server.c (soup_server_new): Deal with
3495         soup_ssl_get_server_credentials failing
3496
3497 2003-11-18  Rodrigo Moya <rodrigo@ximian.com>
3498
3499         * libsoup/soup-soap-message.[ch] (soup_soap_message_start_fault,
3500         soup_soap_message_end_fault, soup_soap_message_start_fault_detail,
3501         soup_soap_message_end_fault_detail, soup_soap_message_start_header,
3502         soup_soap_message_end_header,
3503         soup_soap_message_start_header_element,
3504         soup_soap_message_end_header_element, soup_soap_message_write_int,
3505         soup_soap_message_write_double, soup_soap_message_write_base64,
3506         soup_soap_message_write_time, soup_soap_message_write_string,
3507         soup_soap_message_write_buffer, soup_soap_message_set_element_type,
3508         soup_soap_message_set_null, soup_soap_message_add_attribute,
3509         soup_soap_message_add_namespace,
3510         soup_soap_message_set_default_namespace,
3511         soup_soap_message_get_namespace_prefix,
3512         soup_soap_message_set_encoding_style, soup_soap_message_reset,
3513         soup_soap_message_persist): new functions from old SoupSerializer.
3514
3515 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
3516
3517         * libsoup/soup-soap-message.[ch] (soup_soap_message_new,
3518         soup_soap_message_new_from_uri): added a bunch of initialization
3519         parameters.
3520         (soup_soap_message_get_xml_doc, soup_soap_message_start_envelope,
3521         soup_soap_message_end_envelope, soup_soap_message_start_body,
3522         soup_soap_message_end_body, soup_soap_message_start_element,
3523         soup_soap_message_end_element):
3524         new functions.
3525
3526         * configure.in: depend on libxml-2.0 for the SOAP code.
3527
3528         * libsoup/Makefile.am: use XML CFLAGS and LIBS.
3529
3530 2003-11-17  Joe Shaw  <joe@ximian.com>
3531
3532         * configure.in: Add in the --enable-libgpg-error flag from the 2.0
3533         branch.
3534
3535         * acinclude.m4: Include the gpg-error macros.
3536
3537 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
3538
3539         * libsoup/soup-soap-message.[ch]: new class to make it easier to
3540         build SOAP messages.
3541
3542         * libsoup/Makefile.am: added new files.
3543
3544         * configure.in: increased version number.
3545
3546 2003-10-24  Joe Shaw  <joe@ximian.com>
3547
3548         * libsoup/soup-address.c (update_address_from_entry): Call
3549         soup_dns_entry_get_hostent() on the SoupAddress passed in, not the
3550         one in addr->priv->lookup.  Fixes a crash on synchronous DNS
3551         lookups.
3552
3553         * libsoup/soup-server.c (soup_server_new): We need to ref the
3554         address we're binding to, because soup_socket_get_local_address()
3555         doesn't ref for us.
3556
3557 2003-10-23  Dan Winship  <danw@ximian.com>
3558
3559         * libsoup/soup-socket.c (init): Initialize flags to default
3560         values.
3561
3562 2003-09-23  Dan Winship  <danw@ximian.com>
3563
3564         * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but
3565         note whether or not the CA file has been loaded.
3566         (SoupGNUTLSChannel): add a "hostname" field.
3567         (verify_certificate): Remove the comment about not being able to
3568         verify the hostname because of soup problems. Now it's because of
3569         GNUTLS problems instead.
3570         (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel,
3571         and takes a hostname and a creds argument now.
3572         (soup_ssl_get_client_credentials,
3573         soup_ssl_get_server_credentials): Return client/server credentials
3574         structures.
3575         (soup_ssl_free_client_credentials,
3576         soup_ssl_free_server_credentials): and free them.
3577
3578         * libsoup/soup-session.c (class_init, set_property, get_property):
3579         add ssl_ca_file property
3580         (get_host_for_message): when returning an SSL host for the first
3581         time, create a client credentials structure for the session.
3582         (run_queue): Pass the ssl creds to the new connection. Also fix an
3583         unrelated bug that caused infinite loops on "bad hostname".
3584
3585         * libsoup/soup-server.c: Use GObject properties, including
3586         ssl_cert_file and ssl_key_file properties.
3587         (soup_server_new): Remove "protocol" argument; if the cert file
3588         and key file properties were set, create a server credential
3589         structure from them and pass that to soup_socket_server_new.
3590
3591         * libsoup/soup-connection.c (SoupConnectionPrivate): Rename
3592         dest_uri to origin_uri to match RFC 2616 terminology. Add an
3593         "ssl_creds" field.
3594         (class_init, set_property, get_property): add SSL_CREDS property
3595         (soup_connection_connect_async, soup_connection_connect_sync):
3596         Pass ssl_creds to soup_socket_client_new calls.
3597
3598         * libsoup/soup-socket.c: Use GObject properties, including an
3599         ssl_creds property
3600         (soup_socket_set_flags): Gone (replaced with boolean properties)
3601         (soup_socket_new): Make this take a list of properties
3602         (listen_watch): copy ssl creds from listener to new socket
3603         (soup_socket_start_ssl): Pass remote hostname and socket creds
3604         structure to soup_ssl_wrap_iochannel.
3605         (soup_socket_client_new_async, soup_socket_client_new_sync,
3606         soup_socket_server_new): Replace the SSL boolean with an ssl_creds
3607         structure.
3608
3609         * libsoup/soup-misc.c (soup_set_ssl_ca_file,
3610         soup_set_ssl_cert_files, soup_get_ssl_ca_file,
3611         soup_get_ssl_cert_files): Gone. SSL state is now per-session or
3612         per-server.
3613
3614         * tests/get.c: add a "-c CAfile" argument, for loading a CA
3615         certificate file to validate https connections against
3616
3617         * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile"
3618         arguments for loading an SSL server certificate. Only start an SSL
3619         server if those arguments were used.
3620
3621         * tests/test-cert.pem: 
3622         * tests/test-key.pem: SSL certificate for testing simple-httpd
3623
3624         * tests/revserver.c: Update for API changes
3625         * tests/simple-proxy.c: Likewise
3626
3627 2003-09-22  Dan Winship  <danw@ximian.com>
3628
3629         * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
3630         from soup-private.h
3631
3632         * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
3633         (soup_set_security_policy, soup_get_security_policy): Remove,
3634         since the GNUTLS backend doesn't actually implement it.
3635         (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
3636
3637         * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
3638         stuff.
3639
3640         * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
3641         soup-private.h
3642
3643         * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
3644         soup_ssl_get_server_iochannel into a single function that takes a
3645         SoupSSLType.
3646
3647         * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
3648         (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
3649         (soup_gnutls_set_security_policy): Gone
3650
3651         * libsoup/soup-gnutls.h
3652         * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
3653         soup-gnutls.c now
3654
3655         * libsoup/soup-socket.c: Move soup_sockaddr_max
3656         #define here from soup-private.h
3657         (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
3658         prototype.
3659
3660         * libsoup/soup-private.h: Gone
3661         
3662         * libsoup/soup-address.c: Fix #includes for soup-private.h and
3663         soup-misc.h changes
3664         * libsoup/soup-auth-digest.c: Likewise
3665         * libsoup/soup-auth.c: Likewise
3666         * libsoup/soup-connection-ntlm.c: Likewise
3667         * libsoup/soup-connection.c: Likewise
3668         * libsoup/soup-dns.c: Likewise
3669         * libsoup/soup-gnutls.c: Likewise
3670         * libsoup/soup-headers.c: Likewise
3671         * libsoup/soup-message-client-io.c: Likewise
3672         * libsoup/soup-message-handlers.c: Likewise
3673         * libsoup/soup-message-io.c: Likewise
3674         * libsoup/soup-message-server-io.c: Likewise
3675         * libsoup/soup-message.c: Likewise
3676         * libsoup/soup-server-message.c: Likewise
3677         * libsoup/soup-server.c: Likewise
3678         * libsoup/soup-session.c: Likewise
3679         * libsoup/soup-socket.c: Likewise
3680         * tests/auth-test.c: Likewise
3681
3682 2003-09-19  Dan Winship  <danw@ximian.com>
3683
3684         * libsoup/soup-address.c (update_address_from_entry): free the
3685         hostent.
3686
3687         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't leak
3688         the domain
3689
3690         * libsoup/soup-gnutls.c (soup_gnutls_get_iochannel): Add some more
3691         iochannel initialization. Not sure how this worked before...
3692
3693         * libsoup/soup-message.c (soup_message_cleanup_response): Renamed
3694         from soup_message_prepare (and a few things removed).
3695
3696         * libsoup/soup-message-client-io.c (soup_message_send_request):
3697         s/soup_message_prepare/soup_message_cleanup_response/
3698
3699         * libsoup/soup-message-io.c (io_read): Replace the final "\r\n"
3700         with "\0" on the headers before passing them to the parse
3701         function.
3702         (io_read): Call soup_message_cleanup_response after returning an
3703         informational response so the data doesn't leak.
3704
3705         * libsoup/soup-headers.c (soup_headers_parse): Update for
3706         soup-message-io.c:io_read change
3707
3708         * libsoup/soup-server.c (soup_server_new,
3709         soup_server_new_with_host): Don't leak the SoupAddress.
3710
3711         * libsoup/soup-session.c (class_init): Make PROP_PROXY_URI not
3712         CONSTRUCT_ONLY.
3713         (set_property): If the proxy uri changes, call
3714         soup_session_abort() and cleanup_hosts().
3715         (request_finished, final_finished): Fix a bug when requeuing
3716         messages.
3717
3718         * tests/libsoup.supp: valgrind suppression file for soup tests
3719
3720         * tests/Makefile.am (EXTRA_DIST): dist it.
3721         (noinst_PROGRAMS): move the former check_PROGRAMS to
3722         noinst_PROGRAMS instead.
3723
3724 2003-09-18  Dan Winship  <danw@ximian.com>
3725
3726         * libsoup/soup-message.c: Add wrote_informational and
3727         got_informational signals.
3728
3729         * libsoup/soup-message-client-io.c (get_request_headers): Set the
3730         EXPECT_CONTINUE flag on the message if that header is set.
3731
3732         * libsoup/soup-message-server-io.c (parse_request_headers):
3733         Likewise
3734
3735         * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
3736         when blocking on an expect-continue. Emit wrote_informational
3737         instead of wrote_headers in the 1xx case.
3738         (io_read): Set read_state to BLOCKING, not NOT_STARTED after
3739         reading a 100 Continue response. Emit got_informational instead of
3740         got_headers in the 1xx case.
3741
3742         * libsoup/soup-session.c (soup_session_send_message): Reorder
3743         things to deal with the fact that the message could finish right
3744         away if there is a connection available and the server is very
3745         close.
3746
3747         * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
3748         SOUP_STATUS_CLASS_TRANSPORT_ERROR.
3749
3750 2003-09-17  Dan Winship  <danw@ximian.com>
3751
3752         * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
3753         (one that pruned too little, one that pruned too much).
3754         (queue_message): When requeuing, don't run the queue;
3755         final_finished will take care of that later.
3756         (soup_session_abort): New, to cancel all pending requests.
3757
3758         * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
3759         the socket while waiting for the address to resolve
3760
3761 2003-09-17  Dan Winship  <danw@ximian.com>
3762
3763         * libsoup/soup-connection.c (soup_connection_new): Replaces the
3764         three previous soup_connection_new* functions and uses gobject
3765         properties to set the destination and proxy uris.
3766         (class_init): set up two more signals, authenticate and
3767         reauthenticate.
3768         (soup_connection_send_request): virtualize
3769         (send_request): Default implementation
3770
3771         * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
3772         also handles NTLM authentication. Includes all of the NTLM code
3773         formerly in soup-auth-ntlm.c.
3774
3775         * libsoup/soup-auth-ntlm.[ch]: Gone.
3776
3777         * libsoup/soup-auth.c: Remove NTLM refs
3778
3779         * libsoup/soup-session.c (class_init): Add gobject properties for
3780         proxy, max_conns, use_ntlm. Change the "authenticate" and
3781         "reauthenticate" signal prototypes to not pass a SoupAuth (so they
3782         can be used for authenticating SoupConnectionNTLM as well, which
3783         doesn't use a SoupAuth).
3784         (soup_session_new): Renamed from soup_session_new_default.
3785         (soup_session_new_with_options): Replaces
3786         soup_session_new_with_proxy and soup_session_new_full. Takes
3787         gobject properties.
3788         (run_queue): Create a new connection of type SoupConnection or
3789         SoupConnectionNTLM depending on our "use_ntlm" property. Connect
3790         to its authenticate and reauthenticate signals.
3791         (connection_authenticate, connection_reauthenticate): proxy these
3792         signals.
3793
3794         * libsoup/soup-address.c (update_address_from_entry): Fix a
3795         crasher when failing to resolve the address.
3796
3797         * libsoup/soup-dns.c (check_hostent): Fix some "how was this
3798         working before" bugs.
3799
3800         * libsoup/soup-message-client-io.c (soup_message_send_request):
3801         call soup_message_prepare() to clean up the existing response
3802         state.
3803
3804         * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
3805         when processing an OK EOF.
3806
3807         * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
3808         these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
3809
3810         * tests/auth-test.c (authenticate, reauthenticate): Update for new
3811         prototypes.
3812         (main): Use soup_session_new.
3813         * tests/get.c (main): Likewise.
3814         * tests/simple-proxy.c (main): Likewise.
3815
3816 2003-09-10  Dan Winship  <danw@ximian.com>
3817
3818         * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
3819         signals.
3820         (invalidate_auth): Remove the call to soup_auth_invalidate.
3821         (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
3822         contain authentication, then emit "authenticate" or
3823         "reauthenticate" (depending on whether or not this is the first
3824         time we've asked for a password for this auth).
3825         (update_auth_internal): If the server rejects our
3826         username/password, don't bail out immediately. Try doing a
3827         "reauthenticate" first.
3828
3829         * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
3830
3831         * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
3832         "pref" arg.
3833         (soup_auth_invalidate): Remove this; it doesn't actually do
3834         anything useful for us.
3835
3836         * libsoup/soup-auth-basic.c (invalidate): Remove
3837         * libsoup/soup-auth-digest.c: (invalidate): Remove
3838         * libsoup/soup-auth-ntlm.c: (invalidate): Remove
3839
3840         * libsoup/soup-uri.c: Remove all references to "authmech".
3841         (soup_uri_set_auth): Remove this too.
3842
3843         * tests/auth-test.c: Update to use the "authenticate" and
3844         "reauthenticate" signals instead of encoding usernames and
3845         passwords in the URIs. Add a few more test cases.
3846
3847 2003-09-10  Dan Winship  <danw@ximian.com>
3848
3849         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
3850         "status" field from here, since it's mostly used by SoupSession,
3851         which shouldn't need access to SoupMessagePrivate.
3852
3853         * libsoup/soup-message.h (SoupMessage): Move it here.
3854         (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
3855         (soup_message_set_uri): also moved from soup-message-private.h
3856
3857         * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
3858
3859         * libsoup/soup-message-handlers.c:
3860         s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
3861
3862         * libsoup/soup-message-io.c (soup_message_io_client,
3863         soup_message_io_server, soup_message_io_unpause): Don't set up an
3864         idle handler, just jump right in to reading/writing; if this is a
3865         synchronous socket, then the caller wants to block, and if it's
3866         not, then we'll quickly get an EAGAIN anyway.
3867
3868         * libsoup/soup-session.c: (queue_message): Likewise.
3869         (*) Update for SoupMessageStatus move and remove
3870         soup-message-private.h include.
3871
3872         * libsoup/soup-server-message.c: Remove soup-message-private.h
3873         include.
3874
3875         * libsoup/soup-server.c: Likewise.
3876
3877         * libsoup/soup-connection.c (soup_connection_is_connected,
3878         soup_connection_is_new): Remove these, since they weren't being
3879         used.
3880
3881         * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
3882         avoid namespace pollution.
3883
3884         * libsoup/soup-auth-digest.c: Update for that.
3885         * libsoup/soup-server-auth.c: Likewise
3886
3887         * tests/auth-test.c: Remove soup-message-private.h include
3888
3889 2003-09-09  Dan Winship  <danw@ximian.com>
3890
3891         Beginnings of improved synchronous API support
3892
3893         * libsoup/soup-dns.c: Simplify this by making it not automatically
3894         return the result: force the caller to poll. (This isn't really a
3895         performance issue: the results should come back quickly anyway.)
3896         Also, make the cache thread-safe.
3897         (soup_dns_entry_from_name): Was soup_gethostbyname
3898         (soup_dns_entry_from_addr): Was soup_gethostbyaddr
3899         (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
3900         (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
3901         blocks if it's not resolved yet).
3902
3903         * libsoup/soup-address.c: Update for soup-dns changes.
3904         (soup_address_new): Don't automatically start resolving the
3905         hostname now, since we don't know if the caller is going to want
3906         it resolved synchronously or asynchronously.
3907         (soup_address_resolve_async): Renamed from soup_address_resolve.
3908         (soup_address_resolve_sync): New routine to do blocking
3909         synchronous DNS.
3910
3911         * libsoup/soup-socket.c (soup_socket_connect): Now returns a
3912         status value directly when connecting synchronously.
3913         (soup_socket_client_new_async, soup_socket_client_new_sync):
3914         Separate async/sync client socket functions.
3915         (soup_socket_get_iochannel): Made static since it was not used
3916         outside soup-socket.
3917
3918         * libsoup/soup-connection.c (soup_connection_new,
3919         soup_connection_new_proxy, soup_connection_new_tunnel): Just set
3920         up the data, don't actually start connecting.
3921         (soup_connection_connect_async, soup_connection_connect_sync): New
3922         async and sync SoupConnection connecting routines.
3923         (soup_connection_get_socket): Remove this since it wasn't being
3924         used.
3925
3926         * libsoup/soup-session.c (final_finished): Run the queue since a
3927         connection is now freed up.
3928         (run_queue): Update for soup_connection_new* changes.
3929
3930         * libsoup/soup-misc.c (soup_substring_index): Remove, since it
3931         wasn't being used any more.
3932
3933         * libsoup/soup-private.h: Remove some prototypes for functions
3934         that no longer exist.
3935
3936         * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
3937         (copies the protocol, host, and port of a SoupUri).
3938
3939         * tests/auth-test.c:
3940         * tests/get.c:
3941         * tests/simple-proxy.c: belatedly update for soup-session change
3942
3943         * tests/revserver.c: Handle each new connection in its own thread,
3944         using synchronous SoupSocket calls.
3945
3946 2003-09-05  Dan Winship  <danw@ximian.com>
3947
3948         * libsoup/soup-session.c: Move a bunch of logic here from
3949         soup-context. Now the session keeps track of hosts (instead of
3950         having a global soup_hosts hash) and their connections.
3951         (soup_session_new_with_proxy, soup_session_new_full): New session
3952         constructors to specify a proxy or a proxy and connection limits
3953         (send_request): Add Authorization and Proxy-Authorization headers
3954         before sending off the request.
3955         (soup_session_queue_message, et al): Improve the way this works.
3956         There's no need to use timeouts to wait for connections to become
3957         free; we *know* when they become free.
3958
3959         * libsoup/soup-private.h: Remove SoupHost and some other
3960         no-longer-used stuff.
3961
3962         * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
3963         soup_set_connection_limit, soup_set_connection_limit): Gone. These
3964         are all per-session now.
3965
3966         * libsoup/soup-message.c: Remove all SoupContext references
3967         (mostly replaced with SoupUri references)
3968         (cleanup_message): priv->connect_tag and priv->connection are gone
3969         now, so this was just soup_message_io_cancel(). So remove
3970         cleanup_message and replace it with that everywhere.
3971         (soup_message_disconnect): Gone.
3972         (soup_message_set_uri): Replaces soup_message_set_context.
3973         (soup_message_set_connection, soup_message_get_connection): Gone
3974
3975         * libsoup/soup-message-server-io.c (parse_request_headers):
3976         s/soup_message_set_context/soup_message_set_uri/
3977
3978         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
3979         connect_tag, context, and connection.
3980
3981         * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
3982
3983         * libsoup/soup-context.c: Gone
3984
3985         * tests/auth-test.c (identify_auth): update for session/context
3986         changes
3987
3988 2003-09-03  Dan Winship  <danw@ximian.com>
3989
3990         * libsoup/soup-status.h: Renamed from soup-error.h, with types
3991         and defines renamed accordingly.
3992
3993         * libsoup/soup-message.h (SoupMessage): Rename errorcode to
3994         status_code and errorphrase to reason_phrase. Remove errorclass.
3995         (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
3996         as being either "errors" or "not errors", so its semantics are
3997         guaranteed to be wrong sometimes.
3998
3999         * libsoup/soup-message.c (soup_message_set_status,
4000         soup_message_set_status_full): Renamed
4001
4002         * libsoup/soup-message-handlers.c
4003         (soup_message_add_status_code_handler,
4004         soup_message_add_status_class_handler): Rename.
4005
4006         * libsoup/soup-session.c (soup_session_send_message): Make this
4007         return a status code rather than a status class.
4008
4009         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
4010         unrelated unused fields (retries, callback, user_data).
4011
4012         * ...: Updates
4013
4014 2003-09-02  Dan Winship  <danw@ximian.com>
4015
4016         * libsoup/soup-session.c: First draft at the new object to
4017         maintain formerly-global state. (Not yet complete; still need to
4018         get rid of SoupContext).
4019
4020         * libsoup/soup-message-queue.c: Data structure used by SoupSession
4021
4022         * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
4023         some bits went into soup-connection.
4024
4025         * libsoup/soup-connection.c (soup_connection_send_request): New,
4026         to send a request on a connection. The connection updates its
4027         internal state and then hands off to soup_message_send_request.
4028         (request_done): Callback set up by soup_connection_send_request.
4029         Marks the connection as no-longer-in-use, and disconnects it if
4030         the message says to.
4031         (soup_connection_set_in_use, soup_connection_mark_old): No longer
4032         needed; the connection takes care of this itself now.
4033         (soup_connection_new_proxy): New, to create a new connection that
4034         is explicitly marked as being through an HTTP proxy.
4035         (soup_connection_new_tunnel): New, to create a new HTTPS
4036         connection through a proxy. (Includes the code to send the
4037         CONNECT.)
4038
4039         * libsoup/soup-context.c (try_existing_connections): Don't need to
4040         call soup_connection_set_in_use.
4041         (try_create_connection): Use soup_connection_new,
4042         soup_connection_new_proxy, or soup_connection_new_tunnel as
4043         appropriate.
4044
4045         * libsoup/soup-message.c (soup_message_prepare): Replaces
4046         queue_message.
4047         (soup_message_queue, soup_message_requeue, soup_message_prepare):
4048         Gone. This must be done via a SoupSession now.
4049         (soup_message_set_connection): don't need to mark in_use/not
4050         in_use. Also, msg->priv->socket is gone now.
4051         (soup_message_get_socket): Gone.
4052
4053         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
4054         Remove references to global handlers.
4055         (redirect_handler, authorize_handler): Moved to soup-session.c.
4056
4057         * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
4058         session to shut down now.
4059
4060         * libsoup/soup.h: add soup-session.h
4061
4062         * libsoup/Makefile.am: updates
4063
4064         * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
4065         SoupSession.
4066
4067 2003-08-29  Dan Winship  <danw@ximian.com>
4068
4069         * libsoup/soup-message-io.c: Major rewrite. There is now only a
4070         single IO state object (instead of one for reading and one for
4071         writing), and the IO code handles switching back and forth between
4072         reading and writing as appropriate (including handling the extra
4073         switches needed for "Expect: 100-continue").
4074         (soup_message_io_client, soup_message_io_server): The new entry
4075         points.
4076         (soup_message_io_cancel): If the caller cancels the IO when we
4077         were expecting to read more data, disconnect the socket.
4078
4079         * libsoup/soup-message.h (SoupMessageFlags): add
4080         SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
4081         do the special expect-continue handling.
4082
4083         * libsoup/soup-message.c: Move all the signal stuff here. Remove
4084         the "done_reading" and "done_writing" signals and replace them
4085         with a single "finished" signal. (A single signal. Say that 10
4086         times fast!)
4087         (soup_message_got_headers, etc): Functions to emit signals.
4088         (got_headers, got_chunk, got_body): Default signal methods that
4089         call soup_message_run_handlers.
4090         (finished): Default signal method that replaces
4091         soup_message_issue_callback.
4092         ([various]): s/soup_message_issue_callback/soup_message_finished/
4093         (soup_message_requeue): There's no soup_message_set_read_callbacks
4094         any more, so if the caller requeues while it's still reading, just
4095         cancel the read.
4096         (soup_message_add_chunk, soup_message_add_final_chunk,
4097         soup_message_pop_chunk): Moved here from soup-server-message,
4098         although we don't actually quite support using chunked encoding
4099         for requests yet.
4100
4101         * libsoup/soup-server-message.c (soup_server_message_new): No
4102         longer takes a socket argument.
4103         (soup_server_message_add_chunk, soup_server_message_get_chunk):
4104         Moved into SoupMessage.
4105
4106         * libsoup/soup-message-handlers.c (global_handlers): Make these
4107         POST_BODY rather than PRE_BODY, so they won't mess up the IO
4108         channel when the requeue the message.
4109         (soup_message_run_handlers): Don't need to issue the message
4110         callback from here any more.
4111         (authorize_handler): Just leave the error as 401 or 407 (see
4112         soup-error.h change)
4113
4114         * libsoup/soup-message-client-io.c (soup_message_send_request):
4115         Replaces soup_message_write_request and
4116         soup_message_read_response.
4117
4118         * libsoup/soup-message-server-io.c: Parallel to
4119         soup-message-client-io.c, this defines the server-side header
4120         handling.
4121         (soup_message_read_request): Its entry point.
4122
4123         * libsoup/soup-server.c: Lots of code moved into
4124         soup-message-server-io.c. Update for other changes.
4125
4126         * libsoup/soup-queue.c: Update for changes
4127
4128         * libsoup/soup-socket.c (read_from_network, soup_socket_write):
4129         Don't call soup_socket_disconnect() on an error, just return
4130         SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
4131         signals that will mess up the caller of the read/write function.
4132
4133         * libsoup/soup-connection.c (soup_connection_disconnect): When
4134         disconnecting the socket, disconnect from its signals first to
4135         prevent bad reentrancy.
4136
4137         * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
4138         SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
4139         anything that SOUP_ERROR_UNATHORIZED and
4140         SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
4141         "transport" errors actually are transport-related.)
4142
4143         * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
4144
4145         * tests/simple-proxy.c: Complicate this a bunch. In particular,
4146         use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
4147         pass the data back to the client in chunked format.
4148
4149 2003-08-27  Dan Winship  <danw@ximian.com>
4150
4151         * libsoup/soup-types.h: New header with typedefs, to avoid
4152         #include loops among other headers.
4153
4154         * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
4155
4156         * libsoup/*.[ch], tests/*.c: Update for soup-types.h
4157         
4158 2003-08-26  Dan Winship  <danw@ximian.com>
4159
4160         * libsoup/soup-message-client-io.c (soup_message_write_request,
4161         soup_message_read_response): Higher-than-soup-message-io-level
4162         functions to do client-side IO. (Code that used to be in
4163         soup-queue.c)
4164         (get_request_header_cb): Fix a bug in the generation of the Host:
4165         header; need to include the port number if it's not the default.
4166
4167         * libsoup/soup-message-io.c (soup_message_write,
4168         soup_message_write_simple): Take separate user_datas for the get_*
4169         callbacks and the done callbacks.
4170
4171         * libsoup/soup-queue.c: Update to use soup_message_write_request
4172         and soup_message_read_response.
4173
4174         * libsoup/soup-connection.c (soup_connection_new): Change the
4175         prototype to take a SoupUri and a callback.
4176
4177         * libsoup/soup-context.c (try_create_connection,
4178         soup_context_connect_cb): Update for soup_connection_new change.
4179
4180         * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
4181         for soup_message_write changes
4182
4183         * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
4184         function
4185
4186 2003-08-26  Dan Winship  <danw@ximian.com>
4187
4188         * libsoup/soup-message-private.h: Define SoupMessage signal stuff
4189         (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
4190         WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
4191
4192         * libsoup/soup-message.c (class_init): set up signals
4193         (requeue_read_finished): Update for changes.
4194
4195         * libsoup/soup-message-io.c (soup_message_read): Split out
4196         parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
4197         arg to say where to store the message body. Set up
4198         read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
4199         signal handlers.
4200         (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
4201         (read_body_chunk): emit READ_CHUNK.
4202         (issue_final_callback): Set r->body. emit READ_BODY.
4203         (failed_read): emit READ_ERROR.
4204         (soup_message_read_set_callbacks): Disconnect old signal handlers,
4205         connect new ones.
4206         (soup_message_read_cancel): Disconnect signal handlers.
4207         (soup_message_write, soup_message_write_simple): Set up
4208         wrote_body_cb and error_cb as signal handlers.
4209         (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
4210         nothing currently ever listens for them. emit WROTE_BODY when
4211         done.
4212         (failed_write): emit WRITE_ERROR
4213
4214         * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
4215         soup_queue_read_headers_cb): Split this into two unequal chunks.
4216         (read_header_cb only runs the pre-body handlers).
4217         (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
4218         prototypes.
4219         (soup_queue_write_done_cb): Update call to soup_message_read
4220
4221         * libsoup/soup-server.c (parse_headers_cb): Renamed from
4222         read_headers_cb
4223         (read_done_cb): Update prototype
4224         (start_request): Update soup_message_read call.
4225
4226 2003-08-25  Dan Winship  <danw@ximian.com>
4227
4228         * libsoup/soup-message-io.c (soup_message_read,
4229         soup_message_write, soup_message_write_simple): Add a "user_data"
4230         arg, pass it to the callbacks.
4231
4232         * libsoup/soup-message.c (soup_message_requeue,
4233         requeue_read_finished, requeue_read_error): Update for that
4234
4235         * libsoup/soup-queue.c: Likewise
4236
4237         * libsoup/soup-server.c: Likewise
4238
4239 2003-08-25  Dan Winship  <danw@ximian.com>
4240
4241         * libsoup/soup-message.c (soup_message_new): Take a uri string
4242         instead of a context. Also, swap the args (so the method comes
4243         before the URI, just like in the protocol).
4244         (soup_message_new_from_uri): Like soup_messgae_new, but takes a
4245         SoupUri instead of a string
4246         (soup_message_set_request, soup_message_set_response): Replace
4247         soup_message_new_full.
4248         (cleanup_message): Was soup_message_cleanup, but is static now.
4249         (queue_message): Do the pre-queuing message cleanup here instead
4250         of in soup_queue_message.
4251         (soup_message_queue): Set the callback and user_data, then call
4252         queue_message.
4253         (requeue_read_error, requeue_read_finished, soup_message_requeue):
4254         Use queue_message
4255         (soup_message_get_uri): Replaces soup_message_get_context.
4256
4257         * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
4258         part of SoupMessagePrivate now)
4259
4260         * libsoup/soup-context.c: #include soup-message-private
4261         (soup_context_from_uri): constify the uri arg.
4262
4263         * libsoup/soup-queue.c: Various context/uri fixes
4264         (proxy_https_connect): Use soup_message_new_from_uri.
4265         (soup_queue_message): Drastically simplified since most of the
4266         work is in soup-messsage.c:queue_message() now
4267
4268         * libsoup/soup-auth-digest.c (compute_response,
4269         get_authorization): Use soup_message_get_uri.
4270
4271         * libsoup/soup-server-auth.c (parse_digest): Likewise
4272
4273         * libsoup/soup-server.c (call_handler): Likewise
4274
4275         * tests/simple-httpd.c (server_callback): Likewise.
4276
4277         * tests/simple-proxy.c (server_callback): Likewise
4278
4279         * tests/get.c (got_url): Likewise.
4280         (get_url): Update soup_message_new usage.
4281
4282         * tests/auth-test.c: #include soup-message-private. Update for
4283         context changes and soup_message_new change.
4284
4285 2003-08-22  Dan Winship  <danw@ximian.com>
4286
4287         * libsoup/soup-message-private.h: New file containing
4288         SoupMessagePrivate and some other soup-message-internal
4289         types/functions. Also includes the new, expanded SoupMessageStatus
4290         enum.
4291
4292         * libsoup/soup-message-io.c: Replaces what used to be in
4293         soup-transfer, but now all the interfaces take SoupMessages
4294         instead of SoupReader/SoupWriter and deal with maintaining
4295         msg->priv->{read,write}_state themselves. Fixes up all the
4296         refcounting madness.
4297
4298         * libsoup/soup-message-handlers.c: Move the handler code here,
4299         mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
4300         to make the distinction from SoupHandlerKind clearer.)
4301
4302         * libsoup/soup-message.c: Update for soup-message-io and new
4303         SoupMessageStatus values. Remove handler code.
4304         (soup_message_cleanup): Remove the hack to try to preserve the
4305         connection if the message gets cleaned up before it finishes
4306         reading. soup_message_requeue handles this in the requeuing case,
4307         and there's no especially compelling reason to bother doing it in
4308         any other case. (And the soup-message-io api doesn't support
4309         having a read operation that's not connected to any message.)
4310
4311         * libsoup/soup-private.h: remove SoupMessagePrivate
4312
4313         * libsoup/soup-queue.c: Update for soup-message-io and new
4314         SoupMessageStatus values.
4315
4316         * libsoup/soup-server-message.c: Likewise
4317
4318         * libsoup/soup-server.c: Likewise
4319
4320         * libsoup/soup-transfer.c: Gone (yay)
4321
4322         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
4323
4324 2003-08-20  Dan Winship  <danw@ximian.com>
4325
4326         * libsoup/soup-message.c: Make this a GObject. (Note that since
4327         SoupMessage was not refcounted before, it's not really refcounted
4328         now either. TBF)
4329         (soup_message_free): Gone, replaced by g_object_unref
4330         (soup_message_copy, soup_message_foreach_remove_header): Remove
4331         these, since neither was currently functional.
4332         (soup_message_is_keepalive): New utility function to look at
4333         HTTP version and request/response headers to decide if a message
4334         indicates the connection should be kept alive.
4335         (soup_message_set_connection, soup_message_get_connection): New
4336         (soup_message_get_socket): New
4337
4338         * libsoup/soup-server-message.c: Make this a subclass of
4339         SoupMessage.
4340         (soup_server_message_new): Now takes a SoupServer and SoupSocket
4341         (soup_server_message_get_server): New
4342         (soup_server_message_set_encoding,
4343         soup_server_message_get_encoding): Get/set whether the message
4344         should be sent with content-length or chunked encoding
4345         (soup_server_message_is_started, soup_server_message_is_finished):
4346         Private member accessors.
4347         (soup_server_message_add_chunk): Renamed from add_data
4348         (soup_server_message_get_chunk): Pops a chunk from the list.
4349         (soup_server_message_get_source): Gone
4350
4351         * libsoup/soup-server.c: Update for SoupServerMessage changes.
4352         (error_cb, write_done_cb): All the cleanup stuff that used to be
4353         here happens automatically by unreffing the message now.
4354         (get_response_header): Remove some erroneous leftover CGI stuff
4355         (issue_bad_request): add "Connection: close" to the response.
4356         (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
4357         with no Host header as per RFC 2616.
4358
4359         * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
4360         (soup_connection_set_in_use): Let the caller set the connection to
4361         "not in use" even after the socket has been disconnected.
4362
4363         * libsoup/soup-context.c: Use soup_message_get_connection
4364
4365         * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
4366         check on request length, since it was rejecting
4367         "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
4368
4369         * libsoup/soup-queue.c: Use soup_message_get_connection and
4370         soup_message_get_socket.
4371         (soup_queue_read_done_cb): Use soup_message_is_keepalive
4372         (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
4373         soup_connection_start_ssl
4374
4375         * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
4376         handlers if the socket hasn't been disconnected yet.
4377
4378         * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
4379         reader_read): Fix these so that reader_read will exit properly if
4380         the read is cancelled.
4381
4382         * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
4383
4384         * tests/simple-httpd.c (server_callback): set the message to
4385         content-length encoding.
4386         * tests/simple-proxy.c (server_callback): Likewise
4387
4388 2003-08-19  Dan Winship  <danw@ximian.com>
4389
4390         * libsoup/soup-socket.c (soup_socket_read,
4391         soup_socket_read_until, soup_socket_write): New API for doing
4392         socket IO. Works both synchronously and asynchronously, and
4393         buffers data to prevent the "100 Continue" problem.
4394         (soup_socket_set_flag): Replaces formerly-private
4395         soup_set_sockopts. (primarily to let the caller turn off
4396         SOUP_SOCKET_FLAG_NONBLOCKING).
4397
4398         * libsoup/soup-transfer.c (soup_transfer_read,
4399         soup_transfer_write, soup_transfer_write_simple): Take a
4400         SoupSocket instead of a GIOChannel. Use the new socket IO api.
4401         Changed the prototypes of some of the callbacks to be less
4402         hackish.
4403
4404         * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
4405         soup_connection_get_iochannel.
4406
4407         * libsoup/soup-message.c: Fix up for soup-transfer changes
4408
4409         * libsoup/soup-queue.c: Likewise
4410
4411         * libsoup/soup-server.c: Likewise
4412
4413         * tests/revserver.c: A slightly more complicated replacement for
4414         timeserver. (Does both reads and writes)
4415
4416 2003-08-19  Dan Winship  <danw@ximian.com>
4417
4418         * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
4419         configure it, and no one has complained, and it looks like the
4420         SOCKS5 auth code doesn't actually work anyway...
4421
4422         * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
4423
4424         * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
4425         SOUP_PROTOCOL_SOCKS5
4426
4427         * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
4428
4429         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
4430         soup-socks.[ch]
4431
4432 2003-08-19  Dan Winship  <danw@ximian.com>
4433
4434         * libsoup/soup-server.c: Make this a GObject. Remove
4435         SoupServerMessage code (to soup-server-message.c). Remove CGI
4436         server code (for now?)
4437         (soup_server_add_handler, soup_server_remove_handler): Rename
4438         (from register/unregister) to make it clearer what they do.
4439
4440         * libsoup/soup-server-message.c: Moved out of soup-server.c
4441
4442         * libsoup/soup-private.h: Remove SoupServer def
4443
4444         * libsoup/Makefile.am (libsoupinclude_HEADERS,
4445         libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
4446
4447         * tests/simple-httpd.c: 
4448         * tests/simple-proxy.c: Update for SoupServer changes
4449
4450 2003-08-18  Dan Winship  <danw@ximian.com>
4451
4452         * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
4453         a struct sockaddr again (like it used to be). In particular, add
4454         back the "port" field. Add a bunch of macros to try (and fail) to
4455         simplify some of the code.
4456         (soup_address_new): Now returns a SoupAddress directly rather than
4457         a random handle, and the caller can just use g_object_unref to
4458         cancel the lookup. Also, the callback now uses a
4459         SoupKnownErrorCode rather than a special-purpose address-lookup
4460         error code.
4461         (soup_address_new_cancel): No longer needed.
4462         (soup_address_new_sync): Removed
4463         (soup_address_new_any): Replaces soup_address_ipv4_any and
4464         soup_address_ipv6_any.
4465         (soup_address_get_name, etc): Gone. Use soup_address_resolve()
4466         now.
4467         (soup_address_get_physical): Renamed from
4468         soup_address_get_canonical_name.
4469         (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
4470
4471         * libsoup/soup-socket.c: Update for SoupAddress changes and make
4472         similar changes here.
4473         (soup_socket_new): Just creates a generic SoupSocket now.
4474         (soup_socket_connect): Client setup
4475         (soup_socket_listen): Server setup. Now also sets up an iochannel
4476         listening for connects and emits a "new_connection" signal as they
4477         come in.
4478         (soup_socket_start_ssl): Turns on SSL.
4479         (soup_socket_client_new, soup_socket_server_new): Utility
4480         functions that wrap the above.
4481         (soup_socket_new_cancel, soup_socket_new_sync): Gone
4482         (soup_socket_server_accept, soup_socket_server_try_accept): No
4483         longer needed.
4484         (soup_socket_get_iochannel): No longer adds a ref when returning
4485         the iochannel. Also, we set it to "close_on_unref" so that if a
4486         caller adds a ref to it, the connection will actually remain open
4487         even after the SoupSocket is destroyed.
4488         (soup_socket_get_local_address, soup_socket_get_remote_address):
4489         Let the caller get both of these.
4490
4491         * libsoup/soup-connection.c: Don't keep a private copy of the
4492         socket's iochannel.
4493         (soup_connection_new): Don't need to set socket options here.
4494         SoupSocket does it.
4495         (soup_connection_start_ssl): Just call soup_socket_start_ssl.
4496         (soup_connection_get_iochannel): Just return the socket's
4497         iochannel (and don't ref it)
4498
4499         * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
4500         SOUP_ERROR_CANT_RESOLVE_PROXY
4501
4502         * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
4503         Remove the "FIXME add a CANT_RESOLVE error" and return
4504         SOUP_ERROR_CANT_RESOLVE instead.
4505
4506         * libsoup/soup-server.c: Update for socket/address changes. Don't
4507         poke into SoupSocket's private fields.
4508         (soup_server_run_async): Just connect to the socket's
4509         "new_connection" signal.
4510
4511         * libsoup/soup-context.c (try_create_connection,
4512         soup_context_connect_cb): Update for socket changes. Replace
4513         SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
4514
4515         * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
4516         to connect to a signal handler and connect another function to
4517         clean up the first signal handler after its first invocation.
4518         (Lets us use signals to replace one-off callbacks.)
4519
4520         * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
4521         actually private now.
4522         (struct _SoupServer): Remove accept_tag.
4523
4524         * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
4525         Don't unref the iochannel.
4526         (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
4527
4528         * libsoup/soup-socks.c: Update for socket/address changes
4529
4530         * tests/simple-httpd.c (main):
4531         s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
4532         * tests/simple-proxy.c (main): Likewise
4533
4534         * tests/timeserver.c: Update for SoupSocket's "new_connection"
4535         signal, and for SoupAddress changes.
4536
4537 2003-08-14  Dan Winship  <danw@ximian.com>
4538
4539         * libsoup/soup-connection.c: New, split out from soup-context and
4540         made into a GObject.
4541         (soup_connection_disconnect): Disconnects the connection and emits
4542         a signal. (Replaces the old "keep_alive" flag.)
4543         (soup_connection_is_connected): Checks if the connection is still
4544         connected
4545         (connection_died): Just disconnect, rather than freeing the
4546         connection. This way if anyone else is still referencing it they
4547         won't end up with an invalid pointer.
4548
4549         * libsoup/soup-context.c: Make this a GObject, remove all the
4550         SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
4551         SoupContext can keep track of connection auth stuff there without
4552         SoupConnection needing to care. Various other updates.
4553
4554         * libsoup/soup-private.h: Remove SoupContext and SoupConnection
4555         definitions.
4556
4557         * libsoup/*.c, tests/get.c: Update for context/connection changes
4558
4559         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
4560         definition to deal with the fact that there's no
4561         soup_connection_get_context any more.
4562
4563         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
4564         with connection persistence here.
4565         (soup_queue_read_done_cb): Do it here instead. Disconnect the
4566         connection when appropriate.
4567         (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
4568         Reference-count the connection properly. (I think.)
4569
4570         * libsoup/soup-marshal.list: New, for SoupConnection's
4571         "disconnected" signal.
4572
4573         * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
4574
4575         * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
4576         GLIB_GENMARSHAL gets set too.
4577
4578 2003-08-14  Dan Winship  <danw@ximian.com>
4579
4580         * libsoup/soup-error.c: Fix a spelling mistake.
4581
4582         * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
4583
4584 2003-08-12  Dan Winship  <danw@ximian.com>
4585
4586         * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
4587         of the interfaces around a little bit.
4588
4589         * libsoup/soup-auth-basic.c: subclass for Basic auth
4590
4591         * libsoup/soup-auth-digest.c: subclass for Digest auth
4592
4593         * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
4594         the code from soup-ntlm.c here, and make it private.
4595
4596         * libsoup/soup-ntlm.c: gone
4597
4598         * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
4599         here, and change the signature of SoupAuthorizeFn.
4600
4601         * libsoup/soup-context.c: Use g_object_unref to free auths, use
4602         methods instead of directly access private fields.
4603
4604         * libsoup/soup-queue.c: Likewise
4605
4606         * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
4607         NTLM references. We have no plans to implement server-side NTLM
4608         auth.
4609
4610         * tests/auth-test.c (identify_auth): Update for auth api changes
4611
4612 2003-08-12  Dan Winship  <danw@ximian.com>
4613
4614         * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
4615         call
4616
4617         * libsoup/soup-address.c: Make this a GObject.
4618         (soup_address_ref, soup_address_unref): Gone.
4619         (soup_address_copy): Gone. Wasn't being used anyway.
4620
4621         * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
4622         here from soup-address.c, so that soup-address doesn't need to
4623         worry about trying to cache zero-ref addresses.
4624
4625         * libsoup/soup-socket.c: Make this a GObject. Use "guint"
4626         consistently for port numbers.
4627         (soup_socket_ref, soup_socket_unref): Gone.
4628
4629         * libsoup/soup-private.h: Change the SoupSocket definition to be
4630         SoupSocketPrivate. (Still need to keep this here since soup-server
4631         pokes around in its internals.)
4632         (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
4633
4634         * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
4635         reader/writer rather than leaking them.
4636
4637         * libsoup/*: Use GObject methods for socket/address refcounting
4638         
4639         * tests/auth-test.c (main)
4640         * tests/timeserver.c (main): Call g_type_init.
4641
4642         * tests/get.c (main): Call g_type_init.
4643         (get_url, got_url): Fix some bugs that could make -r mode get into
4644         infinite loops downloading the same files over and over. Plug some
4645         memory leaks to make this more useful for valgrinding libsoup.
4646
4647         * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
4648         handler for SIGINT so we can exit cleanly, since valgrind won't
4649         give a leak report if you don't. Plug a few memory leaks.
4650
4651         * tests/simple-proxy.c (main): Likewise 
4652
4653 2003-08-12  Dan Winship  <danw@ximian.com>
4654
4655         Pull over some new test programs from the soup-refactoring branch,
4656         along with the SoupUri changes they depend on.
4657
4658         * tests/simple-httpd.c: A really simple HTTP server, to test the
4659         server code.
4660
4661         * tests/simple-proxy.c: An even simpler HTTP proxy
4662
4663         * tests/get.c: Add "-r" flag to recursively get files (thereby
4664         testing multiple-connections-at-once code). Also good for setting
4665         up a tree to use with simple-httpd.
4666
4667         * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
4668         normal case)
4669
4670         * tests/uri-parsing.c: Regression test for the new soup-uri.c
4671
4672         * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
4673         pull in some optimizations from camel-url. Also, make SoupProtocol
4674         a GQuark so we can still compare them with ==, but we can also
4675         recognize any protocol.
4676         (soup_uri_new_with_base): New, to merge base and relative URIs
4677         (soup_uri_to_string): Update this. Change the "show_password" flag
4678         (which we always passed FALSE for) to "just_path", for places that
4679         want the path+query without the protocol, host, etc.
4680
4681         * libsoup/soup-queue.c (soup_get_request_header): Just use
4682         soup_uri_to_string to generate the request URI.
4683
4684         * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
4685         "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
4686         the URI by hand badly.
4687         * libsoup/soup-server-auth.c (parse_digest): Likewise
4688
4689         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
4690         switch() to an series of if()s since SOUP_PROTOCOL_* aren't
4691         constants any more.
4692
4693         * libsoup/soup-context.c (soup_context_uri_hash,
4694         soup_context_uri_equal): s/querystring/query/
4695
4696 2003-08-12  Dan Winship  <danw@ximian.com>
4697
4698         * configure.in: Bump API version to 2.2 and package version to
4699         2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
4700         libgnutls-config to find GNUTLS.
4701
4702         * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
4703
4704         * Makefile.am: Update for pc file rename
4705
4706         * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
4707         and libsoup-ssl-proxy stuff.
4708
4709         * libsoup/soup-ssl-proxy.c
4710         * libsoup/soup-nss.[ch]
4711         * libsoup/soup-openssl.[ch]: gone
4712
4713         * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
4714
4715         * tests/Makefile.am (get_LDADD, timeserver_LDADD,
4716         auth_test_LDADD): Update libsoup version
4717
4718 2003-08-07  Dan Winship  <danw@ximian.com>
4719
4720         * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
4721         soup_auth_invalidate): These are all really SoupContext functions,
4722         so move them to soup-context.c (and rename them appropriately).
4723         (soup_auth_get_protection_space): New method to get the
4724         "protection space" of an auth (paths where it is valid).
4725         (soup_auth_invalidate): New method to try to un-authenticate an
4726         auth (so we can keep the domain info cached even if the auth info
4727         is wrong).
4728         (basic_pspace_func): Basic protection space is all directories
4729         below the current one.
4730         (basic_invalidate_func): Clear the encoded username/password
4731         (digest_pspace_func): Digest protection space is either the whole
4732         server, or "what the domain parameter says" (though we don't deal
4733         with cross-host domains).
4734         (digest_invalidate_func): Return FALSE; bad digest auth info isn't
4735         cacheable.
4736         (digest_parse_func, digest_free): Set/free domain parameter
4737         (ntlm_pspace): NTLM protection space is always the whole server.
4738         (ntlm_invalidate): Clear the auth state.
4739         (soup_auth_new_ntlm): Make this non-static
4740         (SoupAuth): Replace the quad-state "status" field with an
4741         "authenticated" boolean.
4742         
4743         * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
4744         hash with separate "auth_realms" (path->realm) and "auths"
4745         (realm->auth) hashes. Also add a "use_ntlm" flag.
4746
4747         * libsoup/soup-context.c (soup_context_unref): Update SoupHost
4748         freeing code.
4749         (connection_free): Don't the connection's auth, just free it.
4750         (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
4751         does two-stage lookup (path->realm then realm->auth) and also
4752         deals with NTLM hacks.
4753         (soup_context_update_auth): Mostly formerly soup_auth_set_context,
4754         but also large parts of authorize_handler. Updates the auth hashes
4755         based on information from a 401 or 407 response. Does a better job
4756         than authorize_handler did of not throwing away good information.
4757         (soup_context_preauthenticate): New; fakes up auth info so that
4758         requests will end up using authentication without the server
4759         needing to return an error first.
4760         (soup_context_authenticate_auth): Moved out of authorize_handler
4761         so it can be used at request-sending time too, if we know that we
4762         need it. (That way we can avoid requeuing the request if it isn't
4763         going to be able to be authenticated.)
4764         (soup_context_invalidate_auth): Sort of like the old
4765         soup_auth_invalidate, but only destroys the auth data, while still
4766         remembering the path->realm mapping.
4767
4768         * libsoup/soup-message.c (authorize_handler): Mostly moved into
4769         soup_context_update_auth.
4770         (maybe_validate_auth): Remove this; it was only useful because of
4771         bugs elsewhere in the auth handling.
4772         
4773         * libsoup/soup-queue.c (soup_encode_http_auth): Update for
4774         soup_context_lookup_auth. If the returned auth isn't
4775         authenticated, call soup_context_authenticate_auth() on it.
4776
4777         * tests/auth-test.c: New (from soup-refactoring branch). Tests
4778         that the Basic/Digest auth code does the right thing. (TODO: find
4779         a good way to add NTLM tests too.)
4780
4781         * tests/Makefile.am (check_PROGRAMS): add auth-test
4782
4783 2003-07-29  Dan Winship  <danw@ximian.com>
4784
4785         * configure.in: 1.99.25 ("Potato and Leek Soup")
4786
4787         * libsoup/soup-message.c (requeue_read_finished,
4788         release_connection): Free the passed-in body data. Otherwise the
4789         response body ends up getting leaked on most 3xx and 4xx
4790         responses.
4791         (soup_message_cleanup): Remove a piece of code that didn't
4792         actually do anything and its associated confused comment.
4793
4794         * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
4795
4796         * libsoup/soup-context.c (connection_free): plug a non-occasional
4797         NTLM auth leak.
4798
4799 2003-06-26  Joe Shaw  <joe@ximian.com>
4800
4801         * configure.in: Version 1.99.24
4802
4803 2003-06-24  Dan Winship  <danw@ximian.com>
4804
4805         * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
4806         it, and (b) depends on lots of new things sometimes (like on RH9).
4807
4808         * libsoup/soup-openssl.c: 
4809         * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
4810         just #ifdef HAVE_OPENSSL since the header check doesn't get run in
4811         the pkgconfig case
4812
4813 2003-06-19  Dan Winship  <danw@ximian.com>
4814
4815         * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
4816         old read_tag before changing/clearing it.
4817         (soup_queue_write_done_cb): Likewise with the write_tag.
4818
4819         * libsoup/soup-transfer.c (issue_final_callback): ref the reader
4820         around the stop+callback.
4821         (soup_transfer_write_cb): Likewise.
4822
4823 2003-06-12  Dan Winship  <danw@ximian.com>
4824
4825         * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
4826         ref_count field.
4827         (soup_transfer_read, create_writer): Set initial ref_count to 2
4828         (one for soup-transfer, one for the caller).
4829         (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
4830         reader
4831         (soup_transfer_read_stop): Clears the GIOChannel callbacks and
4832         drops soup-transfer's ref.
4833         (soup_transfer_read_cancel): Now just a stop+unref
4834         (soup_transfer_write_ref, soup_transfer_write_unref,
4835         soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
4836
4837         * libsoup/soup-message.c (soup_message_cleanup): when setting up
4838         the "finish reading" callbacks, unref the reader so it will be
4839         destroyed once it's done reading.
4840         (soup_message_requeue): Likewise.
4841
4842         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
4843         prototype change (no longer returns a SoupTransferDone).
4844         (soup_queue_read_chunk_cb): Likewise.
4845
4846         * libsoup/soup-server.c (read_headers_cb): Likewise
4847
4848 2003-06-11  Dan Winship  <danw@ximian.com>
4849
4850         * libsoup/soup-transfer.c: Change all functions to take a
4851         SoupReader * or SoupWriter * instead of a guint.
4852
4853         * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
4854         write_tag pointers instead of guints.
4855
4856 2003-06-02  Chris Toshok  <toshok@ximian.com>
4857
4858         * libsoup/soup-ssl.c: remove #include for soup-nss.h
4859
4860 2003-06-02  Chris Toshok  <toshok@ximian.com>
4861
4862         * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
4863         (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
4864         (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
4865
4866 2003-06-02  Chris Toshok  <toshok@ximian.com>
4867
4868         * configure.in: Bump version to 1.99.23.
4869
4870 2003-05-30  Chris Toshok  <toshok@ximian.com>
4871
4872         * libsoup/soup-queue.c (soup_queue_error_cb): always force a
4873         reconnect when there's an error with ssl connection.  This fixes
4874         #43387, but it runs the risk of sending requests multiple times to
4875         the exchange server, and it results in lots of shorter lived
4876         connections and more forking (in the ssl proxy case), depending on
4877         the length of the operation.
4878
4879 2003-05-21  Dan Winship  <danw@ximian.com>
4880
4881         * configure.in: 1.99.22 (codename: French Onion Soup)
4882
4883 2003-05-20  Dan Winship  <danw@ximian.com>
4884
4885         * libsoup/soup-message.c (soup_message_requeue): Clear the
4886         write_tag as well so we don't double-cancel it. #43395.
4887
4888         * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
4889         be destroyed by the end of the func, so we have to call
4890         soup_connection_set_used at the beginning.
4891
4892         * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
4893         Call g_set_error() so that we don't SEGV immediately after
4894         returning G_IO_STATUS_ERROR.
4895
4896 2003-05-08  Joe Shaw  <joe@ximian.com>
4897
4898         * configure.in: Bump version to 1.99.21
4899
4900         * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
4901         tunnelling fails, the other message which shares our same
4902         connection will free it first, so set ours to NULL.
4903
4904 2003-05-08  Dan Winship  <danw@ximian.com>
4905
4906         * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
4907         return an NTLM request string. Otherwise return the "response"
4908         field (which should include the NTLM authenticate message)
4909         (ntlm_init): Don't bother setting "response" to the NTLM request
4910         string. Just leave it NULL in that case.
4911
4912         * libsoup/soup-message.c (authorize_handler): Never try to reuse
4913         an NTLM auth returned from soup_auth_lookup. Only set the auth on
4914         the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
4915         call soup_auth_set_context() on it just like for non-NTLM auth.
4916         The net effect of all of this is that now we record when a context
4917         needs NTLM auth just like with non-NTLM auth, so that that info
4918         gets preserved across connections.
4919         (soup_message_requeue): No longer need the hackery here to
4920         preserve the connection auth state.
4921
4922 2003-05-07  Dan Winship  <danw@ximian.com>
4923
4924         * libsoup/soup-context.c (soup_connection_set_in_use): New, to
4925         toggle the connection's in_use flag, and set up the death watch
4926         when it's not in use.
4927         (connection_death): This is only hooked up when the connection is
4928         not in use now, so don't need to check that. Should fix the
4929         infinite connection_death loop.
4930         (soup_connection_is_new): Keep a distinct "new" flag rather than
4931         defining "new" as "has been released at least once".
4932         (soup_connection_set_used): Mark a connection no-longer new.
4933         (soup_context_connect_cb): Mark the connection as new. Don't set
4934         up the death watch since it's in_use.
4935         (try_existing_connections): Use soup_connection_set_in_use.
4936         (soup_connection_release): Likewise
4937
4938         * libsoup/soup-message.c (requeue_read_finished): Call
4939         soup_connection_set_used so that the connection isn't still
4940         considered new when we send the message the second time.
4941
4942         * libsoup/soup-queue.c (soup_queue_error_cb): Call
4943         soup_connection_set_used (assuming we don't close the connection)
4944         (soup_queue_read_done_cb): Likewise.
4945
4946         * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
4947         nothing, call soup_transfer_read_error_cb rather than just
4948         cancelling, or else it will get cancelled again later.
4949
4950 2003-05-07  Dan Winship  <danw@ximian.com>
4951
4952         * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
4953         library doesn't depend on them, only the proxy does. #42473
4954
4955 2003-05-06  Dan Winship  <danw@ximian.com>
4956
4957         * src/libsoup/soup-message.c (global_handlers): Change the
4958         redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
4959         SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
4960         for "Location" to get around the non-64-bit-clean union
4961         initialization pointed out by Jeremy Katz <katzj@redhat.com>.
4962         (redirect_handler): Update for that.
4963
4964 2003-04-28  Dan Winship  <danw@ximian.com>
4965
4966         * configure.in: 1.99.20
4967
4968         * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
4969         we always call UNIGNORE_CANCEL. Might fix #41971
4970
4971 2003-04-25  Dan Winship  <danw@ximian.com>
4972
4973         * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
4974         suddenly gets an io error while reading or writing, assume it's a
4975         timeout or something, close the connection, and requeue the
4976         message.
4977
4978 2003-04-23  Dan Winship  <danw@ximian.com>
4979
4980         * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
4981         soup-transfer callbacks to keep reading off the connection unless
4982         we're actually going to keep the connection around afterward.
4983         Otherwise we can just close it.
4984
4985         * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
4986         thingy so that it's possible to cancel a read from inside a
4987         callback so that the above change actually works instead of just
4988         crashing.
4989
4990 2003-04-20  Rodney Dawes  <dobey@ximian.com>
4991
4992         * configure.in: Up version to 1.99.18
4993         * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
4994         
4995 2003-04-11  Dan Winship  <danw@ximian.com>
4996
4997         * libsoup/soup-context.c (soup_connection_purge_idle): New
4998         function to close all idle connections. (Needed for #41117 or else
4999         there's no way to force-discard NTLM authentication.)
5000
5001         * libsoup/soup-queue.c (soup_queue_shutdown): Use it
5002
5003 2003-04-10  Joe Shaw  <joe@ximian.com>
5004
5005         * libsoup/soup-queue.c (proxy_https_connect):
5006         proxy_https_connect_cb() might not get called if connecting to the
5007         proxy fails, and it causes us to double-free the connection.
5008         Always set the message's connection to NULL before freeing it.
5009
5010 2003-04-09  Dan Winship  <danw@ximian.com>
5011
5012         * configure.in: 1.99.17
5013
5014 2003-04-07  Dan Winship  <danw@ximian.com>
5015
5016         * libsoup/soup-context.c (connection_death): Revert Joe's changes.
5017         We can't release the connection there because there may be
5018         SoupMessages still pointing to it. (Needs to be revisited.)
5019
5020 2003-04-03  JP Rosevear  <jpr@ximian.com>
5021
5022         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
5023         error during waitpid
5024
5025         * libsoup/soup-address.c: ditto
5026
5027 2003-04-02  Joe Shaw  <joe@ximian.com>
5028
5029         * libsoup/soup-context.c (connection_death): Only drop the
5030         connection if we get an error condition on the channel.  Fixes a
5031         double-free.
5032
5033 2003-04-02  Joe Shaw  <joe@ximian.com>
5034
5035         * libsoup/soup-context.c (connection_death): Just call
5036         soup_connection_release() from here and return whether the
5037         connection is in use.
5038
5039 2003-03-31  Ian Peters  <itp@ximian.com>
5040
5041         * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
5042         case of EAGAIN or EINTR, since shutting down an SSL connection
5043         requires more than just closing a socket.
5044
5045 2003-03-28  Dan Winship  <danw@ximian.com>
5046
5047         * libsoup/soup-message.c (soup_message_set_context): If the new
5048         context points to a different server from the old context, call
5049         soup_message_cleanup. Otherwise it tries to reuse the old
5050         connection...
5051
5052 2003-03-25  Joe Shaw  <joe@ximian.com>
5053
5054         * configure.in: Bump up to 1.99.16
5055
5056 2003-03-24  Joe Shaw  <joe@ximian.com>
5057
5058         * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
5059         slightly better error message on various SSL failures than the
5060         previous message.
5061
5062         * soup-queue.c (soup_queue_error_cb): Throw the
5063         SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
5064
5065 2003-03-21  Joe Shaw  <joe@ximian.com>
5066
5067         * soup-server.c: Use non-deprecated g_main_loop_* calls
5068         throughout.
5069         (soup_server_unref): Don't unref the main loop if it's NULL.
5070         Fixes a glib warning.
5071
5072 2003-03-18  Dan Winship  <danw@ximian.com>
5073
5074         * configure.in: comment out NSS checks. The NSS code doesn't work
5075         and there are no current plans to fix it.
5076
5077         * README (Features): Mention GnuTLS, remove NSS and the rest of
5078         the "Planned Features" section.
5079
5080         * MAINTAINERS: remove Alex
5081
5082         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
5083         timeout to 10 seconds (and get rid of the 3 tries) so we don't
5084         fail to connect just because the server is slow/far away.
5085
5086 2003-03-17  Joe Shaw  <joe@ximian.com>
5087
5088         * configure.in: Bump up to 1.99.15.
5089
5090 2003-03-12  Ian Peters  <itp@ximian.com>
5091
5092         * libsoup/soup-gnutls.c: because creating client credentials is
5093         expensive, keep the same one around as long as possible, only
5094         recreating it if the ssl_ca_file changes.  Wrap
5095         gnutls_certificate_credentials in a refcounted struct to avoid
5096         freeing it while another established connection may potentially
5097         need it (say, to rehandshake).
5098
5099 2003-03-11  Frank Belew  <frb@ximian.com>
5100
5101         * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't 
5102         use pkgconfig
5103
5104 2003-03-10  Joe Shaw  <joe@ximian.com>
5105
5106         * configure.in: Bump up to 1.99.14.
5107
5108         * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
5109         libsoup/soup-ssl.c: Add support for GnuTLS.  Patch from Ian
5110         Peters.
5111
5112 2003-03-07  Joe Shaw  <joe@ximian.com>
5113
5114         * configure.in: Bump up to 1.99.13.
5115
5116         * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
5117         the list of conditions to watch.  If the remote end hangs up the
5118         connection, we'll get a successful read of 0 bytes, not a HUP.
5119         The connection will have to be released by the point we check for
5120         it in connection_death().
5121
5122         * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
5123         (apparently) errant resetting of the read and write tags.  I think
5124         this might have been causing some reentrancy and crashes.
5125
5126         * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
5127         channel to NULL encoding and not buffered.
5128
5129         * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
5130         incorrect comments.
5131
5132 2003-02-28  Joe Shaw  <joe@ximian.com>
5133
5134         * configure.in: Bump up to 1.99.12.
5135
5136         * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
5137         header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
5138         this case we probably don't want to call the error callback, we
5139         just want to act like our transfer was cancelled.
5140
5141 2003-02-27  Joe Shaw  <joe@ximian.com>
5142
5143         Try to apply some order to the iochannel refcounting...
5144
5145         * configure.in: Bump up to 1.99.11.
5146
5147         * libsoup/soup-context.c (soup_connection_get_iochannel): The
5148         connections needs to own a reference to the iochannel!  If we're
5149         using HTTPS, release the ref we get from soup_socket_get_iochannel
5150         and replace it with the ref we get from soup_ssl_get_iochannel().
5151         Then, always ref the channel that we return (ugh, but that's the
5152         soup way).
5153         (connection_free): Release the connection's ref to the iochannel.
5154
5155         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
5156         iochannel. The reference we pass back will be owned by the
5157         connection.
5158         (soup_ssl_hup_waitpid): Release our ref.
5159
5160 2003-02-27  Joe Shaw  <joe@ximian.com>
5161
5162         * configure.in: Bump up to 1.99.10.
5163
5164         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
5165         iochannel, return to the status quo.  Sigh.
5166
5167 2003-02-26  Joe Shaw  <joe@ximian.com>
5168
5169         * configure.in: Bump up to 1.99.9.
5170
5171         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
5172         it's causing problems with HTTPS and proxies; the iochannel
5173         refcounting is waaaaaay horked.
5174
5175 2003-02-26  Frank Belew  <frb@ximian.com>
5176
5177         * libsoup/Makefile.am: added workaround to link ssl-proxy statically
5178
5179 2003-02-11  Joe Shaw  <joe@ximian.com>
5180
5181         * configure.in: Bump up to 1.99.8 for snaps.
5182
5183         * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
5184         It returns the address to the resulting hostent or NULL on failure,
5185         unlike Linux which returns an error code.
5186
5187 2003-02-11  Joe Shaw  <joe@ximian.com>
5188
5189         * configure.in: Bump up to 1.99.7 for snaps.
5190
5191         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
5192         the error string from OpenSSL if we can't establish a connection.
5193
5194 2003-02-04  Joe Shaw  <joe@ximian.com>
5195
5196         * configure.in: Bump up to 1.99.6 for snaps.
5197
5198         * libsoup/soup-server.c (destroy_message): We already assigned
5199         chan, so don't reassign it, and unref it in all cases.
5200         (issue_bad_request): Always unref after a call to
5201         soup_socket_get_iochannel(), because it refs it.
5202         (conn_accept): Fix some funky GIOChannel reffing here.
5203
5204         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
5205         g_io_channel_ref() on the socket.  This is the exact opposite of
5206         what we want to do.  Create a temporary structure containing the
5207         parent pid and the old socket and unref the socket when our
5208         callback is called.  This should fix GIOChannels being leaked on
5209         SSL connections.
5210
5211         * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
5212         main loop quits.
5213
5214 2003-01-22  Joe Shaw  <joe@ximian.com>
5215
5216         * configure.in: Bump up to 1.99.5 for the snaps.
5217
5218         * libsoup/soup-address.c (soup_address_new): If we found the
5219         address in our hash, we need to return NULL or else Soup will
5220         think we're doing an async lookup and do some cancellation on
5221         us.  Besides, we were returning the wrong type anyway and it
5222         was crashing things.
5223
5224 2003-01-17  Joe Shaw  <joe@ximian.com>
5225
5226         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
5227         uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
5228         out, so keep trying until we succeed.
5229
5230 2003-01-10  Joe Shaw  <joe@ximian.com>
5231
5232         * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
5233         strings and print out the error when the cert can't verify.
5234
5235 2003-01-09  Dan Winship  <danw@ximian.com>
5236
5237         * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
5238         overrun noticed by valgrind
5239
5240 2002-12-20  Joe Shaw  <joe@ximian.com>
5241
5242         * libsoup/soup-server.c (soup_server_new_with_host): Added.
5243         Starts a server only on the interface specified, instead of all
5244         network interfaces.
5245
5246 2002-12-16  Jeremy Katz  <katzj@redhat.com>
5247
5248         * configure.in: use $libdir instead of /usr/lib when looking for
5249         libraries
5250
5251 2002-12-11  Joe Shaw  <joe@ximian.com>
5252
5253         * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
5254         Don't set a variable to NULL and then immediately try to
5255         dereference it.
5256
5257 2002-12-09  Joe Shaw  <joe@ximian.com>
5258
5259         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
5260         timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
5261         we don't hang forever if we don't get more data.
5262
5263         * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
5264         or else we'll hang forever in SSL_connect() if the other side
5265         hangs up.
5266
5267         * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
5268         release the connection on message free, even if the connection was
5269         unsuccessful.
5270
5271 2002-12-03  Joe Shaw  <joe@ximian.com>
5272
5273         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
5274         g_io_channel_set_close_on_unref() on the second half of the socket
5275         pair so we don't leak file descriptors.
5276
5277 2002-12-03  Frank Belew  <frb@ximian.com>
5278
5279         * libsoup/soup-address.c: add signal.h to the list of headers to 
5280         pick up SIGKILL
5281         
5282 2002-11-25  Joe Shaw  <joe@ximian.com>
5283
5284         * Makefile.am: Build the tests directory again
5285
5286 2002-11-21  Rodney Dawes  <dobey@ximian.com>
5287
5288         * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
5289         
5290 2002-11-20  Michael Meeks  <michael@ximian.com>
5291
5292         * configure.in: require autoconf 2.52 not 2.53.
5293
5294 2002-11-18  Dan Winship  <danw@ximian.com>
5295
5296         * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
5297         since it's apparently non-portable. Use s6_addr instead.
5298         (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
5299
5300         * libsoup/soup-error.c: Fix spelling of
5301         SOUP_ERROR_MOVED_PERMANENTLY and its description.
5302
5303         * libsoup/soup-message.c (soup_message_get_request_header, etc):
5304         Remove long-deprecated API.
5305
5306         * libsoup/soup-socket.c (soup_socket_connect): remove unused
5307         variable.
5308
5309         * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
5310         * libsoup/soup-server.c (cgi_read): Likewise
5311         * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
5312         Likewise.
5313         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
5314         * libsoup/soup-transfer.c (soup_transfer_read_cb,
5315         soup_transfer_write_cb): Likewise.
5316
5317         * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
5318         instead of IPv4. (Tested on OS X.)
5319
5320 2002-11-15  Dan Winship  <danw@ximian.com>
5321
5322         * libsoup/*: Change old Helix Code refs to Ximian (and update
5323         copyright dates).
5324
5325 2002-11-15  Frank Belew  <frb@ximian.com>
5326
5327         * tests/Makefile.am: uncomment lines to make timeserver build 
5328         correctly
5329         
5330 2002-11-14  Joe Shaw  <joe@ximian.com>
5331
5332         * libsoup/soup-address.c (soup_address_new): When we get an
5333         address from the hash, call our address lookup callback or else
5334         the connection will hang.
5335
5336 2002-11-13  Dan Winship  <danw@ximian.com>
5337
5338         * tests/timeserver.c: Oops, commit this.
5339
5340         * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
5341
5342 2002-11-13  Joe Shaw  <joe@ximian.com>
5343
5344         * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
5345         (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
5346         instead of bindir.
5347
5348         * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
5349         to properly shut down the SSL connection before closing the
5350         socket.
5351
5352         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
5353         iochannels before quitting the main loop.
5354
5355         * tests/Makefile.am: disable building timeserver, the source file
5356         wasn't added.
5357
5358 2002-11-12  Dan Winship  <danw@ximian.com>
5359
5360         * configure.in: Check for IPv6 support in networking headers.
5361
5362         * libsoup/soup-address.c: Make the internal structure of
5363         SoupAddress entirely private, and make SoupAddress be more like a
5364         hostent and less like a sockaddr. (Ie, make it not have a port
5365         associated with it.) Document undocumented functions. Add
5366         completely-untested support for IPv6.
5367         (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
5368         SoupAddress and a port.
5369         (soup_address_ipv4_any, soup_address_ipv6_any): Return static
5370         addresses corresponding to the IPv6 and IPv6 "any" addresses.
5371         (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
5372         (soup_address_make_sockaddr): Now constructs a new sockaddr, which
5373         may be a sockaddr_in or sockaddr_in6.
5374         (soup_address_gethostname, soup_address_gethostaddr): Remove
5375         these. They aren't reliable, especially on multihomed hosts.
5376         (soup_gethostbyname, soup_gethostbyaddr): support IPv6
5377         (soup_address_new): Keep pending lookups in a separate hash table
5378         from completed lookups. Fix a bug when canceling a lookup when
5379         there was more one outstanding request for it.
5380         (soup_address_lookup_in_cache): Removed.
5381
5382         * libsoup/soup-socket.c: Add a port field to SoupSocket (since
5383         it's not in SoupAddress any more).
5384         (soup_socket_connect): Simplify this. Don't use
5385         soup_address_lookup_in_cache, just call soup_address_new, since we
5386         already know the code can deal with the callback being invoked
5387         immediately.
5388         (soup_socket_new_sync, soup_socket_new): Take a port argument.
5389         (soup_socket_server_new): Take a SoupAddress to use as the local
5390         address to bind to. This lets the caller choose between the IPv4
5391         and IPv6 "any" addresses, and also lets you bind to a single
5392         interface of a multi-homed machine.
5393         (soup_socket_server_accept, soup_socket_server_try_accept): Merge
5394         the common code.
5395
5396         * libsoup/soup-server.c (soup_server_new): Pass
5397         soup_address_ipv4_any() to soup_socket_server_new().
5398
5399         * libsoup/soup-socks.c (soup_connect_socks_proxy,
5400         soup_socks_write): Fix up for the API changes, but it won't work
5401         with IPv6 yet.
5402
5403         * tests/timeserver.c: Another really simple test, for the server
5404         socket code.
5405
5406         * tests/Makefile.am: build timeserver
5407
5408 2002-11-11  Dan Winship  <danw@ximian.com>
5409
5410         * libsoup/soup-address.c: Move the SoupAddress code from
5411         soup-socket.c and soup-socket-unix.c to here.
5412
5413         * libsoup/soup-socket.c: Move the remaining code from
5414         soup-socket-unix.c here.
5415
5416         * libsoup/soup-socket-unix.c: Gone
5417
5418         * tests/get.c: really really trivial test program
5419
5420         * configure.in (AC_OUTPUT):
5421         * Makefile.am (SUBDIRS): add tests/
5422
5423 2002-11-05  Dan Winship  <danw@ximian.com>
5424
5425         * Split libsoup out of soup. ChangeLog.old contains the original
5426         soup ChangeLog.
5427
5428         * Makefile.am, etc: Fix things up to work with the new directory
5429         layout. Disable docs until we fix them.
5430
5431         * autogen.sh: Use gnome-autogen.sh
5432
5433         * configure.in: Require autoconf 2.53. Remove stuff that was only
5434         needed for httpd or wsdl code. Remove glib1 support. Bump version
5435         to 2.0.
5436
5437         * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
5438         in ${includedir}/soup-2.0
5439         
5440         * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
5441         SOAP-specific stuff, Windows support, and other things that
5442         weren't being maintained.
5443
5444         * soup-config.in, soupConf.sh: Kill these. We only support
5445         pkg-config now.