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