9d3dcde1da88cb0f8bf87fd01399f7579e112aa1
[platform/upstream/libsoup.git] / ChangeLog
1 2003-11-17  Rodrigo Moya <rodrigo@ximian.com>
2
3         * libsoup/soup-soap-message.[ch]: new class to make it easier to
4         build SOAP messages.
5
6         * libsoup/Makefile.am: added new files.
7
8         * configure.in: increased version number.
9
10 2003-10-24  Joe Shaw  <joe@ximian.com>
11
12         * libsoup/soup-address.c (update_address_from_entry): Call
13         soup_dns_entry_get_hostent() on the SoupAddress passed in, not the
14         one in addr->priv->lookup.  Fixes a crash on synchronous DNS
15         lookups.
16
17         * libsoup/soup-server.c (soup_server_new): We need to ref the
18         address we're binding to, because soup_socket_get_local_address()
19         doesn't ref for us.
20
21 2003-10-23  Dan Winship  <danw@ximian.com>
22
23         * libsoup/soup-socket.c (init): Initialize flags to default
24         values.
25
26 2003-09-23  Dan Winship  <danw@ximian.com>
27
28         * libsoup/soup-gnutls.c (SoupGNUTLSCred): Remove refcounting, but
29         note whether or not the CA file has been loaded.
30         (SoupGNUTLSChannel): add a "hostname" field.
31         (verify_certificate): Remove the comment about not being able to
32         verify the hostname because of soup problems. Now it's because of
33         GNUTLS problems instead.
34         (soup_ssl_wrap_iochannel): Renamed from soup_ssl_get_iochannel,
35         and takes a hostname and a creds argument now.
36         (soup_ssl_get_client_credentials,
37         soup_ssl_get_server_credentials): Return client/server credentials
38         structures.
39         (soup_ssl_free_client_credentials,
40         soup_ssl_free_server_credentials): and free them.
41
42         * libsoup/soup-session.c (class_init, set_property, get_property):
43         add ssl_ca_file property
44         (get_host_for_message): when returning an SSL host for the first
45         time, create a client credentials structure for the session.
46         (run_queue): Pass the ssl creds to the new connection. Also fix an
47         unrelated bug that caused infinite loops on "bad hostname".
48
49         * libsoup/soup-server.c: Use GObject properties, including
50         ssl_cert_file and ssl_key_file properties.
51         (soup_server_new): Remove "protocol" argument; if the cert file
52         and key file properties were set, create a server credential
53         structure from them and pass that to soup_socket_server_new.
54
55         * libsoup/soup-connection.c (SoupConnectionPrivate): Rename
56         dest_uri to origin_uri to match RFC 2616 terminology. Add an
57         "ssl_creds" field.
58         (class_init, set_property, get_property): add SSL_CREDS property
59         (soup_connection_connect_async, soup_connection_connect_sync):
60         Pass ssl_creds to soup_socket_client_new calls.
61
62         * libsoup/soup-socket.c: Use GObject properties, including an
63         ssl_creds property
64         (soup_socket_set_flags): Gone (replaced with boolean properties)
65         (soup_socket_new): Make this take a list of properties
66         (listen_watch): copy ssl creds from listener to new socket
67         (soup_socket_start_ssl): Pass remote hostname and socket creds
68         structure to soup_ssl_wrap_iochannel.
69         (soup_socket_client_new_async, soup_socket_client_new_sync,
70         soup_socket_server_new): Replace the SSL boolean with an ssl_creds
71         structure.
72
73         * libsoup/soup-misc.c (soup_set_ssl_ca_file,
74         soup_set_ssl_cert_files, soup_get_ssl_ca_file,
75         soup_get_ssl_cert_files): Gone. SSL state is now per-session or
76         per-server.
77
78         * tests/get.c: add a "-c CAfile" argument, for loading a CA
79         certificate file to validate https connections against
80
81         * tests/simple-httpd.c: Add "-c certfile" and "-k keyfile"
82         arguments for loading an SSL server certificate. Only start an SSL
83         server if those arguments were used.
84
85         * tests/test-cert.pem: 
86         * tests/test-key.pem: SSL certificate for testing simple-httpd
87
88         * tests/revserver.c: Update for API changes
89         * tests/simple-proxy.c: Likewise
90
91 2003-09-22  Dan Winship  <danw@ximian.com>
92
93         * libsoup/soup-message-io.c: Move RESPONSE_BLOCK_SIZE #define here
94         from soup-private.h
95
96         * libsoup/soup-misc.c (soup_load_config, etc): Remove all this.
97         (soup_set_security_policy, soup_get_security_policy): Remove,
98         since the GNUTLS backend doesn't actually implement it.
99         (soup_set_ssl_ca_dir, soup_get_ssl_ca_dir): Likewise
100
101         * libsoup/soup-misc.h: sync to soup-misc.c. Don't #include extra
102         stuff.
103
104         * libsoup/soup-types.h (SOUP_MAKE_TYPE): Move this here from
105         soup-private.h
106
107         * libsoup/soup-ssl.h: Merge soup_ssl_get_iochannel and
108         soup_ssl_get_server_iochannel into a single function that takes a
109         SoupSSLType.
110
111         * libsoup/soup-gnutls.c: Remove soup_get_ssl_ca_dir() reference.
112         (soup_ssl_get_iochannel): Renamed from soup_gnutls_get_iochannel.
113         (soup_gnutls_set_security_policy): Gone
114
115         * libsoup/soup-gnutls.h
116         * libsoup/soup-ssl.c: Gone; soup-ssl.h is the #include file for
117         soup-gnutls.c now
118
119         * libsoup/soup-socket.c: Move soup_sockaddr_max
120         #define here from soup-private.h
121         (soup_socket_start_ssl): Update for new soup_ssl_get_iochannel
122         prototype.
123
124         * libsoup/soup-private.h: Gone
125         
126         * libsoup/soup-address.c: Fix #includes for soup-private.h and
127         soup-misc.h changes
128         * libsoup/soup-auth-digest.c: Likewise
129         * libsoup/soup-auth.c: Likewise
130         * libsoup/soup-connection-ntlm.c: Likewise
131         * libsoup/soup-connection.c: Likewise
132         * libsoup/soup-dns.c: Likewise
133         * libsoup/soup-gnutls.c: Likewise
134         * libsoup/soup-headers.c: Likewise
135         * libsoup/soup-message-client-io.c: Likewise
136         * libsoup/soup-message-handlers.c: Likewise
137         * libsoup/soup-message-io.c: Likewise
138         * libsoup/soup-message-server-io.c: Likewise
139         * libsoup/soup-message.c: Likewise
140         * libsoup/soup-server-message.c: Likewise
141         * libsoup/soup-server.c: Likewise
142         * libsoup/soup-session.c: Likewise
143         * libsoup/soup-socket.c: Likewise
144         * tests/auth-test.c: Likewise
145
146 2003-09-19  Dan Winship  <danw@ximian.com>
147
148         * libsoup/soup-address.c (update_address_from_entry): free the
149         hostent.
150
151         * libsoup/soup-connection-ntlm.c (ntlm_authorize_pre): Don't leak
152         the domain
153
154         * libsoup/soup-gnutls.c (soup_gnutls_get_iochannel): Add some more
155         iochannel initialization. Not sure how this worked before...
156
157         * libsoup/soup-message.c (soup_message_cleanup_response): Renamed
158         from soup_message_prepare (and a few things removed).
159
160         * libsoup/soup-message-client-io.c (soup_message_send_request):
161         s/soup_message_prepare/soup_message_cleanup_response/
162
163         * libsoup/soup-message-io.c (io_read): Replace the final "\r\n"
164         with "\0" on the headers before passing them to the parse
165         function.
166         (io_read): Call soup_message_cleanup_response after returning an
167         informational response so the data doesn't leak.
168
169         * libsoup/soup-headers.c (soup_headers_parse): Update for
170         soup-message-io.c:io_read change
171
172         * libsoup/soup-server.c (soup_server_new,
173         soup_server_new_with_host): Don't leak the SoupAddress.
174
175         * libsoup/soup-session.c (class_init): Make PROP_PROXY_URI not
176         CONSTRUCT_ONLY.
177         (set_property): If the proxy uri changes, call
178         soup_session_abort() and cleanup_hosts().
179         (request_finished, final_finished): Fix a bug when requeuing
180         messages.
181
182         * tests/libsoup.supp: valgrind suppression file for soup tests
183
184         * tests/Makefile.am (EXTRA_DIST): dist it.
185         (noinst_PROGRAMS): move the former check_PROGRAMS to
186         noinst_PROGRAMS instead.
187
188 2003-09-18  Dan Winship  <danw@ximian.com>
189
190         * libsoup/soup-message.c: Add wrote_informational and
191         got_informational signals.
192
193         * libsoup/soup-message-client-io.c (get_request_headers): Set the
194         EXPECT_CONTINUE flag on the message if that header is set.
195
196         * libsoup/soup-message-server-io.c (parse_request_headers):
197         Likewise
198
199         * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
200         when blocking on an expect-continue. Emit wrote_informational
201         instead of wrote_headers in the 1xx case.
202         (io_read): Set read_state to BLOCKING, not NOT_STARTED after
203         reading a 100 Continue response. Emit got_informational instead of
204         got_headers in the 1xx case.
205
206         * libsoup/soup-session.c (soup_session_send_message): Reorder
207         things to deal with the fact that the message could finish right
208         away if there is a connection available and the server is very
209         close.
210
211         * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
212         SOUP_STATUS_CLASS_TRANSPORT_ERROR.
213
214 2003-09-17  Dan Winship  <danw@ximian.com>
215
216         * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
217         (one that pruned too little, one that pruned too much).
218         (queue_message): When requeuing, don't run the queue;
219         final_finished will take care of that later.
220         (soup_session_abort): New, to cancel all pending requests.
221
222         * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
223         the socket while waiting for the address to resolve
224
225 2003-09-17  Dan Winship  <danw@ximian.com>
226
227         * libsoup/soup-connection.c (soup_connection_new): Replaces the
228         three previous soup_connection_new* functions and uses gobject
229         properties to set the destination and proxy uris.
230         (class_init): set up two more signals, authenticate and
231         reauthenticate.
232         (soup_connection_send_request): virtualize
233         (send_request): Default implementation
234
235         * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
236         also handles NTLM authentication. Includes all of the NTLM code
237         formerly in soup-auth-ntlm.c.
238
239         * libsoup/soup-auth-ntlm.[ch]: Gone.
240
241         * libsoup/soup-auth.c: Remove NTLM refs
242
243         * libsoup/soup-session.c (class_init): Add gobject properties for
244         proxy, max_conns, use_ntlm. Change the "authenticate" and
245         "reauthenticate" signal prototypes to not pass a SoupAuth (so they
246         can be used for authenticating SoupConnectionNTLM as well, which
247         doesn't use a SoupAuth).
248         (soup_session_new): Renamed from soup_session_new_default.
249         (soup_session_new_with_options): Replaces
250         soup_session_new_with_proxy and soup_session_new_full. Takes
251         gobject properties.
252         (run_queue): Create a new connection of type SoupConnection or
253         SoupConnectionNTLM depending on our "use_ntlm" property. Connect
254         to its authenticate and reauthenticate signals.
255         (connection_authenticate, connection_reauthenticate): proxy these
256         signals.
257
258         * libsoup/soup-address.c (update_address_from_entry): Fix a
259         crasher when failing to resolve the address.
260
261         * libsoup/soup-dns.c (check_hostent): Fix some "how was this
262         working before" bugs.
263
264         * libsoup/soup-message-client-io.c (soup_message_send_request):
265         call soup_message_prepare() to clean up the existing response
266         state.
267
268         * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
269         when processing an OK EOF.
270
271         * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
272         these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
273
274         * tests/auth-test.c (authenticate, reauthenticate): Update for new
275         prototypes.
276         (main): Use soup_session_new.
277         * tests/get.c (main): Likewise.
278         * tests/simple-proxy.c (main): Likewise.
279
280 2003-09-10  Dan Winship  <danw@ximian.com>
281
282         * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
283         signals.
284         (invalidate_auth): Remove the call to soup_auth_invalidate.
285         (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
286         contain authentication, then emit "authenticate" or
287         "reauthenticate" (depending on whether or not this is the first
288         time we've asked for a password for this auth).
289         (update_auth_internal): If the server rejects our
290         username/password, don't bail out immediately. Try doing a
291         "reauthenticate" first.
292
293         * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
294
295         * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
296         "pref" arg.
297         (soup_auth_invalidate): Remove this; it doesn't actually do
298         anything useful for us.
299
300         * libsoup/soup-auth-basic.c (invalidate): Remove
301         * libsoup/soup-auth-digest.c: (invalidate): Remove
302         * libsoup/soup-auth-ntlm.c: (invalidate): Remove
303
304         * libsoup/soup-uri.c: Remove all references to "authmech".
305         (soup_uri_set_auth): Remove this too.
306
307         * tests/auth-test.c: Update to use the "authenticate" and
308         "reauthenticate" signals instead of encoding usernames and
309         passwords in the URIs. Add a few more test cases.
310
311 2003-09-10  Dan Winship  <danw@ximian.com>
312
313         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
314         "status" field from here, since it's mostly used by SoupSession,
315         which shouldn't need access to SoupMessagePrivate.
316
317         * libsoup/soup-message.h (SoupMessage): Move it here.
318         (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
319         (soup_message_set_uri): also moved from soup-message-private.h
320
321         * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
322
323         * libsoup/soup-message-handlers.c:
324         s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
325
326         * libsoup/soup-message-io.c (soup_message_io_client,
327         soup_message_io_server, soup_message_io_unpause): Don't set up an
328         idle handler, just jump right in to reading/writing; if this is a
329         synchronous socket, then the caller wants to block, and if it's
330         not, then we'll quickly get an EAGAIN anyway.
331
332         * libsoup/soup-session.c: (queue_message): Likewise.
333         (*) Update for SoupMessageStatus move and remove
334         soup-message-private.h include.
335
336         * libsoup/soup-server-message.c: Remove soup-message-private.h
337         include.
338
339         * libsoup/soup-server.c: Likewise.
340
341         * libsoup/soup-connection.c (soup_connection_is_connected,
342         soup_connection_is_new): Remove these, since they weren't being
343         used.
344
345         * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
346         avoid namespace pollution.
347
348         * libsoup/soup-auth-digest.c: Update for that.
349         * libsoup/soup-server-auth.c: Likewise
350
351         * tests/auth-test.c: Remove soup-message-private.h include
352
353 2003-09-09  Dan Winship  <danw@ximian.com>
354
355         Beginnings of improved synchronous API support
356
357         * libsoup/soup-dns.c: Simplify this by making it not automatically
358         return the result: force the caller to poll. (This isn't really a
359         performance issue: the results should come back quickly anyway.)
360         Also, make the cache thread-safe.
361         (soup_dns_entry_from_name): Was soup_gethostbyname
362         (soup_dns_entry_from_addr): Was soup_gethostbyaddr
363         (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
364         (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
365         blocks if it's not resolved yet).
366
367         * libsoup/soup-address.c: Update for soup-dns changes.
368         (soup_address_new): Don't automatically start resolving the
369         hostname now, since we don't know if the caller is going to want
370         it resolved synchronously or asynchronously.
371         (soup_address_resolve_async): Renamed from soup_address_resolve.
372         (soup_address_resolve_sync): New routine to do blocking
373         synchronous DNS.
374
375         * libsoup/soup-socket.c (soup_socket_connect): Now returns a
376         status value directly when connecting synchronously.
377         (soup_socket_client_new_async, soup_socket_client_new_sync):
378         Separate async/sync client socket functions.
379         (soup_socket_get_iochannel): Made static since it was not used
380         outside soup-socket.
381
382         * libsoup/soup-connection.c (soup_connection_new,
383         soup_connection_new_proxy, soup_connection_new_tunnel): Just set
384         up the data, don't actually start connecting.
385         (soup_connection_connect_async, soup_connection_connect_sync): New
386         async and sync SoupConnection connecting routines.
387         (soup_connection_get_socket): Remove this since it wasn't being
388         used.
389
390         * libsoup/soup-session.c (final_finished): Run the queue since a
391         connection is now freed up.
392         (run_queue): Update for soup_connection_new* changes.
393
394         * libsoup/soup-misc.c (soup_substring_index): Remove, since it
395         wasn't being used any more.
396
397         * libsoup/soup-private.h: Remove some prototypes for functions
398         that no longer exist.
399
400         * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
401         (copies the protocol, host, and port of a SoupUri).
402
403         * tests/auth-test.c:
404         * tests/get.c:
405         * tests/simple-proxy.c: belatedly update for soup-session change
406
407         * tests/revserver.c: Handle each new connection in its own thread,
408         using synchronous SoupSocket calls.
409
410 2003-09-05  Dan Winship  <danw@ximian.com>
411
412         * libsoup/soup-session.c: Move a bunch of logic here from
413         soup-context. Now the session keeps track of hosts (instead of
414         having a global soup_hosts hash) and their connections.
415         (soup_session_new_with_proxy, soup_session_new_full): New session
416         constructors to specify a proxy or a proxy and connection limits
417         (send_request): Add Authorization and Proxy-Authorization headers
418         before sending off the request.
419         (soup_session_queue_message, et al): Improve the way this works.
420         There's no need to use timeouts to wait for connections to become
421         free; we *know* when they become free.
422
423         * libsoup/soup-private.h: Remove SoupHost and some other
424         no-longer-used stuff.
425
426         * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
427         soup_set_connection_limit, soup_set_connection_limit): Gone. These
428         are all per-session now.
429
430         * libsoup/soup-message.c: Remove all SoupContext references
431         (mostly replaced with SoupUri references)
432         (cleanup_message): priv->connect_tag and priv->connection are gone
433         now, so this was just soup_message_io_cancel(). So remove
434         cleanup_message and replace it with that everywhere.
435         (soup_message_disconnect): Gone.
436         (soup_message_set_uri): Replaces soup_message_set_context.
437         (soup_message_set_connection, soup_message_get_connection): Gone
438
439         * libsoup/soup-message-server-io.c (parse_request_headers):
440         s/soup_message_set_context/soup_message_set_uri/
441
442         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
443         connect_tag, context, and connection.
444
445         * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
446
447         * libsoup/soup-context.c: Gone
448
449         * tests/auth-test.c (identify_auth): update for session/context
450         changes
451
452 2003-09-03  Dan Winship  <danw@ximian.com>
453
454         * libsoup/soup-status.h: Renamed from soup-error.h, with types
455         and defines renamed accordingly.
456
457         * libsoup/soup-message.h (SoupMessage): Rename errorcode to
458         status_code and errorphrase to reason_phrase. Remove errorclass.
459         (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
460         as being either "errors" or "not errors", so its semantics are
461         guaranteed to be wrong sometimes.
462
463         * libsoup/soup-message.c (soup_message_set_status,
464         soup_message_set_status_full): Renamed
465
466         * libsoup/soup-message-handlers.c
467         (soup_message_add_status_code_handler,
468         soup_message_add_status_class_handler): Rename.
469
470         * libsoup/soup-session.c (soup_session_send_message): Make this
471         return a status code rather than a status class.
472
473         * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
474         unrelated unused fields (retries, callback, user_data).
475
476         * ...: Updates
477
478 2003-09-02  Dan Winship  <danw@ximian.com>
479
480         * libsoup/soup-session.c: First draft at the new object to
481         maintain formerly-global state. (Not yet complete; still need to
482         get rid of SoupContext).
483
484         * libsoup/soup-message-queue.c: Data structure used by SoupSession
485
486         * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
487         some bits went into soup-connection.
488
489         * libsoup/soup-connection.c (soup_connection_send_request): New,
490         to send a request on a connection. The connection updates its
491         internal state and then hands off to soup_message_send_request.
492         (request_done): Callback set up by soup_connection_send_request.
493         Marks the connection as no-longer-in-use, and disconnects it if
494         the message says to.
495         (soup_connection_set_in_use, soup_connection_mark_old): No longer
496         needed; the connection takes care of this itself now.
497         (soup_connection_new_proxy): New, to create a new connection that
498         is explicitly marked as being through an HTTP proxy.
499         (soup_connection_new_tunnel): New, to create a new HTTPS
500         connection through a proxy. (Includes the code to send the
501         CONNECT.)
502
503         * libsoup/soup-context.c (try_existing_connections): Don't need to
504         call soup_connection_set_in_use.
505         (try_create_connection): Use soup_connection_new,
506         soup_connection_new_proxy, or soup_connection_new_tunnel as
507         appropriate.
508
509         * libsoup/soup-message.c (soup_message_prepare): Replaces
510         queue_message.
511         (soup_message_queue, soup_message_requeue, soup_message_prepare):
512         Gone. This must be done via a SoupSession now.
513         (soup_message_set_connection): don't need to mark in_use/not
514         in_use. Also, msg->priv->socket is gone now.
515         (soup_message_get_socket): Gone.
516
517         * libsoup/soup-message-handlers.c (soup_message_run_handlers):
518         Remove references to global handlers.
519         (redirect_handler, authorize_handler): Moved to soup-session.c.
520
521         * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
522         session to shut down now.
523
524         * libsoup/soup.h: add soup-session.h
525
526         * libsoup/Makefile.am: updates
527
528         * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
529         SoupSession.
530
531 2003-08-29  Dan Winship  <danw@ximian.com>
532
533         * libsoup/soup-message-io.c: Major rewrite. There is now only a
534         single IO state object (instead of one for reading and one for
535         writing), and the IO code handles switching back and forth between
536         reading and writing as appropriate (including handling the extra
537         switches needed for "Expect: 100-continue").
538         (soup_message_io_client, soup_message_io_server): The new entry
539         points.
540         (soup_message_io_cancel): If the caller cancels the IO when we
541         were expecting to read more data, disconnect the socket.
542
543         * libsoup/soup-message.h (SoupMessageFlags): add
544         SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
545         do the special expect-continue handling.
546
547         * libsoup/soup-message.c: Move all the signal stuff here. Remove
548         the "done_reading" and "done_writing" signals and replace them
549         with a single "finished" signal. (A single signal. Say that 10
550         times fast!)
551         (soup_message_got_headers, etc): Functions to emit signals.
552         (got_headers, got_chunk, got_body): Default signal methods that
553         call soup_message_run_handlers.
554         (finished): Default signal method that replaces
555         soup_message_issue_callback.
556         ([various]): s/soup_message_issue_callback/soup_message_finished/
557         (soup_message_requeue): There's no soup_message_set_read_callbacks
558         any more, so if the caller requeues while it's still reading, just
559         cancel the read.
560         (soup_message_add_chunk, soup_message_add_final_chunk,
561         soup_message_pop_chunk): Moved here from soup-server-message,
562         although we don't actually quite support using chunked encoding
563         for requests yet.
564
565         * libsoup/soup-server-message.c (soup_server_message_new): No
566         longer takes a socket argument.
567         (soup_server_message_add_chunk, soup_server_message_get_chunk):
568         Moved into SoupMessage.
569
570         * libsoup/soup-message-handlers.c (global_handlers): Make these
571         POST_BODY rather than PRE_BODY, so they won't mess up the IO
572         channel when the requeue the message.
573         (soup_message_run_handlers): Don't need to issue the message
574         callback from here any more.
575         (authorize_handler): Just leave the error as 401 or 407 (see
576         soup-error.h change)
577
578         * libsoup/soup-message-client-io.c (soup_message_send_request):
579         Replaces soup_message_write_request and
580         soup_message_read_response.
581
582         * libsoup/soup-message-server-io.c: Parallel to
583         soup-message-client-io.c, this defines the server-side header
584         handling.
585         (soup_message_read_request): Its entry point.
586
587         * libsoup/soup-server.c: Lots of code moved into
588         soup-message-server-io.c. Update for other changes.
589
590         * libsoup/soup-queue.c: Update for changes
591
592         * libsoup/soup-socket.c (read_from_network, soup_socket_write):
593         Don't call soup_socket_disconnect() on an error, just return
594         SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
595         signals that will mess up the caller of the read/write function.
596
597         * libsoup/soup-connection.c (soup_connection_disconnect): When
598         disconnecting the socket, disconnect from its signals first to
599         prevent bad reentrancy.
600
601         * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
602         SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
603         anything that SOUP_ERROR_UNATHORIZED and
604         SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
605         "transport" errors actually are transport-related.)
606
607         * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
608
609         * tests/simple-proxy.c: Complicate this a bunch. In particular,
610         use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
611         pass the data back to the client in chunked format.
612
613 2003-08-27  Dan Winship  <danw@ximian.com>
614
615         * libsoup/soup-types.h: New header with typedefs, to avoid
616         #include loops among other headers.
617
618         * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
619
620         * libsoup/*.[ch], tests/*.c: Update for soup-types.h
621         
622 2003-08-26  Dan Winship  <danw@ximian.com>
623
624         * libsoup/soup-message-client-io.c (soup_message_write_request,
625         soup_message_read_response): Higher-than-soup-message-io-level
626         functions to do client-side IO. (Code that used to be in
627         soup-queue.c)
628         (get_request_header_cb): Fix a bug in the generation of the Host:
629         header; need to include the port number if it's not the default.
630
631         * libsoup/soup-message-io.c (soup_message_write,
632         soup_message_write_simple): Take separate user_datas for the get_*
633         callbacks and the done callbacks.
634
635         * libsoup/soup-queue.c: Update to use soup_message_write_request
636         and soup_message_read_response.
637
638         * libsoup/soup-connection.c (soup_connection_new): Change the
639         prototype to take a SoupUri and a callback.
640
641         * libsoup/soup-context.c (try_create_connection,
642         soup_context_connect_cb): Update for soup_connection_new change.
643
644         * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
645         for soup_message_write changes
646
647         * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
648         function
649
650 2003-08-26  Dan Winship  <danw@ximian.com>
651
652         * libsoup/soup-message-private.h: Define SoupMessage signal stuff
653         (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
654         WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
655
656         * libsoup/soup-message.c (class_init): set up signals
657         (requeue_read_finished): Update for changes.
658
659         * libsoup/soup-message-io.c (soup_message_read): Split out
660         parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
661         arg to say where to store the message body. Set up
662         read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
663         signal handlers.
664         (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
665         (read_body_chunk): emit READ_CHUNK.
666         (issue_final_callback): Set r->body. emit READ_BODY.
667         (failed_read): emit READ_ERROR.
668         (soup_message_read_set_callbacks): Disconnect old signal handlers,
669         connect new ones.
670         (soup_message_read_cancel): Disconnect signal handlers.
671         (soup_message_write, soup_message_write_simple): Set up
672         wrote_body_cb and error_cb as signal handlers.
673         (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
674         nothing currently ever listens for them. emit WROTE_BODY when
675         done.
676         (failed_write): emit WRITE_ERROR
677
678         * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
679         soup_queue_read_headers_cb): Split this into two unequal chunks.
680         (read_header_cb only runs the pre-body handlers).
681         (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
682         prototypes.
683         (soup_queue_write_done_cb): Update call to soup_message_read
684
685         * libsoup/soup-server.c (parse_headers_cb): Renamed from
686         read_headers_cb
687         (read_done_cb): Update prototype
688         (start_request): Update soup_message_read call.
689
690 2003-08-25  Dan Winship  <danw@ximian.com>
691
692         * libsoup/soup-message-io.c (soup_message_read,
693         soup_message_write, soup_message_write_simple): Add a "user_data"
694         arg, pass it to the callbacks.
695
696         * libsoup/soup-message.c (soup_message_requeue,
697         requeue_read_finished, requeue_read_error): Update for that
698
699         * libsoup/soup-queue.c: Likewise
700
701         * libsoup/soup-server.c: Likewise
702
703 2003-08-25  Dan Winship  <danw@ximian.com>
704
705         * libsoup/soup-message.c (soup_message_new): Take a uri string
706         instead of a context. Also, swap the args (so the method comes
707         before the URI, just like in the protocol).
708         (soup_message_new_from_uri): Like soup_messgae_new, but takes a
709         SoupUri instead of a string
710         (soup_message_set_request, soup_message_set_response): Replace
711         soup_message_new_full.
712         (cleanup_message): Was soup_message_cleanup, but is static now.
713         (queue_message): Do the pre-queuing message cleanup here instead
714         of in soup_queue_message.
715         (soup_message_queue): Set the callback and user_data, then call
716         queue_message.
717         (requeue_read_error, requeue_read_finished, soup_message_requeue):
718         Use queue_message
719         (soup_message_get_uri): Replaces soup_message_get_context.
720
721         * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
722         part of SoupMessagePrivate now)
723
724         * libsoup/soup-context.c: #include soup-message-private
725         (soup_context_from_uri): constify the uri arg.
726
727         * libsoup/soup-queue.c: Various context/uri fixes
728         (proxy_https_connect): Use soup_message_new_from_uri.
729         (soup_queue_message): Drastically simplified since most of the
730         work is in soup-messsage.c:queue_message() now
731
732         * libsoup/soup-auth-digest.c (compute_response,
733         get_authorization): Use soup_message_get_uri.
734
735         * libsoup/soup-server-auth.c (parse_digest): Likewise
736
737         * libsoup/soup-server.c (call_handler): Likewise
738
739         * tests/simple-httpd.c (server_callback): Likewise.
740
741         * tests/simple-proxy.c (server_callback): Likewise
742
743         * tests/get.c (got_url): Likewise.
744         (get_url): Update soup_message_new usage.
745
746         * tests/auth-test.c: #include soup-message-private. Update for
747         context changes and soup_message_new change.
748
749 2003-08-22  Dan Winship  <danw@ximian.com>
750
751         * libsoup/soup-message-private.h: New file containing
752         SoupMessagePrivate and some other soup-message-internal
753         types/functions. Also includes the new, expanded SoupMessageStatus
754         enum.
755
756         * libsoup/soup-message-io.c: Replaces what used to be in
757         soup-transfer, but now all the interfaces take SoupMessages
758         instead of SoupReader/SoupWriter and deal with maintaining
759         msg->priv->{read,write}_state themselves. Fixes up all the
760         refcounting madness.
761
762         * libsoup/soup-message-handlers.c: Move the handler code here,
763         mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
764         to make the distinction from SoupHandlerKind clearer.)
765
766         * libsoup/soup-message.c: Update for soup-message-io and new
767         SoupMessageStatus values. Remove handler code.
768         (soup_message_cleanup): Remove the hack to try to preserve the
769         connection if the message gets cleaned up before it finishes
770         reading. soup_message_requeue handles this in the requeuing case,
771         and there's no especially compelling reason to bother doing it in
772         any other case. (And the soup-message-io api doesn't support
773         having a read operation that's not connected to any message.)
774
775         * libsoup/soup-private.h: remove SoupMessagePrivate
776
777         * libsoup/soup-queue.c: Update for soup-message-io and new
778         SoupMessageStatus values.
779
780         * libsoup/soup-server-message.c: Likewise
781
782         * libsoup/soup-server.c: Likewise
783
784         * libsoup/soup-transfer.c: Gone (yay)
785
786         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
787
788 2003-08-20  Dan Winship  <danw@ximian.com>
789
790         * libsoup/soup-message.c: Make this a GObject. (Note that since
791         SoupMessage was not refcounted before, it's not really refcounted
792         now either. TBF)
793         (soup_message_free): Gone, replaced by g_object_unref
794         (soup_message_copy, soup_message_foreach_remove_header): Remove
795         these, since neither was currently functional.
796         (soup_message_is_keepalive): New utility function to look at
797         HTTP version and request/response headers to decide if a message
798         indicates the connection should be kept alive.
799         (soup_message_set_connection, soup_message_get_connection): New
800         (soup_message_get_socket): New
801
802         * libsoup/soup-server-message.c: Make this a subclass of
803         SoupMessage.
804         (soup_server_message_new): Now takes a SoupServer and SoupSocket
805         (soup_server_message_get_server): New
806         (soup_server_message_set_encoding,
807         soup_server_message_get_encoding): Get/set whether the message
808         should be sent with content-length or chunked encoding
809         (soup_server_message_is_started, soup_server_message_is_finished):
810         Private member accessors.
811         (soup_server_message_add_chunk): Renamed from add_data
812         (soup_server_message_get_chunk): Pops a chunk from the list.
813         (soup_server_message_get_source): Gone
814
815         * libsoup/soup-server.c: Update for SoupServerMessage changes.
816         (error_cb, write_done_cb): All the cleanup stuff that used to be
817         here happens automatically by unreffing the message now.
818         (get_response_header): Remove some erroneous leftover CGI stuff
819         (issue_bad_request): add "Connection: close" to the response.
820         (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
821         with no Host header as per RFC 2616.
822
823         * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
824         (soup_connection_set_in_use): Let the caller set the connection to
825         "not in use" even after the socket has been disconnected.
826
827         * libsoup/soup-context.c: Use soup_message_get_connection
828
829         * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
830         check on request length, since it was rejecting
831         "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
832
833         * libsoup/soup-queue.c: Use soup_message_get_connection and
834         soup_message_get_socket.
835         (soup_queue_read_done_cb): Use soup_message_is_keepalive
836         (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
837         soup_connection_start_ssl
838
839         * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
840         handlers if the socket hasn't been disconnected yet.
841
842         * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
843         reader_read): Fix these so that reader_read will exit properly if
844         the read is cancelled.
845
846         * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
847
848         * tests/simple-httpd.c (server_callback): set the message to
849         content-length encoding.
850         * tests/simple-proxy.c (server_callback): Likewise
851
852 2003-08-19  Dan Winship  <danw@ximian.com>
853
854         * libsoup/soup-socket.c (soup_socket_read,
855         soup_socket_read_until, soup_socket_write): New API for doing
856         socket IO. Works both synchronously and asynchronously, and
857         buffers data to prevent the "100 Continue" problem.
858         (soup_socket_set_flag): Replaces formerly-private
859         soup_set_sockopts. (primarily to let the caller turn off
860         SOUP_SOCKET_FLAG_NONBLOCKING).
861
862         * libsoup/soup-transfer.c (soup_transfer_read,
863         soup_transfer_write, soup_transfer_write_simple): Take a
864         SoupSocket instead of a GIOChannel. Use the new socket IO api.
865         Changed the prototypes of some of the callbacks to be less
866         hackish.
867
868         * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
869         soup_connection_get_iochannel.
870
871         * libsoup/soup-message.c: Fix up for soup-transfer changes
872
873         * libsoup/soup-queue.c: Likewise
874
875         * libsoup/soup-server.c: Likewise
876
877         * tests/revserver.c: A slightly more complicated replacement for
878         timeserver. (Does both reads and writes)
879
880 2003-08-19  Dan Winship  <danw@ximian.com>
881
882         * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
883         configure it, and no one has complained, and it looks like the
884         SOCKS5 auth code doesn't actually work anyway...
885
886         * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
887
888         * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
889         SOUP_PROTOCOL_SOCKS5
890
891         * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
892
893         * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
894         soup-socks.[ch]
895
896 2003-08-19  Dan Winship  <danw@ximian.com>
897
898         * libsoup/soup-server.c: Make this a GObject. Remove
899         SoupServerMessage code (to soup-server-message.c). Remove CGI
900         server code (for now?)
901         (soup_server_add_handler, soup_server_remove_handler): Rename
902         (from register/unregister) to make it clearer what they do.
903
904         * libsoup/soup-server-message.c: Moved out of soup-server.c
905
906         * libsoup/soup-private.h: Remove SoupServer def
907
908         * libsoup/Makefile.am (libsoupinclude_HEADERS,
909         libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
910
911         * tests/simple-httpd.c: 
912         * tests/simple-proxy.c: Update for SoupServer changes
913
914 2003-08-18  Dan Winship  <danw@ximian.com>
915
916         * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
917         a struct sockaddr again (like it used to be). In particular, add
918         back the "port" field. Add a bunch of macros to try (and fail) to
919         simplify some of the code.
920         (soup_address_new): Now returns a SoupAddress directly rather than
921         a random handle, and the caller can just use g_object_unref to
922         cancel the lookup. Also, the callback now uses a
923         SoupKnownErrorCode rather than a special-purpose address-lookup
924         error code.
925         (soup_address_new_cancel): No longer needed.
926         (soup_address_new_sync): Removed
927         (soup_address_new_any): Replaces soup_address_ipv4_any and
928         soup_address_ipv6_any.
929         (soup_address_get_name, etc): Gone. Use soup_address_resolve()
930         now.
931         (soup_address_get_physical): Renamed from
932         soup_address_get_canonical_name.
933         (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
934
935         * libsoup/soup-socket.c: Update for SoupAddress changes and make
936         similar changes here.
937         (soup_socket_new): Just creates a generic SoupSocket now.
938         (soup_socket_connect): Client setup
939         (soup_socket_listen): Server setup. Now also sets up an iochannel
940         listening for connects and emits a "new_connection" signal as they
941         come in.
942         (soup_socket_start_ssl): Turns on SSL.
943         (soup_socket_client_new, soup_socket_server_new): Utility
944         functions that wrap the above.
945         (soup_socket_new_cancel, soup_socket_new_sync): Gone
946         (soup_socket_server_accept, soup_socket_server_try_accept): No
947         longer needed.
948         (soup_socket_get_iochannel): No longer adds a ref when returning
949         the iochannel. Also, we set it to "close_on_unref" so that if a
950         caller adds a ref to it, the connection will actually remain open
951         even after the SoupSocket is destroyed.
952         (soup_socket_get_local_address, soup_socket_get_remote_address):
953         Let the caller get both of these.
954
955         * libsoup/soup-connection.c: Don't keep a private copy of the
956         socket's iochannel.
957         (soup_connection_new): Don't need to set socket options here.
958         SoupSocket does it.
959         (soup_connection_start_ssl): Just call soup_socket_start_ssl.
960         (soup_connection_get_iochannel): Just return the socket's
961         iochannel (and don't ref it)
962
963         * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
964         SOUP_ERROR_CANT_RESOLVE_PROXY
965
966         * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
967         Remove the "FIXME add a CANT_RESOLVE error" and return
968         SOUP_ERROR_CANT_RESOLVE instead.
969
970         * libsoup/soup-server.c: Update for socket/address changes. Don't
971         poke into SoupSocket's private fields.
972         (soup_server_run_async): Just connect to the socket's
973         "new_connection" signal.
974
975         * libsoup/soup-context.c (try_create_connection,
976         soup_context_connect_cb): Update for socket changes. Replace
977         SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
978
979         * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
980         to connect to a signal handler and connect another function to
981         clean up the first signal handler after its first invocation.
982         (Lets us use signals to replace one-off callbacks.)
983
984         * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
985         actually private now.
986         (struct _SoupServer): Remove accept_tag.
987
988         * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
989         Don't unref the iochannel.
990         (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
991
992         * libsoup/soup-socks.c: Update for socket/address changes
993
994         * tests/simple-httpd.c (main):
995         s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
996         * tests/simple-proxy.c (main): Likewise
997
998         * tests/timeserver.c: Update for SoupSocket's "new_connection"
999         signal, and for SoupAddress changes.
1000
1001 2003-08-14  Dan Winship  <danw@ximian.com>
1002
1003         * libsoup/soup-connection.c: New, split out from soup-context and
1004         made into a GObject.
1005         (soup_connection_disconnect): Disconnects the connection and emits
1006         a signal. (Replaces the old "keep_alive" flag.)
1007         (soup_connection_is_connected): Checks if the connection is still
1008         connected
1009         (connection_died): Just disconnect, rather than freeing the
1010         connection. This way if anyone else is still referencing it they
1011         won't end up with an invalid pointer.
1012
1013         * libsoup/soup-context.c: Make this a GObject, remove all the
1014         SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
1015         SoupContext can keep track of connection auth stuff there without
1016         SoupConnection needing to care. Various other updates.
1017
1018         * libsoup/soup-private.h: Remove SoupContext and SoupConnection
1019         definitions.
1020
1021         * libsoup/*.c, tests/get.c: Update for context/connection changes
1022
1023         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
1024         definition to deal with the fact that there's no
1025         soup_connection_get_context any more.
1026
1027         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
1028         with connection persistence here.
1029         (soup_queue_read_done_cb): Do it here instead. Disconnect the
1030         connection when appropriate.
1031         (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
1032         Reference-count the connection properly. (I think.)
1033
1034         * libsoup/soup-marshal.list: New, for SoupConnection's
1035         "disconnected" signal.
1036
1037         * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
1038
1039         * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
1040         GLIB_GENMARSHAL gets set too.
1041
1042 2003-08-14  Dan Winship  <danw@ximian.com>
1043
1044         * libsoup/soup-error.c: Fix a spelling mistake.
1045
1046         * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
1047
1048 2003-08-12  Dan Winship  <danw@ximian.com>
1049
1050         * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
1051         of the interfaces around a little bit.
1052
1053         * libsoup/soup-auth-basic.c: subclass for Basic auth
1054
1055         * libsoup/soup-auth-digest.c: subclass for Digest auth
1056
1057         * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
1058         the code from soup-ntlm.c here, and make it private.
1059
1060         * libsoup/soup-ntlm.c: gone
1061
1062         * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
1063         here, and change the signature of SoupAuthorizeFn.
1064
1065         * libsoup/soup-context.c: Use g_object_unref to free auths, use
1066         methods instead of directly access private fields.
1067
1068         * libsoup/soup-queue.c: Likewise
1069
1070         * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
1071         NTLM references. We have no plans to implement server-side NTLM
1072         auth.
1073
1074         * tests/auth-test.c (identify_auth): Update for auth api changes
1075
1076 2003-08-12  Dan Winship  <danw@ximian.com>
1077
1078         * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
1079         call
1080
1081         * libsoup/soup-address.c: Make this a GObject.
1082         (soup_address_ref, soup_address_unref): Gone.
1083         (soup_address_copy): Gone. Wasn't being used anyway.
1084
1085         * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
1086         here from soup-address.c, so that soup-address doesn't need to
1087         worry about trying to cache zero-ref addresses.
1088
1089         * libsoup/soup-socket.c: Make this a GObject. Use "guint"
1090         consistently for port numbers.
1091         (soup_socket_ref, soup_socket_unref): Gone.
1092
1093         * libsoup/soup-private.h: Change the SoupSocket definition to be
1094         SoupSocketPrivate. (Still need to keep this here since soup-server
1095         pokes around in its internals.)
1096         (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
1097
1098         * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
1099         reader/writer rather than leaking them.
1100
1101         * libsoup/*: Use GObject methods for socket/address refcounting
1102         
1103         * tests/auth-test.c (main)
1104         * tests/timeserver.c (main): Call g_type_init.
1105
1106         * tests/get.c (main): Call g_type_init.
1107         (get_url, got_url): Fix some bugs that could make -r mode get into
1108         infinite loops downloading the same files over and over. Plug some
1109         memory leaks to make this more useful for valgrinding libsoup.
1110
1111         * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
1112         handler for SIGINT so we can exit cleanly, since valgrind won't
1113         give a leak report if you don't. Plug a few memory leaks.
1114
1115         * tests/simple-proxy.c (main): Likewise 
1116
1117 2003-08-12  Dan Winship  <danw@ximian.com>
1118
1119         Pull over some new test programs from the soup-refactoring branch,
1120         along with the SoupUri changes they depend on.
1121
1122         * tests/simple-httpd.c: A really simple HTTP server, to test the
1123         server code.
1124
1125         * tests/simple-proxy.c: An even simpler HTTP proxy
1126
1127         * tests/get.c: Add "-r" flag to recursively get files (thereby
1128         testing multiple-connections-at-once code). Also good for setting
1129         up a tree to use with simple-httpd.
1130
1131         * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
1132         normal case)
1133
1134         * tests/uri-parsing.c: Regression test for the new soup-uri.c
1135
1136         * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
1137         pull in some optimizations from camel-url. Also, make SoupProtocol
1138         a GQuark so we can still compare them with ==, but we can also
1139         recognize any protocol.
1140         (soup_uri_new_with_base): New, to merge base and relative URIs
1141         (soup_uri_to_string): Update this. Change the "show_password" flag
1142         (which we always passed FALSE for) to "just_path", for places that
1143         want the path+query without the protocol, host, etc.
1144
1145         * libsoup/soup-queue.c (soup_get_request_header): Just use
1146         soup_uri_to_string to generate the request URI.
1147
1148         * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
1149         "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
1150         the URI by hand badly.
1151         * libsoup/soup-server-auth.c (parse_digest): Likewise
1152
1153         * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
1154         switch() to an series of if()s since SOUP_PROTOCOL_* aren't
1155         constants any more.
1156
1157         * libsoup/soup-context.c (soup_context_uri_hash,
1158         soup_context_uri_equal): s/querystring/query/
1159
1160 2003-08-12  Dan Winship  <danw@ximian.com>
1161
1162         * configure.in: Bump API version to 2.2 and package version to
1163         2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
1164         libgnutls-config to find GNUTLS.
1165
1166         * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
1167
1168         * Makefile.am: Update for pc file rename
1169
1170         * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
1171         and libsoup-ssl-proxy stuff.
1172
1173         * libsoup/soup-ssl-proxy.c
1174         * libsoup/soup-nss.[ch]
1175         * libsoup/soup-openssl.[ch]: gone
1176
1177         * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
1178
1179         * tests/Makefile.am (get_LDADD, timeserver_LDADD,
1180         auth_test_LDADD): Update libsoup version
1181
1182 2003-08-07  Dan Winship  <danw@ximian.com>
1183
1184         * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
1185         soup_auth_invalidate): These are all really SoupContext functions,
1186         so move them to soup-context.c (and rename them appropriately).
1187         (soup_auth_get_protection_space): New method to get the
1188         "protection space" of an auth (paths where it is valid).
1189         (soup_auth_invalidate): New method to try to un-authenticate an
1190         auth (so we can keep the domain info cached even if the auth info
1191         is wrong).
1192         (basic_pspace_func): Basic protection space is all directories
1193         below the current one.
1194         (basic_invalidate_func): Clear the encoded username/password
1195         (digest_pspace_func): Digest protection space is either the whole
1196         server, or "what the domain parameter says" (though we don't deal
1197         with cross-host domains).
1198         (digest_invalidate_func): Return FALSE; bad digest auth info isn't
1199         cacheable.
1200         (digest_parse_func, digest_free): Set/free domain parameter
1201         (ntlm_pspace): NTLM protection space is always the whole server.
1202         (ntlm_invalidate): Clear the auth state.
1203         (soup_auth_new_ntlm): Make this non-static
1204         (SoupAuth): Replace the quad-state "status" field with an
1205         "authenticated" boolean.
1206         
1207         * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
1208         hash with separate "auth_realms" (path->realm) and "auths"
1209         (realm->auth) hashes. Also add a "use_ntlm" flag.
1210
1211         * libsoup/soup-context.c (soup_context_unref): Update SoupHost
1212         freeing code.
1213         (connection_free): Don't the connection's auth, just free it.
1214         (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
1215         does two-stage lookup (path->realm then realm->auth) and also
1216         deals with NTLM hacks.
1217         (soup_context_update_auth): Mostly formerly soup_auth_set_context,
1218         but also large parts of authorize_handler. Updates the auth hashes
1219         based on information from a 401 or 407 response. Does a better job
1220         than authorize_handler did of not throwing away good information.
1221         (soup_context_preauthenticate): New; fakes up auth info so that
1222         requests will end up using authentication without the server
1223         needing to return an error first.
1224         (soup_context_authenticate_auth): Moved out of authorize_handler
1225         so it can be used at request-sending time too, if we know that we
1226         need it. (That way we can avoid requeuing the request if it isn't
1227         going to be able to be authenticated.)
1228         (soup_context_invalidate_auth): Sort of like the old
1229         soup_auth_invalidate, but only destroys the auth data, while still
1230         remembering the path->realm mapping.
1231
1232         * libsoup/soup-message.c (authorize_handler): Mostly moved into
1233         soup_context_update_auth.
1234         (maybe_validate_auth): Remove this; it was only useful because of
1235         bugs elsewhere in the auth handling.
1236         
1237         * libsoup/soup-queue.c (soup_encode_http_auth): Update for
1238         soup_context_lookup_auth. If the returned auth isn't
1239         authenticated, call soup_context_authenticate_auth() on it.
1240
1241         * tests/auth-test.c: New (from soup-refactoring branch). Tests
1242         that the Basic/Digest auth code does the right thing. (TODO: find
1243         a good way to add NTLM tests too.)
1244
1245         * tests/Makefile.am (check_PROGRAMS): add auth-test
1246
1247 2003-07-29  Dan Winship  <danw@ximian.com>
1248
1249         * configure.in: 1.99.25 ("Potato and Leek Soup")
1250
1251         * libsoup/soup-message.c (requeue_read_finished,
1252         release_connection): Free the passed-in body data. Otherwise the
1253         response body ends up getting leaked on most 3xx and 4xx
1254         responses.
1255         (soup_message_cleanup): Remove a piece of code that didn't
1256         actually do anything and its associated confused comment.
1257
1258         * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
1259
1260         * libsoup/soup-context.c (connection_free): plug a non-occasional
1261         NTLM auth leak.
1262
1263 2003-06-26  Joe Shaw  <joe@ximian.com>
1264
1265         * configure.in: Version 1.99.24
1266
1267 2003-06-24  Dan Winship  <danw@ximian.com>
1268
1269         * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
1270         it, and (b) depends on lots of new things sometimes (like on RH9).
1271
1272         * libsoup/soup-openssl.c: 
1273         * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
1274         just #ifdef HAVE_OPENSSL since the header check doesn't get run in
1275         the pkgconfig case
1276
1277 2003-06-19  Dan Winship  <danw@ximian.com>
1278
1279         * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
1280         old read_tag before changing/clearing it.
1281         (soup_queue_write_done_cb): Likewise with the write_tag.
1282
1283         * libsoup/soup-transfer.c (issue_final_callback): ref the reader
1284         around the stop+callback.
1285         (soup_transfer_write_cb): Likewise.
1286
1287 2003-06-12  Dan Winship  <danw@ximian.com>
1288
1289         * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
1290         ref_count field.
1291         (soup_transfer_read, create_writer): Set initial ref_count to 2
1292         (one for soup-transfer, one for the caller).
1293         (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
1294         reader
1295         (soup_transfer_read_stop): Clears the GIOChannel callbacks and
1296         drops soup-transfer's ref.
1297         (soup_transfer_read_cancel): Now just a stop+unref
1298         (soup_transfer_write_ref, soup_transfer_write_unref,
1299         soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
1300
1301         * libsoup/soup-message.c (soup_message_cleanup): when setting up
1302         the "finish reading" callbacks, unref the reader so it will be
1303         destroyed once it's done reading.
1304         (soup_message_requeue): Likewise.
1305
1306         * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
1307         prototype change (no longer returns a SoupTransferDone).
1308         (soup_queue_read_chunk_cb): Likewise.
1309
1310         * libsoup/soup-server.c (read_headers_cb): Likewise
1311
1312 2003-06-11  Dan Winship  <danw@ximian.com>
1313
1314         * libsoup/soup-transfer.c: Change all functions to take a
1315         SoupReader * or SoupWriter * instead of a guint.
1316
1317         * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
1318         write_tag pointers instead of guints.
1319
1320 2003-06-02  Chris Toshok  <toshok@ximian.com>
1321
1322         * libsoup/soup-ssl.c: remove #include for soup-nss.h
1323
1324 2003-06-02  Chris Toshok  <toshok@ximian.com>
1325
1326         * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
1327         (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
1328         (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
1329
1330 2003-06-02  Chris Toshok  <toshok@ximian.com>
1331
1332         * configure.in: Bump version to 1.99.23.
1333
1334 2003-05-30  Chris Toshok  <toshok@ximian.com>
1335
1336         * libsoup/soup-queue.c (soup_queue_error_cb): always force a
1337         reconnect when there's an error with ssl connection.  This fixes
1338         #43387, but it runs the risk of sending requests multiple times to
1339         the exchange server, and it results in lots of shorter lived
1340         connections and more forking (in the ssl proxy case), depending on
1341         the length of the operation.
1342
1343 2003-05-21  Dan Winship  <danw@ximian.com>
1344
1345         * configure.in: 1.99.22 (codename: French Onion Soup)
1346
1347 2003-05-20  Dan Winship  <danw@ximian.com>
1348
1349         * libsoup/soup-message.c (soup_message_requeue): Clear the
1350         write_tag as well so we don't double-cancel it. #43395.
1351
1352         * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
1353         be destroyed by the end of the func, so we have to call
1354         soup_connection_set_used at the beginning.
1355
1356         * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
1357         Call g_set_error() so that we don't SEGV immediately after
1358         returning G_IO_STATUS_ERROR.
1359
1360 2003-05-08  Joe Shaw  <joe@ximian.com>
1361
1362         * configure.in: Bump version to 1.99.21
1363
1364         * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
1365         tunnelling fails, the other message which shares our same
1366         connection will free it first, so set ours to NULL.
1367
1368 2003-05-08  Dan Winship  <danw@ximian.com>
1369
1370         * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
1371         return an NTLM request string. Otherwise return the "response"
1372         field (which should include the NTLM authenticate message)
1373         (ntlm_init): Don't bother setting "response" to the NTLM request
1374         string. Just leave it NULL in that case.
1375
1376         * libsoup/soup-message.c (authorize_handler): Never try to reuse
1377         an NTLM auth returned from soup_auth_lookup. Only set the auth on
1378         the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
1379         call soup_auth_set_context() on it just like for non-NTLM auth.
1380         The net effect of all of this is that now we record when a context
1381         needs NTLM auth just like with non-NTLM auth, so that that info
1382         gets preserved across connections.
1383         (soup_message_requeue): No longer need the hackery here to
1384         preserve the connection auth state.
1385
1386 2003-05-07  Dan Winship  <danw@ximian.com>
1387
1388         * libsoup/soup-context.c (soup_connection_set_in_use): New, to
1389         toggle the connection's in_use flag, and set up the death watch
1390         when it's not in use.
1391         (connection_death): This is only hooked up when the connection is
1392         not in use now, so don't need to check that. Should fix the
1393         infinite connection_death loop.
1394         (soup_connection_is_new): Keep a distinct "new" flag rather than
1395         defining "new" as "has been released at least once".
1396         (soup_connection_set_used): Mark a connection no-longer new.
1397         (soup_context_connect_cb): Mark the connection as new. Don't set
1398         up the death watch since it's in_use.
1399         (try_existing_connections): Use soup_connection_set_in_use.
1400         (soup_connection_release): Likewise
1401
1402         * libsoup/soup-message.c (requeue_read_finished): Call
1403         soup_connection_set_used so that the connection isn't still
1404         considered new when we send the message the second time.
1405
1406         * libsoup/soup-queue.c (soup_queue_error_cb): Call
1407         soup_connection_set_used (assuming we don't close the connection)
1408         (soup_queue_read_done_cb): Likewise.
1409
1410         * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
1411         nothing, call soup_transfer_read_error_cb rather than just
1412         cancelling, or else it will get cancelled again later.
1413
1414 2003-05-07  Dan Winship  <danw@ximian.com>
1415
1416         * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
1417         library doesn't depend on them, only the proxy does. #42473
1418
1419 2003-05-06  Dan Winship  <danw@ximian.com>
1420
1421         * src/libsoup/soup-message.c (global_handlers): Change the
1422         redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
1423         SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
1424         for "Location" to get around the non-64-bit-clean union
1425         initialization pointed out by Jeremy Katz <katzj@redhat.com>.
1426         (redirect_handler): Update for that.
1427
1428 2003-04-28  Dan Winship  <danw@ximian.com>
1429
1430         * configure.in: 1.99.20
1431
1432         * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
1433         we always call UNIGNORE_CANCEL. Might fix #41971
1434
1435 2003-04-25  Dan Winship  <danw@ximian.com>
1436
1437         * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
1438         suddenly gets an io error while reading or writing, assume it's a
1439         timeout or something, close the connection, and requeue the
1440         message.
1441
1442 2003-04-23  Dan Winship  <danw@ximian.com>
1443
1444         * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
1445         soup-transfer callbacks to keep reading off the connection unless
1446         we're actually going to keep the connection around afterward.
1447         Otherwise we can just close it.
1448
1449         * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
1450         thingy so that it's possible to cancel a read from inside a
1451         callback so that the above change actually works instead of just
1452         crashing.
1453
1454 2003-04-20  Rodney Dawes  <dobey@ximian.com>
1455
1456         * configure.in: Up version to 1.99.18
1457         * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
1458         
1459 2003-04-11  Dan Winship  <danw@ximian.com>
1460
1461         * libsoup/soup-context.c (soup_connection_purge_idle): New
1462         function to close all idle connections. (Needed for #41117 or else
1463         there's no way to force-discard NTLM authentication.)
1464
1465         * libsoup/soup-queue.c (soup_queue_shutdown): Use it
1466
1467 2003-04-10  Joe Shaw  <joe@ximian.com>
1468
1469         * libsoup/soup-queue.c (proxy_https_connect):
1470         proxy_https_connect_cb() might not get called if connecting to the
1471         proxy fails, and it causes us to double-free the connection.
1472         Always set the message's connection to NULL before freeing it.
1473
1474 2003-04-09  Dan Winship  <danw@ximian.com>
1475
1476         * configure.in: 1.99.17
1477
1478 2003-04-07  Dan Winship  <danw@ximian.com>
1479
1480         * libsoup/soup-context.c (connection_death): Revert Joe's changes.
1481         We can't release the connection there because there may be
1482         SoupMessages still pointing to it. (Needs to be revisited.)
1483
1484 2003-04-03  JP Rosevear  <jpr@ximian.com>
1485
1486         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
1487         error during waitpid
1488
1489         * libsoup/soup-address.c: ditto
1490
1491 2003-04-02  Joe Shaw  <joe@ximian.com>
1492
1493         * libsoup/soup-context.c (connection_death): Only drop the
1494         connection if we get an error condition on the channel.  Fixes a
1495         double-free.
1496
1497 2003-04-02  Joe Shaw  <joe@ximian.com>
1498
1499         * libsoup/soup-context.c (connection_death): Just call
1500         soup_connection_release() from here and return whether the
1501         connection is in use.
1502
1503 2003-03-31  Ian Peters  <itp@ximian.com>
1504
1505         * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
1506         case of EAGAIN or EINTR, since shutting down an SSL connection
1507         requires more than just closing a socket.
1508
1509 2003-03-28  Dan Winship  <danw@ximian.com>
1510
1511         * libsoup/soup-message.c (soup_message_set_context): If the new
1512         context points to a different server from the old context, call
1513         soup_message_cleanup. Otherwise it tries to reuse the old
1514         connection...
1515
1516 2003-03-25  Joe Shaw  <joe@ximian.com>
1517
1518         * configure.in: Bump up to 1.99.16
1519
1520 2003-03-24  Joe Shaw  <joe@ximian.com>
1521
1522         * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
1523         slightly better error message on various SSL failures than the
1524         previous message.
1525
1526         * soup-queue.c (soup_queue_error_cb): Throw the
1527         SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
1528
1529 2003-03-21  Joe Shaw  <joe@ximian.com>
1530
1531         * soup-server.c: Use non-deprecated g_main_loop_* calls
1532         throughout.
1533         (soup_server_unref): Don't unref the main loop if it's NULL.
1534         Fixes a glib warning.
1535
1536 2003-03-18  Dan Winship  <danw@ximian.com>
1537
1538         * configure.in: comment out NSS checks. The NSS code doesn't work
1539         and there are no current plans to fix it.
1540
1541         * README (Features): Mention GnuTLS, remove NSS and the rest of
1542         the "Planned Features" section.
1543
1544         * MAINTAINERS: remove Alex
1545
1546         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
1547         timeout to 10 seconds (and get rid of the 3 tries) so we don't
1548         fail to connect just because the server is slow/far away.
1549
1550 2003-03-17  Joe Shaw  <joe@ximian.com>
1551
1552         * configure.in: Bump up to 1.99.15.
1553
1554 2003-03-12  Ian Peters  <itp@ximian.com>
1555
1556         * libsoup/soup-gnutls.c: because creating client credentials is
1557         expensive, keep the same one around as long as possible, only
1558         recreating it if the ssl_ca_file changes.  Wrap
1559         gnutls_certificate_credentials in a refcounted struct to avoid
1560         freeing it while another established connection may potentially
1561         need it (say, to rehandshake).
1562
1563 2003-03-11  Frank Belew  <frb@ximian.com>
1564
1565         * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't 
1566         use pkgconfig
1567
1568 2003-03-10  Joe Shaw  <joe@ximian.com>
1569
1570         * configure.in: Bump up to 1.99.14.
1571
1572         * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
1573         libsoup/soup-ssl.c: Add support for GnuTLS.  Patch from Ian
1574         Peters.
1575
1576 2003-03-07  Joe Shaw  <joe@ximian.com>
1577
1578         * configure.in: Bump up to 1.99.13.
1579
1580         * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
1581         the list of conditions to watch.  If the remote end hangs up the
1582         connection, we'll get a successful read of 0 bytes, not a HUP.
1583         The connection will have to be released by the point we check for
1584         it in connection_death().
1585
1586         * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
1587         (apparently) errant resetting of the read and write tags.  I think
1588         this might have been causing some reentrancy and crashes.
1589
1590         * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
1591         channel to NULL encoding and not buffered.
1592
1593         * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
1594         incorrect comments.
1595
1596 2003-02-28  Joe Shaw  <joe@ximian.com>
1597
1598         * configure.in: Bump up to 1.99.12.
1599
1600         * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
1601         header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
1602         this case we probably don't want to call the error callback, we
1603         just want to act like our transfer was cancelled.
1604
1605 2003-02-27  Joe Shaw  <joe@ximian.com>
1606
1607         Try to apply some order to the iochannel refcounting...
1608
1609         * configure.in: Bump up to 1.99.11.
1610
1611         * libsoup/soup-context.c (soup_connection_get_iochannel): The
1612         connections needs to own a reference to the iochannel!  If we're
1613         using HTTPS, release the ref we get from soup_socket_get_iochannel
1614         and replace it with the ref we get from soup_ssl_get_iochannel().
1615         Then, always ref the channel that we return (ugh, but that's the
1616         soup way).
1617         (connection_free): Release the connection's ref to the iochannel.
1618
1619         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1620         iochannel. The reference we pass back will be owned by the
1621         connection.
1622         (soup_ssl_hup_waitpid): Release our ref.
1623
1624 2003-02-27  Joe Shaw  <joe@ximian.com>
1625
1626         * configure.in: Bump up to 1.99.10.
1627
1628         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1629         iochannel, return to the status quo.  Sigh.
1630
1631 2003-02-26  Joe Shaw  <joe@ximian.com>
1632
1633         * configure.in: Bump up to 1.99.9.
1634
1635         * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
1636         it's causing problems with HTTPS and proxies; the iochannel
1637         refcounting is waaaaaay horked.
1638
1639 2003-02-26  Frank Belew  <frb@ximian.com>
1640
1641         * libsoup/Makefile.am: added workaround to link ssl-proxy statically
1642
1643 2003-02-11  Joe Shaw  <joe@ximian.com>
1644
1645         * configure.in: Bump up to 1.99.8 for snaps.
1646
1647         * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
1648         It returns the address to the resulting hostent or NULL on failure,
1649         unlike Linux which returns an error code.
1650
1651 2003-02-11  Joe Shaw  <joe@ximian.com>
1652
1653         * configure.in: Bump up to 1.99.7 for snaps.
1654
1655         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
1656         the error string from OpenSSL if we can't establish a connection.
1657
1658 2003-02-04  Joe Shaw  <joe@ximian.com>
1659
1660         * configure.in: Bump up to 1.99.6 for snaps.
1661
1662         * libsoup/soup-server.c (destroy_message): We already assigned
1663         chan, so don't reassign it, and unref it in all cases.
1664         (issue_bad_request): Always unref after a call to
1665         soup_socket_get_iochannel(), because it refs it.
1666         (conn_accept): Fix some funky GIOChannel reffing here.
1667
1668         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
1669         g_io_channel_ref() on the socket.  This is the exact opposite of
1670         what we want to do.  Create a temporary structure containing the
1671         parent pid and the old socket and unref the socket when our
1672         callback is called.  This should fix GIOChannels being leaked on
1673         SSL connections.
1674
1675         * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
1676         main loop quits.
1677
1678 2003-01-22  Joe Shaw  <joe@ximian.com>
1679
1680         * configure.in: Bump up to 1.99.5 for the snaps.
1681
1682         * libsoup/soup-address.c (soup_address_new): If we found the
1683         address in our hash, we need to return NULL or else Soup will
1684         think we're doing an async lookup and do some cancellation on
1685         us.  Besides, we were returning the wrong type anyway and it
1686         was crashing things.
1687
1688 2003-01-17  Joe Shaw  <joe@ximian.com>
1689
1690         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
1691         uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
1692         out, so keep trying until we succeed.
1693
1694 2003-01-10  Joe Shaw  <joe@ximian.com>
1695
1696         * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
1697         strings and print out the error when the cert can't verify.
1698
1699 2003-01-09  Dan Winship  <danw@ximian.com>
1700
1701         * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
1702         overrun noticed by valgrind
1703
1704 2002-12-20  Joe Shaw  <joe@ximian.com>
1705
1706         * libsoup/soup-server.c (soup_server_new_with_host): Added.
1707         Starts a server only on the interface specified, instead of all
1708         network interfaces.
1709
1710 2002-12-16  Jeremy Katz  <katzj@redhat.com>
1711
1712         * configure.in: use $libdir instead of /usr/lib when looking for
1713         libraries
1714
1715 2002-12-11  Joe Shaw  <joe@ximian.com>
1716
1717         * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
1718         Don't set a variable to NULL and then immediately try to
1719         dereference it.
1720
1721 2002-12-09  Joe Shaw  <joe@ximian.com>
1722
1723         * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
1724         timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
1725         we don't hang forever if we don't get more data.
1726
1727         * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
1728         or else we'll hang forever in SSL_connect() if the other side
1729         hangs up.
1730
1731         * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
1732         release the connection on message free, even if the connection was
1733         unsuccessful.
1734
1735 2002-12-03  Joe Shaw  <joe@ximian.com>
1736
1737         * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
1738         g_io_channel_set_close_on_unref() on the second half of the socket
1739         pair so we don't leak file descriptors.
1740
1741 2002-12-03  Frank Belew  <frb@ximian.com>
1742
1743         * libsoup/soup-address.c: add signal.h to the list of headers to 
1744         pick up SIGKILL
1745         
1746 2002-11-25  Joe Shaw  <joe@ximian.com>
1747
1748         * Makefile.am: Build the tests directory again
1749
1750 2002-11-21  Rodney Dawes  <dobey@ximian.com>
1751
1752         * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
1753         
1754 2002-11-20  Michael Meeks  <michael@ximian.com>
1755
1756         * configure.in: require autoconf 2.52 not 2.53.
1757
1758 2002-11-18  Dan Winship  <danw@ximian.com>
1759
1760         * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
1761         since it's apparently non-portable. Use s6_addr instead.
1762         (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
1763
1764         * libsoup/soup-error.c: Fix spelling of
1765         SOUP_ERROR_MOVED_PERMANENTLY and its description.
1766
1767         * libsoup/soup-message.c (soup_message_get_request_header, etc):
1768         Remove long-deprecated API.
1769
1770         * libsoup/soup-socket.c (soup_socket_connect): remove unused
1771         variable.
1772
1773         * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
1774         * libsoup/soup-server.c (cgi_read): Likewise
1775         * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
1776         Likewise.
1777         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
1778         * libsoup/soup-transfer.c (soup_transfer_read_cb,
1779         soup_transfer_write_cb): Likewise.
1780
1781         * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
1782         instead of IPv4. (Tested on OS X.)
1783
1784 2002-11-15  Dan Winship  <danw@ximian.com>
1785
1786         * libsoup/*: Change old Helix Code refs to Ximian (and update
1787         copyright dates).
1788
1789 2002-11-15  Frank Belew  <frb@ximian.com>
1790
1791         * tests/Makefile.am: uncomment lines to make timeserver build 
1792         correctly
1793         
1794 2002-11-14  Joe Shaw  <joe@ximian.com>
1795
1796         * libsoup/soup-address.c (soup_address_new): When we get an
1797         address from the hash, call our address lookup callback or else
1798         the connection will hang.
1799
1800 2002-11-13  Dan Winship  <danw@ximian.com>
1801
1802         * tests/timeserver.c: Oops, commit this.
1803
1804         * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
1805
1806 2002-11-13  Joe Shaw  <joe@ximian.com>
1807
1808         * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
1809         (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
1810         instead of bindir.
1811
1812         * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
1813         to properly shut down the SSL connection before closing the
1814         socket.
1815
1816         * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
1817         iochannels before quitting the main loop.
1818
1819         * tests/Makefile.am: disable building timeserver, the source file
1820         wasn't added.
1821
1822 2002-11-12  Dan Winship  <danw@ximian.com>
1823
1824         * configure.in: Check for IPv6 support in networking headers.
1825
1826         * libsoup/soup-address.c: Make the internal structure of
1827         SoupAddress entirely private, and make SoupAddress be more like a
1828         hostent and less like a sockaddr. (Ie, make it not have a port
1829         associated with it.) Document undocumented functions. Add
1830         completely-untested support for IPv6.
1831         (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
1832         SoupAddress and a port.
1833         (soup_address_ipv4_any, soup_address_ipv6_any): Return static
1834         addresses corresponding to the IPv6 and IPv6 "any" addresses.
1835         (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
1836         (soup_address_make_sockaddr): Now constructs a new sockaddr, which
1837         may be a sockaddr_in or sockaddr_in6.
1838         (soup_address_gethostname, soup_address_gethostaddr): Remove
1839         these. They aren't reliable, especially on multihomed hosts.
1840         (soup_gethostbyname, soup_gethostbyaddr): support IPv6
1841         (soup_address_new): Keep pending lookups in a separate hash table
1842         from completed lookups. Fix a bug when canceling a lookup when
1843         there was more one outstanding request for it.
1844         (soup_address_lookup_in_cache): Removed.
1845
1846         * libsoup/soup-socket.c: Add a port field to SoupSocket (since
1847         it's not in SoupAddress any more).
1848         (soup_socket_connect): Simplify this. Don't use
1849         soup_address_lookup_in_cache, just call soup_address_new, since we
1850         already know the code can deal with the callback being invoked
1851         immediately.
1852         (soup_socket_new_sync, soup_socket_new): Take a port argument.
1853         (soup_socket_server_new): Take a SoupAddress to use as the local
1854         address to bind to. This lets the caller choose between the IPv4
1855         and IPv6 "any" addresses, and also lets you bind to a single
1856         interface of a multi-homed machine.
1857         (soup_socket_server_accept, soup_socket_server_try_accept): Merge
1858         the common code.
1859
1860         * libsoup/soup-server.c (soup_server_new): Pass
1861         soup_address_ipv4_any() to soup_socket_server_new().
1862
1863         * libsoup/soup-socks.c (soup_connect_socks_proxy,
1864         soup_socks_write): Fix up for the API changes, but it won't work
1865         with IPv6 yet.
1866
1867         * tests/timeserver.c: Another really simple test, for the server
1868         socket code.
1869
1870         * tests/Makefile.am: build timeserver
1871
1872 2002-11-11  Dan Winship  <danw@ximian.com>
1873
1874         * libsoup/soup-address.c: Move the SoupAddress code from
1875         soup-socket.c and soup-socket-unix.c to here.
1876
1877         * libsoup/soup-socket.c: Move the remaining code from
1878         soup-socket-unix.c here.
1879
1880         * libsoup/soup-socket-unix.c: Gone
1881
1882         * tests/get.c: really really trivial test program
1883
1884         * configure.in (AC_OUTPUT):
1885         * Makefile.am (SUBDIRS): add tests/
1886
1887 2002-11-05  Dan Winship  <danw@ximian.com>
1888
1889         * Split libsoup out of soup. ChangeLog.old contains the original
1890         soup ChangeLog.
1891
1892         * Makefile.am, etc: Fix things up to work with the new directory
1893         layout. Disable docs until we fix them.
1894
1895         * autogen.sh: Use gnome-autogen.sh
1896
1897         * configure.in: Require autoconf 2.53. Remove stuff that was only
1898         needed for httpd or wsdl code. Remove glib1 support. Bump version
1899         to 2.0.
1900
1901         * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
1902         in ${includedir}/soup-2.0
1903         
1904         * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
1905         SOAP-specific stuff, Windows support, and other things that
1906         weren't being maintained.
1907
1908         * soup-config.in, soupConf.sh: Kill these. We only support
1909         pkg-config now.