1 2003-09-18 Dan Winship <danw@ximian.com>
3 * libsoup/soup-message.c: Add wrote_informational and
4 got_informational signals.
6 * libsoup/soup-message-client-io.c (get_request_headers): Set the
7 EXPECT_CONTINUE flag on the message if that header is set.
9 * libsoup/soup-message-server-io.c (parse_request_headers):
12 * libsoup/soup-message-io.c (io_write): Set read_state to HEADERS
13 when blocking on an expect-continue. Emit wrote_informational
14 instead of wrote_headers in the 1xx case.
15 (io_read): Set read_state to BLOCKING, not NOT_STARTED after
16 reading a 100 Continue response. Emit got_informational instead of
17 got_headers in the 1xx case.
19 * libsoup/soup-session.c (soup_session_send_message): Reorder
20 things to deal with the fact that the message could finish right
21 away if there is a connection available and the server is very
24 * libsoup/soup-status.h: Rename SOUP_STATUS_CLASS_TRANSPORT to
25 SOUP_STATUS_CLASS_TRANSPORT_ERROR.
27 2003-09-17 Dan Winship <danw@ximian.com>
29 * libsoup/soup-session.c (find_oldest_connection): Fix two bugs
30 (one that pruned too little, one that pruned too much).
31 (queue_message): When requeuing, don't run the queue;
32 final_finished will take care of that later.
33 (soup_session_abort): New, to cancel all pending requests.
35 * libsoup/soup-socket.c (soup_socket_connect, got_address): ref
36 the socket while waiting for the address to resolve
38 2003-09-17 Dan Winship <danw@ximian.com>
40 * libsoup/soup-connection.c (soup_connection_new): Replaces the
41 three previous soup_connection_new* functions and uses gobject
42 properties to set the destination and proxy uris.
43 (class_init): set up two more signals, authenticate and
45 (soup_connection_send_request): virtualize
46 (send_request): Default implementation
48 * libsoup/soup-connection-ntlm.c: New SoupConnection subclass that
49 also handles NTLM authentication. Includes all of the NTLM code
50 formerly in soup-auth-ntlm.c.
52 * libsoup/soup-auth-ntlm.[ch]: Gone.
54 * libsoup/soup-auth.c: Remove NTLM refs
56 * libsoup/soup-session.c (class_init): Add gobject properties for
57 proxy, max_conns, use_ntlm. Change the "authenticate" and
58 "reauthenticate" signal prototypes to not pass a SoupAuth (so they
59 can be used for authenticating SoupConnectionNTLM as well, which
60 doesn't use a SoupAuth).
61 (soup_session_new): Renamed from soup_session_new_default.
62 (soup_session_new_with_options): Replaces
63 soup_session_new_with_proxy and soup_session_new_full. Takes
65 (run_queue): Create a new connection of type SoupConnection or
66 SoupConnectionNTLM depending on our "use_ntlm" property. Connect
67 to its authenticate and reauthenticate signals.
68 (connection_authenticate, connection_reauthenticate): proxy these
71 * libsoup/soup-address.c (update_address_from_entry): Fix a
72 crasher when failing to resolve the address.
74 * libsoup/soup-dns.c (check_hostent): Fix some "how was this
77 * libsoup/soup-message-client-io.c (soup_message_send_request):
78 call soup_message_prepare() to clean up the existing response
81 * libsoup/soup-message-io.c (io_error): Set the read_state to DONE
82 when processing an OK EOF.
84 * libsoup/soup-status.h (SoupStatusClass): fix the numbering of
85 these so that SOUP_STATUS_CLASS_SUCCESS is 2, etc.
87 * tests/auth-test.c (authenticate, reauthenticate): Update for new
89 (main): Use soup_session_new.
90 * tests/get.c (main): Likewise.
91 * tests/simple-proxy.c (main): Likewise.
93 2003-09-10 Dan Winship <danw@ximian.com>
95 * libsoup/soup-session.c: Add "authenticate" and "reauthenticate"
97 (invalidate_auth): Remove the call to soup_auth_invalidate.
98 (authenticate_auth): soup_auth_fn is gone. If the URI doesn't
99 contain authentication, then emit "authenticate" or
100 "reauthenticate" (depending on whether or not this is the first
101 time we've asked for a password for this auth).
102 (update_auth_internal): If the server rejects our
103 username/password, don't bail out immediately. Try doing a
104 "reauthenticate" first.
106 * libsoup/soup-misc.c (soup_set_authorize_callback): Gone
108 * libsoup/soup-auth.c (soup_auth_new_from_header_list): Remove the
110 (soup_auth_invalidate): Remove this; it doesn't actually do
111 anything useful for us.
113 * libsoup/soup-auth-basic.c (invalidate): Remove
114 * libsoup/soup-auth-digest.c: (invalidate): Remove
115 * libsoup/soup-auth-ntlm.c: (invalidate): Remove
117 * libsoup/soup-uri.c: Remove all references to "authmech".
118 (soup_uri_set_auth): Remove this too.
120 * tests/auth-test.c: Update to use the "authenticate" and
121 "reauthenticate" signals instead of encoding usernames and
122 passwords in the URIs. Add a few more test cases.
124 2003-09-10 Dan Winship <danw@ximian.com>
126 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove the
127 "status" field from here, since it's mostly used by SoupSession,
128 which shouldn't need access to SoupMessagePrivate.
130 * libsoup/soup-message.h (SoupMessage): Move it here.
131 (SoupCallbackFn): Remove this alias for SoupMessageCallbackFn.
132 (soup_message_set_uri): also moved from soup-message-private.h
134 * libsoup/soup-message.c: s/msg->priv->status/msg->status/.
136 * libsoup/soup-message-handlers.c:
137 s/SoupCallbackFn/SoupMessageCallbackFn/ everywhere.
139 * libsoup/soup-message-io.c (soup_message_io_client,
140 soup_message_io_server, soup_message_io_unpause): Don't set up an
141 idle handler, just jump right in to reading/writing; if this is a
142 synchronous socket, then the caller wants to block, and if it's
143 not, then we'll quickly get an EAGAIN anyway.
145 * libsoup/soup-session.c: (queue_message): Likewise.
146 (*) Update for SoupMessageStatus move and remove
147 soup-message-private.h include.
149 * libsoup/soup-server-message.c: Remove soup-message-private.h
152 * libsoup/soup-server.c: Likewise.
154 * libsoup/soup-connection.c (soup_connection_is_connected,
155 soup_connection_is_new): Remove these, since they weren't being
158 * libsoup/soup-md5-utils.c: Moved from md5-utils.c and renamed, to
159 avoid namespace pollution.
161 * libsoup/soup-auth-digest.c: Update for that.
162 * libsoup/soup-server-auth.c: Likewise
164 * tests/auth-test.c: Remove soup-message-private.h include
166 2003-09-09 Dan Winship <danw@ximian.com>
168 Beginnings of improved synchronous API support
170 * libsoup/soup-dns.c: Simplify this by making it not automatically
171 return the result: force the caller to poll. (This isn't really a
172 performance issue: the results should come back quickly anyway.)
173 Also, make the cache thread-safe.
174 (soup_dns_entry_from_name): Was soup_gethostbyname
175 (soup_dns_entry_from_addr): Was soup_gethostbyaddr
176 (soup_dns_entry_check_lookup): Used to poll to see if DNS is done
177 (soup_dns_entry_get_hostent): Gets the hostent from an entry (and
178 blocks if it's not resolved yet).
180 * libsoup/soup-address.c: Update for soup-dns changes.
181 (soup_address_new): Don't automatically start resolving the
182 hostname now, since we don't know if the caller is going to want
183 it resolved synchronously or asynchronously.
184 (soup_address_resolve_async): Renamed from soup_address_resolve.
185 (soup_address_resolve_sync): New routine to do blocking
188 * libsoup/soup-socket.c (soup_socket_connect): Now returns a
189 status value directly when connecting synchronously.
190 (soup_socket_client_new_async, soup_socket_client_new_sync):
191 Separate async/sync client socket functions.
192 (soup_socket_get_iochannel): Made static since it was not used
195 * libsoup/soup-connection.c (soup_connection_new,
196 soup_connection_new_proxy, soup_connection_new_tunnel): Just set
197 up the data, don't actually start connecting.
198 (soup_connection_connect_async, soup_connection_connect_sync): New
199 async and sync SoupConnection connecting routines.
200 (soup_connection_get_socket): Remove this since it wasn't being
203 * libsoup/soup-session.c (final_finished): Run the queue since a
204 connection is now freed up.
205 (run_queue): Update for soup_connection_new* changes.
207 * libsoup/soup-misc.c (soup_substring_index): Remove, since it
208 wasn't being used any more.
210 * libsoup/soup-private.h: Remove some prototypes for functions
211 that no longer exist.
213 * libsoup/soup-uri.c (soup_uri_copy_root): New utility function
214 (copies the protocol, host, and port of a SoupUri).
218 * tests/simple-proxy.c: belatedly update for soup-session change
220 * tests/revserver.c: Handle each new connection in its own thread,
221 using synchronous SoupSocket calls.
223 2003-09-05 Dan Winship <danw@ximian.com>
225 * libsoup/soup-session.c: Move a bunch of logic here from
226 soup-context. Now the session keeps track of hosts (instead of
227 having a global soup_hosts hash) and their connections.
228 (soup_session_new_with_proxy, soup_session_new_full): New session
229 constructors to specify a proxy or a proxy and connection limits
230 (send_request): Add Authorization and Proxy-Authorization headers
231 before sending off the request.
232 (soup_session_queue_message, et al): Improve the way this works.
233 There's no need to use timeouts to wait for connections to become
234 free; we *know* when they become free.
236 * libsoup/soup-private.h: Remove SoupHost and some other
237 no-longer-used stuff.
239 * libsoup/soup-misc.c (soup_set_proxy, soup_get_proxy,
240 soup_set_connection_limit, soup_set_connection_limit): Gone. These
241 are all per-session now.
243 * libsoup/soup-message.c: Remove all SoupContext references
244 (mostly replaced with SoupUri references)
245 (cleanup_message): priv->connect_tag and priv->connection are gone
246 now, so this was just soup_message_io_cancel(). So remove
247 cleanup_message and replace it with that everywhere.
248 (soup_message_disconnect): Gone.
249 (soup_message_set_uri): Replaces soup_message_set_context.
250 (soup_message_set_connection, soup_message_get_connection): Gone
252 * libsoup/soup-message-server-io.c (parse_request_headers):
253 s/soup_message_set_context/soup_message_set_uri/
255 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove
256 connect_tag, context, and connection.
258 * libsoup/soup-message-client-io.c (encode_http_auth): Gone.
260 * libsoup/soup-context.c: Gone
262 * tests/auth-test.c (identify_auth): update for session/context
265 2003-09-03 Dan Winship <danw@ximian.com>
267 * libsoup/soup-status.h: Renamed from soup-error.h, with types
268 and defines renamed accordingly.
270 * libsoup/soup-message.h (SoupMessage): Rename errorcode to
271 status_code and errorphrase to reason_phrase. Remove errorclass.
272 (SOUP_MESSAGE_IS_ERROR): Remove this. You can't classify redirects
273 as being either "errors" or "not errors", so its semantics are
274 guaranteed to be wrong sometimes.
276 * libsoup/soup-message.c (soup_message_set_status,
277 soup_message_set_status_full): Renamed
279 * libsoup/soup-message-handlers.c
280 (soup_message_add_status_code_handler,
281 soup_message_add_status_class_handler): Rename.
283 * libsoup/soup-session.c (soup_session_send_message): Make this
284 return a status code rather than a status class.
286 * libsoup/soup-message-private.h (SoupMessagePrivate): Remove some
287 unrelated unused fields (retries, callback, user_data).
291 2003-09-02 Dan Winship <danw@ximian.com>
293 * libsoup/soup-session.c: First draft at the new object to
294 maintain formerly-global state. (Not yet complete; still need to
295 get rid of SoupContext).
297 * libsoup/soup-message-queue.c: Data structure used by SoupSession
299 * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but
300 some bits went into soup-connection.
302 * libsoup/soup-connection.c (soup_connection_send_request): New,
303 to send a request on a connection. The connection updates its
304 internal state and then hands off to soup_message_send_request.
305 (request_done): Callback set up by soup_connection_send_request.
306 Marks the connection as no-longer-in-use, and disconnects it if
308 (soup_connection_set_in_use, soup_connection_mark_old): No longer
309 needed; the connection takes care of this itself now.
310 (soup_connection_new_proxy): New, to create a new connection that
311 is explicitly marked as being through an HTTP proxy.
312 (soup_connection_new_tunnel): New, to create a new HTTPS
313 connection through a proxy. (Includes the code to send the
316 * libsoup/soup-context.c (try_existing_connections): Don't need to
317 call soup_connection_set_in_use.
318 (try_create_connection): Use soup_connection_new,
319 soup_connection_new_proxy, or soup_connection_new_tunnel as
322 * libsoup/soup-message.c (soup_message_prepare): Replaces
324 (soup_message_queue, soup_message_requeue, soup_message_prepare):
325 Gone. This must be done via a SoupSession now.
326 (soup_message_set_connection): don't need to mark in_use/not
327 in_use. Also, msg->priv->socket is gone now.
328 (soup_message_get_socket): Gone.
330 * libsoup/soup-message-handlers.c (soup_message_run_handlers):
331 Remove references to global handlers.
332 (redirect_handler, authorize_handler): Moved to soup-session.c.
334 * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the
335 session to shut down now.
337 * libsoup/soup.h: add soup-session.h
339 * libsoup/Makefile.am: updates
341 * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use
344 2003-08-29 Dan Winship <danw@ximian.com>
346 * libsoup/soup-message-io.c: Major rewrite. There is now only a
347 single IO state object (instead of one for reading and one for
348 writing), and the IO code handles switching back and forth between
349 reading and writing as appropriate (including handling the extra
350 switches needed for "Expect: 100-continue").
351 (soup_message_io_client, soup_message_io_server): The new entry
353 (soup_message_io_cancel): If the caller cancels the IO when we
354 were expecting to read more data, disconnect the socket.
356 * libsoup/soup-message.h (SoupMessageFlags): add
357 SOUP_MESSAGE_EXPECT_CONTINUE, to indicate that the IO code should
358 do the special expect-continue handling.
360 * libsoup/soup-message.c: Move all the signal stuff here. Remove
361 the "done_reading" and "done_writing" signals and replace them
362 with a single "finished" signal. (A single signal. Say that 10
364 (soup_message_got_headers, etc): Functions to emit signals.
365 (got_headers, got_chunk, got_body): Default signal methods that
366 call soup_message_run_handlers.
367 (finished): Default signal method that replaces
368 soup_message_issue_callback.
369 ([various]): s/soup_message_issue_callback/soup_message_finished/
370 (soup_message_requeue): There's no soup_message_set_read_callbacks
371 any more, so if the caller requeues while it's still reading, just
373 (soup_message_add_chunk, soup_message_add_final_chunk,
374 soup_message_pop_chunk): Moved here from soup-server-message,
375 although we don't actually quite support using chunked encoding
378 * libsoup/soup-server-message.c (soup_server_message_new): No
379 longer takes a socket argument.
380 (soup_server_message_add_chunk, soup_server_message_get_chunk):
381 Moved into SoupMessage.
383 * libsoup/soup-message-handlers.c (global_handlers): Make these
384 POST_BODY rather than PRE_BODY, so they won't mess up the IO
385 channel when the requeue the message.
386 (soup_message_run_handlers): Don't need to issue the message
387 callback from here any more.
388 (authorize_handler): Just leave the error as 401 or 407 (see
391 * libsoup/soup-message-client-io.c (soup_message_send_request):
392 Replaces soup_message_write_request and
393 soup_message_read_response.
395 * libsoup/soup-message-server-io.c: Parallel to
396 soup-message-client-io.c, this defines the server-side header
398 (soup_message_read_request): Its entry point.
400 * libsoup/soup-server.c: Lots of code moved into
401 soup-message-server-io.c. Update for other changes.
403 * libsoup/soup-queue.c: Update for changes
405 * libsoup/soup-socket.c (read_from_network, soup_socket_write):
406 Don't call soup_socket_disconnect() on an error, just return
407 SOUP_SOCKET_ERROR. Otherwise soup_socket_disconnect() could emit
408 signals that will mess up the caller of the read/write function.
410 * libsoup/soup-connection.c (soup_connection_disconnect): When
411 disconnecting the socket, disconnect from its signals first to
412 prevent bad reentrancy.
414 * libsoup/soup-error.h: Kill off SOUP_ERROR_CANT_AUTHENTICATE and
415 SOUP_ERROR_CANT_AUTHENTICATE_PROXY, since they don't really say
416 anything that SOUP_ERROR_UNATHORIZED and
417 SOUP_ERROR_PROXY_UNAUTHORIZED don't say. (And now, all of the
418 "transport" errors actually are transport-related.)
420 * tests/auth-test.c (main): s/CANT_AUTHENTICATE/UNAUTHORIZED/
422 * tests/simple-proxy.c: Complicate this a bunch. In particular,
423 use SOUP_MESSAGE_OVERWRITE_CHUNKS and the GOT_CHUNK signal, and
424 pass the data back to the client in chunked format.
426 2003-08-27 Dan Winship <danw@ximian.com>
428 * libsoup/soup-types.h: New header with typedefs, to avoid
429 #include loops among other headers.
431 * libsoup/Makefile.am (libsoupinclude_HEADERS): add it
433 * libsoup/*.[ch], tests/*.c: Update for soup-types.h
435 2003-08-26 Dan Winship <danw@ximian.com>
437 * libsoup/soup-message-client-io.c (soup_message_write_request,
438 soup_message_read_response): Higher-than-soup-message-io-level
439 functions to do client-side IO. (Code that used to be in
441 (get_request_header_cb): Fix a bug in the generation of the Host:
442 header; need to include the port number if it's not the default.
444 * libsoup/soup-message-io.c (soup_message_write,
445 soup_message_write_simple): Take separate user_datas for the get_*
446 callbacks and the done callbacks.
448 * libsoup/soup-queue.c: Update to use soup_message_write_request
449 and soup_message_read_response.
451 * libsoup/soup-connection.c (soup_connection_new): Change the
452 prototype to take a SoupUri and a callback.
454 * libsoup/soup-context.c (try_create_connection,
455 soup_context_connect_cb): Update for soup_connection_new change.
457 * libsoup/soup-server.c (read_done_cb, issue_bad_request): Update
458 for soup_message_write changes
460 * libsoup/soup-uri.c (soup_uri_uses_default_port): new utility
463 2003-08-26 Dan Winship <danw@ximian.com>
465 * libsoup/soup-message-private.h: Define SoupMessage signal stuff
466 (READ_HEADERS, READ_CHUNK, READ_BODY, READ_ERROR, WROTE_HEADERS,
467 WROTE_CHUNK, WROTE_BODY, WRITE_ERROR).
469 * libsoup/soup-message.c (class_init): set up signals
470 (requeue_read_finished): Update for changes.
472 * libsoup/soup-message-io.c (soup_message_read): Split out
473 parse_headers_cb from read_headers_cb. Also add a SoupDataBuffer *
474 arg to say where to store the message body. Set up
475 read_headers_cb, read_chunk_cb, read_body_cb, and error_cb as
477 (do_read): Call r->parse_headers_cb, then emit READ_HEADERS
478 (read_body_chunk): emit READ_CHUNK.
479 (issue_final_callback): Set r->body. emit READ_BODY.
480 (failed_read): emit READ_ERROR.
481 (soup_message_read_set_callbacks): Disconnect old signal handlers,
483 (soup_message_read_cancel): Disconnect signal handlers.
484 (soup_message_write, soup_message_write_simple): Set up
485 wrote_body_cb and error_cb as signal handlers.
486 (do_write): emit WROTE_HEADERS and WROTE_CHUNK, even though
487 nothing currently ever listens for them. emit WROTE_BODY when
489 (failed_write): emit WRITE_ERROR
491 * libsoup/soup-queue.c (soup_queue_parse_headers_cb,
492 soup_queue_read_headers_cb): Split this into two unequal chunks.
493 (read_header_cb only runs the pre-body handlers).
494 (soup_queue_read_chunk_cb, soup_queue_read_done_cb): Update
496 (soup_queue_write_done_cb): Update call to soup_message_read
498 * libsoup/soup-server.c (parse_headers_cb): Renamed from
500 (read_done_cb): Update prototype
501 (start_request): Update soup_message_read call.
503 2003-08-25 Dan Winship <danw@ximian.com>
505 * libsoup/soup-message-io.c (soup_message_read,
506 soup_message_write, soup_message_write_simple): Add a "user_data"
507 arg, pass it to the callbacks.
509 * libsoup/soup-message.c (soup_message_requeue,
510 requeue_read_finished, requeue_read_error): Update for that
512 * libsoup/soup-queue.c: Likewise
514 * libsoup/soup-server.c: Likewise
516 2003-08-25 Dan Winship <danw@ximian.com>
518 * libsoup/soup-message.c (soup_message_new): Take a uri string
519 instead of a context. Also, swap the args (so the method comes
520 before the URI, just like in the protocol).
521 (soup_message_new_from_uri): Like soup_messgae_new, but takes a
522 SoupUri instead of a string
523 (soup_message_set_request, soup_message_set_response): Replace
524 soup_message_new_full.
525 (cleanup_message): Was soup_message_cleanup, but is static now.
526 (queue_message): Do the pre-queuing message cleanup here instead
527 of in soup_queue_message.
528 (soup_message_queue): Set the callback and user_data, then call
530 (requeue_read_error, requeue_read_finished, soup_message_requeue):
532 (soup_message_get_uri): Replaces soup_message_get_context.
534 * libsoup/soup-message.h (SoupMessage): Remove msg->context. (It's
535 part of SoupMessagePrivate now)
537 * libsoup/soup-context.c: #include soup-message-private
538 (soup_context_from_uri): constify the uri arg.
540 * libsoup/soup-queue.c: Various context/uri fixes
541 (proxy_https_connect): Use soup_message_new_from_uri.
542 (soup_queue_message): Drastically simplified since most of the
543 work is in soup-messsage.c:queue_message() now
545 * libsoup/soup-auth-digest.c (compute_response,
546 get_authorization): Use soup_message_get_uri.
548 * libsoup/soup-server-auth.c (parse_digest): Likewise
550 * libsoup/soup-server.c (call_handler): Likewise
552 * tests/simple-httpd.c (server_callback): Likewise.
554 * tests/simple-proxy.c (server_callback): Likewise
556 * tests/get.c (got_url): Likewise.
557 (get_url): Update soup_message_new usage.
559 * tests/auth-test.c: #include soup-message-private. Update for
560 context changes and soup_message_new change.
562 2003-08-22 Dan Winship <danw@ximian.com>
564 * libsoup/soup-message-private.h: New file containing
565 SoupMessagePrivate and some other soup-message-internal
566 types/functions. Also includes the new, expanded SoupMessageStatus
569 * libsoup/soup-message-io.c: Replaces what used to be in
570 soup-transfer, but now all the interfaces take SoupMessages
571 instead of SoupReader/SoupWriter and deal with maintaining
572 msg->priv->{read,write}_state themselves. Fixes up all the
575 * libsoup/soup-message-handlers.c: Move the handler code here,
576 mostly unchanged. (But rename SoupHandlerType to SoupHandlerPhase
577 to make the distinction from SoupHandlerKind clearer.)
579 * libsoup/soup-message.c: Update for soup-message-io and new
580 SoupMessageStatus values. Remove handler code.
581 (soup_message_cleanup): Remove the hack to try to preserve the
582 connection if the message gets cleaned up before it finishes
583 reading. soup_message_requeue handles this in the requeuing case,
584 and there's no especially compelling reason to bother doing it in
585 any other case. (And the soup-message-io api doesn't support
586 having a read operation that's not connected to any message.)
588 * libsoup/soup-private.h: remove SoupMessagePrivate
590 * libsoup/soup-queue.c: Update for soup-message-io and new
591 SoupMessageStatus values.
593 * libsoup/soup-server-message.c: Likewise
595 * libsoup/soup-server.c: Likewise
597 * libsoup/soup-transfer.c: Gone (yay)
599 * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): update
601 2003-08-20 Dan Winship <danw@ximian.com>
603 * libsoup/soup-message.c: Make this a GObject. (Note that since
604 SoupMessage was not refcounted before, it's not really refcounted
606 (soup_message_free): Gone, replaced by g_object_unref
607 (soup_message_copy, soup_message_foreach_remove_header): Remove
608 these, since neither was currently functional.
609 (soup_message_is_keepalive): New utility function to look at
610 HTTP version and request/response headers to decide if a message
611 indicates the connection should be kept alive.
612 (soup_message_set_connection, soup_message_get_connection): New
613 (soup_message_get_socket): New
615 * libsoup/soup-server-message.c: Make this a subclass of
617 (soup_server_message_new): Now takes a SoupServer and SoupSocket
618 (soup_server_message_get_server): New
619 (soup_server_message_set_encoding,
620 soup_server_message_get_encoding): Get/set whether the message
621 should be sent with content-length or chunked encoding
622 (soup_server_message_is_started, soup_server_message_is_finished):
623 Private member accessors.
624 (soup_server_message_add_chunk): Renamed from add_data
625 (soup_server_message_get_chunk): Pops a chunk from the list.
626 (soup_server_message_get_source): Gone
628 * libsoup/soup-server.c: Update for SoupServerMessage changes.
629 (error_cb, write_done_cb): All the cleanup stuff that used to be
630 here happens automatically by unreffing the message now.
631 (get_response_header): Remove some erroneous leftover CGI stuff
632 (issue_bad_request): add "Connection: close" to the response.
633 (read_headers_cb): clean this up a bit. Reject HTTP/1.1 messages
634 with no Host header as per RFC 2616.
636 * libsoup/soup-connection.c (soup_connection_start_ssl): Gone
637 (soup_connection_set_in_use): Let the caller set the connection to
638 "not in use" even after the socket has been disconnected.
640 * libsoup/soup-context.c: Use soup_message_get_connection
642 * libsoup/soup-headers.c (soup_headers_parse_request): Remove the
643 check on request length, since it was rejecting
644 "GET / HTTP/1.0\r\n\r\n", which is a valid complete request.
646 * libsoup/soup-queue.c: Use soup_message_get_connection and
647 soup_message_get_socket.
648 (soup_queue_read_done_cb): Use soup_message_is_keepalive
649 (proxy_https_connect_cb): Use soup_socket_start_ssl rather than
650 soup_connection_start_ssl
652 * libsoup/soup-socket.c (finalize): disconnect the GIOChannel
653 handlers if the socket hasn't been disconnected yet.
655 * libsoup/soup-transfer.c (soup_reader_read_body_chunk,
656 reader_read): Fix these so that reader_read will exit properly if
657 the read is cancelled.
659 * tests/auth-test.c (main): s/soup_message_free/g_object_unref/
661 * tests/simple-httpd.c (server_callback): set the message to
662 content-length encoding.
663 * tests/simple-proxy.c (server_callback): Likewise
665 2003-08-19 Dan Winship <danw@ximian.com>
667 * libsoup/soup-socket.c (soup_socket_read,
668 soup_socket_read_until, soup_socket_write): New API for doing
669 socket IO. Works both synchronously and asynchronously, and
670 buffers data to prevent the "100 Continue" problem.
671 (soup_socket_set_flag): Replaces formerly-private
672 soup_set_sockopts. (primarily to let the caller turn off
673 SOUP_SOCKET_FLAG_NONBLOCKING).
675 * libsoup/soup-transfer.c (soup_transfer_read,
676 soup_transfer_write, soup_transfer_write_simple): Take a
677 SoupSocket instead of a GIOChannel. Use the new socket IO api.
678 Changed the prototypes of some of the callbacks to be less
681 * libsoup/soup-connection.c (soup_connection_get_socket): Replaces
682 soup_connection_get_iochannel.
684 * libsoup/soup-message.c: Fix up for soup-transfer changes
686 * libsoup/soup-queue.c: Likewise
688 * libsoup/soup-server.c: Likewise
690 * tests/revserver.c: A slightly more complicated replacement for
691 timeserver. (Does both reads and writes)
693 2003-08-19 Dan Winship <danw@ximian.com>
695 * libsoup/soup-socks.[ch]: Remove this. RC doesn't let you
696 configure it, and no one has complained, and it looks like the
697 SOCKS5 auth code doesn't actually work anyway...
699 * libsoup/soup-queue.c (proxy_connect): Remove SOCKS code.
701 * libsoup/soup-uri.h: Remove SOUP_PROTOCOL_SOCKS4 and
704 * libsoup/soup-misc.c: Remove a references to SOCKS in a comment
706 * libsoup/Makefile.am (libsoup_2_2_la_SOURCES): remove
709 2003-08-19 Dan Winship <danw@ximian.com>
711 * libsoup/soup-server.c: Make this a GObject. Remove
712 SoupServerMessage code (to soup-server-message.c). Remove CGI
713 server code (for now?)
714 (soup_server_add_handler, soup_server_remove_handler): Rename
715 (from register/unregister) to make it clearer what they do.
717 * libsoup/soup-server-message.c: Moved out of soup-server.c
719 * libsoup/soup-private.h: Remove SoupServer def
721 * libsoup/Makefile.am (libsoupinclude_HEADERS,
722 libsoup_2_2_la_SOURCES): add soup-server-message.[ch]
724 * tests/simple-httpd.c:
725 * tests/simple-proxy.c: Update for SoupServer changes
727 2003-08-18 Dan Winship <danw@ximian.com>
729 * libsoup/soup-address.c (SoupAddressPrivate): Make this more like
730 a struct sockaddr again (like it used to be). In particular, add
731 back the "port" field. Add a bunch of macros to try (and fail) to
732 simplify some of the code.
733 (soup_address_new): Now returns a SoupAddress directly rather than
734 a random handle, and the caller can just use g_object_unref to
735 cancel the lookup. Also, the callback now uses a
736 SoupKnownErrorCode rather than a special-purpose address-lookup
738 (soup_address_new_cancel): No longer needed.
739 (soup_address_new_sync): Removed
740 (soup_address_new_any): Replaces soup_address_ipv4_any and
741 soup_address_ipv6_any.
742 (soup_address_get_name, etc): Gone. Use soup_address_resolve()
744 (soup_address_get_physical): Renamed from
745 soup_address_get_canonical_name.
746 (soup_address_get_sockaddr): Replaces soup_address_make_sockaddr()
748 * libsoup/soup-socket.c: Update for SoupAddress changes and make
749 similar changes here.
750 (soup_socket_new): Just creates a generic SoupSocket now.
751 (soup_socket_connect): Client setup
752 (soup_socket_listen): Server setup. Now also sets up an iochannel
753 listening for connects and emits a "new_connection" signal as they
755 (soup_socket_start_ssl): Turns on SSL.
756 (soup_socket_client_new, soup_socket_server_new): Utility
757 functions that wrap the above.
758 (soup_socket_new_cancel, soup_socket_new_sync): Gone
759 (soup_socket_server_accept, soup_socket_server_try_accept): No
761 (soup_socket_get_iochannel): No longer adds a ref when returning
762 the iochannel. Also, we set it to "close_on_unref" so that if a
763 caller adds a ref to it, the connection will actually remain open
764 even after the SoupSocket is destroyed.
765 (soup_socket_get_local_address, soup_socket_get_remote_address):
766 Let the caller get both of these.
768 * libsoup/soup-connection.c: Don't keep a private copy of the
770 (soup_connection_new): Don't need to set socket options here.
772 (soup_connection_start_ssl): Just call soup_socket_start_ssl.
773 (soup_connection_get_iochannel): Just return the socket's
774 iochannel (and don't ref it)
776 * libsoup/soup-error.c: add SOUP_ERROR_CANT_RESOLVE and
777 SOUP_ERROR_CANT_RESOLVE_PROXY
779 * libsoup/soup-dns.c (soup_ntop): Make the address arg const.
780 Remove the "FIXME add a CANT_RESOLVE error" and return
781 SOUP_ERROR_CANT_RESOLVE instead.
783 * libsoup/soup-server.c: Update for socket/address changes. Don't
784 poke into SoupSocket's private fields.
785 (soup_server_run_async): Just connect to the socket's
786 "new_connection" signal.
788 * libsoup/soup-context.c (try_create_connection,
789 soup_context_connect_cb): Update for socket changes. Replace
790 SOUP_CONNECT_ERROR codes with plain SOUP_ERROR codes.
792 * libsoup/soup-misc.c (soup_signal_connect_once): Utility function
793 to connect to a signal handler and connect another function to
794 clean up the first signal handler after its first invocation.
795 (Lets us use signals to replace one-off callbacks.)
797 * libsoup/soup-private.h: Remove SoupSocketPrivate since it is
798 actually private now.
799 (struct _SoupServer): Remove accept_tag.
801 * libsoup/soup-queue.c (soup_queue_read_done_cb, start_request):
802 Don't unref the iochannel.
803 (soup_queue_connect_cb): Takes a SoupKnownErrorCode now.
805 * libsoup/soup-socks.c: Update for socket/address changes
807 * tests/simple-httpd.c (main):
808 s/SOUP_SERVER_ANY_PORT/SOUP_ADDRESS_ANY_PORT/
809 * tests/simple-proxy.c (main): Likewise
811 * tests/timeserver.c: Update for SoupSocket's "new_connection"
812 signal, and for SoupAddress changes.
814 2003-08-14 Dan Winship <danw@ximian.com>
816 * libsoup/soup-connection.c: New, split out from soup-context and
818 (soup_connection_disconnect): Disconnects the connection and emits
819 a signal. (Replaces the old "keep_alive" flag.)
820 (soup_connection_is_connected): Checks if the connection is still
822 (connection_died): Just disconnect, rather than freeing the
823 connection. This way if anyone else is still referencing it they
824 won't end up with an invalid pointer.
826 * libsoup/soup-context.c: Make this a GObject, remove all the
827 SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
828 SoupContext can keep track of connection auth stuff there without
829 SoupConnection needing to care. Various other updates.
831 * libsoup/soup-private.h: Remove SoupContext and SoupConnection
834 * libsoup/*.c, tests/get.c: Update for context/connection changes
836 * libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
837 definition to deal with the fact that there's no
838 soup_connection_get_context any more.
840 * libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
841 with connection persistence here.
842 (soup_queue_read_done_cb): Do it here instead. Disconnect the
843 connection when appropriate.
844 (proxy_connect, proxy_https_connect, proxy_https_connect_cb):
845 Reference-count the connection properly. (I think.)
847 * libsoup/soup-marshal.list: New, for SoupConnection's
848 "disconnected" signal.
850 * libsoup/Makefile.am: add rules to build soup-marshal.[ch]
852 * configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
853 GLIB_GENMARSHAL gets set too.
855 2003-08-14 Dan Winship <danw@ximian.com>
857 * libsoup/soup-error.c: Fix a spelling mistake.
859 * libsoup/*.c: Fix use of @/%/#/() in gtk-doc comments
861 2003-08-12 Dan Winship <danw@ximian.com>
863 * libsoup/soup-auth.c: Make this an abstract GObject. Tweak some
864 of the interfaces around a little bit.
866 * libsoup/soup-auth-basic.c: subclass for Basic auth
868 * libsoup/soup-auth-digest.c: subclass for Digest auth
870 * libsoup/soup-auth-ntlm.c: subclass for NTLM auth. Move all of
871 the code from soup-ntlm.c here, and make it private.
873 * libsoup/soup-ntlm.c: gone
875 * libsoup/soup-misc.h: Remove the definition of SoupAuthType from
876 here, and change the signature of SoupAuthorizeFn.
878 * libsoup/soup-context.c: Use g_object_unref to free auths, use
879 methods instead of directly access private fields.
881 * libsoup/soup-queue.c: Likewise
883 * libsoup/soup-server-auth.c (soup_server_auth_free): Remove all
884 NTLM references. We have no plans to implement server-side NTLM
887 * tests/auth-test.c (identify_auth): Update for auth api changes
889 2003-08-12 Dan Winship <danw@ximian.com>
891 * configure.in (GLIB): add gobject-2.0 to the PKG_CHECK_MODULES
894 * libsoup/soup-address.c: Make this a GObject.
895 (soup_address_ref, soup_address_unref): Gone.
896 (soup_address_copy): Gone. Wasn't being used anyway.
898 * libsoup/soup-dns.c: Move all of the DNS code and caching stuff
899 here from soup-address.c, so that soup-address doesn't need to
900 worry about trying to cache zero-ref addresses.
902 * libsoup/soup-socket.c: Make this a GObject. Use "guint"
903 consistently for port numbers.
904 (soup_socket_ref, soup_socket_unref): Gone.
906 * libsoup/soup-private.h: Change the SoupSocket definition to be
907 SoupSocketPrivate. (Still need to keep this here since soup-server
908 pokes around in its internals.)
909 (SOUP_MAKE_TYPE): Copied from gal's E_MAKE_TYPE.
911 * libsoup/soup-server.c (read_done_cb, write_done_cb): Unref the
912 reader/writer rather than leaking them.
914 * libsoup/*: Use GObject methods for socket/address refcounting
916 * tests/auth-test.c (main)
917 * tests/timeserver.c (main): Call g_type_init.
919 * tests/get.c (main): Call g_type_init.
920 (get_url, got_url): Fix some bugs that could make -r mode get into
921 infinite loops downloading the same files over and over. Plug some
922 memory leaks to make this more useful for valgrinding libsoup.
924 * tests/simple-httpd.c (main): Call g_type_init. Set up a signal
925 handler for SIGINT so we can exit cleanly, since valgrind won't
926 give a leak report if you don't. Plug a few memory leaks.
928 * tests/simple-proxy.c (main): Likewise
930 2003-08-12 Dan Winship <danw@ximian.com>
932 Pull over some new test programs from the soup-refactoring branch,
933 along with the SoupUri changes they depend on.
935 * tests/simple-httpd.c: A really simple HTTP server, to test the
938 * tests/simple-proxy.c: An even simpler HTTP proxy
940 * tests/get.c: Add "-r" flag to recursively get files (thereby
941 testing multiple-connections-at-once code). Also good for setting
942 up a tree to use with simple-httpd.
944 * tests/timeserver.c (main): Fix a bug. (s/ipv6/ipv4/ in the
947 * tests/uri-parsing.c: Regression test for the new soup-uri.c
949 * libsoup/soup-uri.c: Rewrite/update to conform to RFC 2396, and
950 pull in some optimizations from camel-url. Also, make SoupProtocol
951 a GQuark so we can still compare them with ==, but we can also
952 recognize any protocol.
953 (soup_uri_new_with_base): New, to merge base and relative URIs
954 (soup_uri_to_string): Update this. Change the "show_password" flag
955 (which we always passed FALSE for) to "just_path", for places that
956 want the path+query without the protocol, host, etc.
958 * libsoup/soup-queue.c (soup_get_request_header): Just use
959 soup_uri_to_string to generate the request URI.
961 * libsoup/soup-auth.c (compute_response, digest_auth_func): Use
962 "soup_uri_to_path (uri, TRUE)" rather than trying to reassemble
963 the URI by hand badly.
964 * libsoup/soup-server-auth.c (parse_digest): Likewise
966 * libsoup/soup-socks.c (soup_connect_socks_proxy): Change a
967 switch() to an series of if()s since SOUP_PROTOCOL_* aren't
970 * libsoup/soup-context.c (soup_context_uri_hash,
971 soup_context_uri_equal): s/querystring/query/
973 2003-08-12 Dan Winship <danw@ximian.com>
975 * configure.in: Bump API version to 2.2 and package version to
976 2.1.0. Remove NSS and OpenSSL checks and proxy-related config. Use
977 libgnutls-config to find GNUTLS.
979 * libsoup-2.2.pc.in: Update, and rename from soup-2.0.pc
981 * Makefile.am: Update for pc file rename
983 * libsoup/Makefile.am: s/2.0/2.2/ everywhere. Remove NSS, OpenSSL,
984 and libsoup-ssl-proxy stuff.
986 * libsoup/soup-ssl-proxy.c
987 * libsoup/soup-nss.[ch]
988 * libsoup/soup-openssl.[ch]: gone
990 * libsoup/soup-ssl.c: remove NSS and OpenSSL bits
992 * tests/Makefile.am (get_LDADD, timeserver_LDADD,
993 auth_test_LDADD): Update libsoup version
995 2003-08-07 Dan Winship <danw@ximian.com>
997 * libsoup/soup-auth.c (soup_auth_lookup, soup_auth_set_context,
998 soup_auth_invalidate): These are all really SoupContext functions,
999 so move them to soup-context.c (and rename them appropriately).
1000 (soup_auth_get_protection_space): New method to get the
1001 "protection space" of an auth (paths where it is valid).
1002 (soup_auth_invalidate): New method to try to un-authenticate an
1003 auth (so we can keep the domain info cached even if the auth info
1005 (basic_pspace_func): Basic protection space is all directories
1006 below the current one.
1007 (basic_invalidate_func): Clear the encoded username/password
1008 (digest_pspace_func): Digest protection space is either the whole
1009 server, or "what the domain parameter says" (though we don't deal
1010 with cross-host domains).
1011 (digest_invalidate_func): Return FALSE; bad digest auth info isn't
1013 (digest_parse_func, digest_free): Set/free domain parameter
1014 (ntlm_pspace): NTLM protection space is always the whole server.
1015 (ntlm_invalidate): Clear the auth state.
1016 (soup_auth_new_ntlm): Make this non-static
1017 (SoupAuth): Replace the quad-state "status" field with an
1018 "authenticated" boolean.
1020 * libsoup/soup-private.h (SoupHost): Replace the "valid_auths"
1021 hash with separate "auth_realms" (path->realm) and "auths"
1022 (realm->auth) hashes. Also add a "use_ntlm" flag.
1024 * libsoup/soup-context.c (soup_context_unref): Update SoupHost
1026 (connection_free): Don't the connection's auth, just free it.
1027 (soup_context_lookup_auth): Formerly soup_auth_lookup, but now
1028 does two-stage lookup (path->realm then realm->auth) and also
1029 deals with NTLM hacks.
1030 (soup_context_update_auth): Mostly formerly soup_auth_set_context,
1031 but also large parts of authorize_handler. Updates the auth hashes
1032 based on information from a 401 or 407 response. Does a better job
1033 than authorize_handler did of not throwing away good information.
1034 (soup_context_preauthenticate): New; fakes up auth info so that
1035 requests will end up using authentication without the server
1036 needing to return an error first.
1037 (soup_context_authenticate_auth): Moved out of authorize_handler
1038 so it can be used at request-sending time too, if we know that we
1039 need it. (That way we can avoid requeuing the request if it isn't
1040 going to be able to be authenticated.)
1041 (soup_context_invalidate_auth): Sort of like the old
1042 soup_auth_invalidate, but only destroys the auth data, while still
1043 remembering the path->realm mapping.
1045 * libsoup/soup-message.c (authorize_handler): Mostly moved into
1046 soup_context_update_auth.
1047 (maybe_validate_auth): Remove this; it was only useful because of
1048 bugs elsewhere in the auth handling.
1050 * libsoup/soup-queue.c (soup_encode_http_auth): Update for
1051 soup_context_lookup_auth. If the returned auth isn't
1052 authenticated, call soup_context_authenticate_auth() on it.
1054 * tests/auth-test.c: New (from soup-refactoring branch). Tests
1055 that the Basic/Digest auth code does the right thing. (TODO: find
1056 a good way to add NTLM tests too.)
1058 * tests/Makefile.am (check_PROGRAMS): add auth-test
1060 2003-07-29 Dan Winship <danw@ximian.com>
1062 * configure.in: 1.99.25 ("Potato and Leek Soup")
1064 * libsoup/soup-message.c (requeue_read_finished,
1065 release_connection): Free the passed-in body data. Otherwise the
1066 response body ends up getting leaked on most 3xx and 4xx
1068 (soup_message_cleanup): Remove a piece of code that didn't
1069 actually do anything and its associated confused comment.
1071 * libsoup/soup-auth.c (ntlm_free): plug an occasional NTLM auth leak
1073 * libsoup/soup-context.c (connection_free): plug a non-occasional
1076 2003-06-26 Joe Shaw <joe@ximian.com>
1078 * configure.in: Version 1.99.24
1080 2003-06-24 Dan Winship <danw@ximian.com>
1082 * configure.in: Check pkgconfig for openssl, since 0.9.7 (a) uses
1083 it, and (b) depends on lots of new things sometimes (like on RH9).
1085 * libsoup/soup-openssl.c:
1086 * libsoup/soup-ssl-proxy.c: Change #ifdef HAVE_OPENSSL_SSL_H to
1087 just #ifdef HAVE_OPENSSL since the header check doesn't get run in
1090 2003-06-19 Dan Winship <danw@ximian.com>
1092 * libsoup/soup-queue.c (soup_queue_read_done_cb): unref the
1093 old read_tag before changing/clearing it.
1094 (soup_queue_write_done_cb): Likewise with the write_tag.
1096 * libsoup/soup-transfer.c (issue_final_callback): ref the reader
1097 around the stop+callback.
1098 (soup_transfer_write_cb): Likewise.
1100 2003-06-12 Dan Winship <danw@ximian.com>
1102 * libsoup/soup-transfer.c (SoupReader, SoupWriter): add a
1104 (soup_transfer_read, create_writer): Set initial ref_count to 2
1105 (one for soup-transfer, one for the caller).
1106 (soup_transfer_read_ref, soup_transfer_read_unref): ref/unref a
1108 (soup_transfer_read_stop): Clears the GIOChannel callbacks and
1109 drops soup-transfer's ref.
1110 (soup_transfer_read_cancel): Now just a stop+unref
1111 (soup_transfer_write_ref, soup_transfer_write_unref,
1112 soup_transfer_write_stop, soup_transfer_write_cancel): Similarly.
1114 * libsoup/soup-message.c (soup_message_cleanup): when setting up
1115 the "finish reading" callbacks, unref the reader so it will be
1116 destroyed once it's done reading.
1117 (soup_message_requeue): Likewise.
1119 * libsoup/soup-queue.c (soup_queue_read_headers_cb): Update for
1120 prototype change (no longer returns a SoupTransferDone).
1121 (soup_queue_read_chunk_cb): Likewise.
1123 * libsoup/soup-server.c (read_headers_cb): Likewise
1125 2003-06-11 Dan Winship <danw@ximian.com>
1127 * libsoup/soup-transfer.c: Change all functions to take a
1128 SoupReader * or SoupWriter * instead of a guint.
1130 * libsoup/soup-private.h (SoupMessagePrivate): make read_tag and
1131 write_tag pointers instead of guints.
1133 2003-06-02 Chris Toshok <toshok@ximian.com>
1135 * libsoup/soup-ssl.c: remove #include for soup-nss.h
1137 2003-06-02 Chris Toshok <toshok@ximian.com>
1139 * libsoup/Makefile.am (INCLUDES): remove NSS_CFLAGS.
1140 (libsoup_2_0_la_LIBADD): remove NSS_LIBS.
1141 (libsoup_2_0_la_SOURCES): remove soup-nss.[ch]
1143 2003-06-02 Chris Toshok <toshok@ximian.com>
1145 * configure.in: Bump version to 1.99.23.
1147 2003-05-30 Chris Toshok <toshok@ximian.com>
1149 * libsoup/soup-queue.c (soup_queue_error_cb): always force a
1150 reconnect when there's an error with ssl connection. This fixes
1151 #43387, but it runs the risk of sending requests multiple times to
1152 the exchange server, and it results in lots of shorter lived
1153 connections and more forking (in the ssl proxy case), depending on
1154 the length of the operation.
1156 2003-05-21 Dan Winship <danw@ximian.com>
1158 * configure.in: 1.99.22 (codename: French Onion Soup)
1160 2003-05-20 Dan Winship <danw@ximian.com>
1162 * libsoup/soup-message.c (soup_message_requeue): Clear the
1163 write_tag as well so we don't double-cancel it. #43395.
1165 * libsoup/soup-queue.c (soup_queue_error_cb): The connection might
1166 be destroyed by the end of the func, so we have to call
1167 soup_connection_set_used at the beginning.
1169 * libsoup/soup-openssl.c (soup_openssl_read, soup_openssl_write):
1170 Call g_set_error() so that we don't SEGV immediately after
1171 returning G_IO_STATUS_ERROR.
1173 2003-05-08 Joe Shaw <joe@ximian.com>
1175 * configure.in: Bump version to 1.99.21
1177 * libsoup/soup-queue.c (proxy_connect): If the proxy HTTPS
1178 tunnelling fails, the other message which shares our same
1179 connection will free it first, so set ours to NULL.
1181 2003-05-08 Dan Winship <danw@ximian.com>
1183 * libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
1184 return an NTLM request string. Otherwise return the "response"
1185 field (which should include the NTLM authenticate message)
1186 (ntlm_init): Don't bother setting "response" to the NTLM request
1187 string. Just leave it NULL in that case.
1189 * libsoup/soup-message.c (authorize_handler): Never try to reuse
1190 an NTLM auth returned from soup_auth_lookup. Only set the auth on
1191 the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
1192 call soup_auth_set_context() on it just like for non-NTLM auth.
1193 The net effect of all of this is that now we record when a context
1194 needs NTLM auth just like with non-NTLM auth, so that that info
1195 gets preserved across connections.
1196 (soup_message_requeue): No longer need the hackery here to
1197 preserve the connection auth state.
1199 2003-05-07 Dan Winship <danw@ximian.com>
1201 * libsoup/soup-context.c (soup_connection_set_in_use): New, to
1202 toggle the connection's in_use flag, and set up the death watch
1203 when it's not in use.
1204 (connection_death): This is only hooked up when the connection is
1205 not in use now, so don't need to check that. Should fix the
1206 infinite connection_death loop.
1207 (soup_connection_is_new): Keep a distinct "new" flag rather than
1208 defining "new" as "has been released at least once".
1209 (soup_connection_set_used): Mark a connection no-longer new.
1210 (soup_context_connect_cb): Mark the connection as new. Don't set
1211 up the death watch since it's in_use.
1212 (try_existing_connections): Use soup_connection_set_in_use.
1213 (soup_connection_release): Likewise
1215 * libsoup/soup-message.c (requeue_read_finished): Call
1216 soup_connection_set_used so that the connection isn't still
1217 considered new when we send the message the second time.
1219 * libsoup/soup-queue.c (soup_queue_error_cb): Call
1220 soup_connection_set_used (assuming we don't close the connection)
1221 (soup_queue_read_done_cb): Likewise.
1223 * libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
1224 nothing, call soup_transfer_read_error_cb rather than just
1225 cancelling, or else it will get cancelled again later.
1227 2003-05-07 Dan Winship <danw@ximian.com>
1229 * soup-2.0.pc.in (Libs): Don't put @OPENSSL_LIBS@ here; the
1230 library doesn't depend on them, only the proxy does. #42473
1232 2003-05-06 Dan Winship <danw@ximian.com>
1234 * src/libsoup/soup-message.c (global_handlers): Change the
1235 redirect handler to be a RESPONSE_ERROR_CLASS_HANDLER for
1236 SOUP_ERROR_CLASS_REDIRECT rather than a RESPONSE_HEADER_HANDLER
1237 for "Location" to get around the non-64-bit-clean union
1238 initialization pointed out by Jeremy Katz <katzj@redhat.com>.
1239 (redirect_handler): Update for that.
1241 2003-04-28 Dan Winship <danw@ximian.com>
1243 * configure.in: 1.99.20
1245 * libsoup/soup-transfer.c (soup_transfer_read_error_cb): Make sure
1246 we always call UNIGNORE_CANCEL. Might fix #41971
1248 2003-04-25 Dan Winship <danw@ximian.com>
1250 * libsoup/soup-queue.c (soup_queue_error_cb): if an old connection
1251 suddenly gets an io error while reading or writing, assume it's a
1252 timeout or something, close the connection, and requeue the
1255 2003-04-23 Dan Winship <danw@ximian.com>
1257 * libsoup/soup-message.c (soup_message_cleanup): Don't set up the
1258 soup-transfer callbacks to keep reading off the connection unless
1259 we're actually going to keep the connection around afterward.
1260 Otherwise we can just close it.
1262 * libsoup/soup-transfer.c: Re-kludge the awful IGNORE_CANCEL
1263 thingy so that it's possible to cancel a read from inside a
1264 callback so that the above change actually works instead of just
1267 2003-04-20 Rodney Dawes <dobey@ximian.com>
1269 * configure.in: Up version to 1.99.18
1270 * libsoup/Makefile.am: Line separator after GNUTLS_CFLAGS
1272 2003-04-11 Dan Winship <danw@ximian.com>
1274 * libsoup/soup-context.c (soup_connection_purge_idle): New
1275 function to close all idle connections. (Needed for #41117 or else
1276 there's no way to force-discard NTLM authentication.)
1278 * libsoup/soup-queue.c (soup_queue_shutdown): Use it
1280 2003-04-10 Joe Shaw <joe@ximian.com>
1282 * libsoup/soup-queue.c (proxy_https_connect):
1283 proxy_https_connect_cb() might not get called if connecting to the
1284 proxy fails, and it causes us to double-free the connection.
1285 Always set the message's connection to NULL before freeing it.
1287 2003-04-09 Dan Winship <danw@ximian.com>
1289 * configure.in: 1.99.17
1291 2003-04-07 Dan Winship <danw@ximian.com>
1293 * libsoup/soup-context.c (connection_death): Revert Joe's changes.
1294 We can't release the connection there because there may be
1295 SoupMessages still pointing to it. (Needs to be revisited.)
1297 2003-04-03 JP Rosevear <jpr@ximian.com>
1299 * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): guard against EINTR
1300 error during waitpid
1302 * libsoup/soup-address.c: ditto
1304 2003-04-02 Joe Shaw <joe@ximian.com>
1306 * libsoup/soup-context.c (connection_death): Only drop the
1307 connection if we get an error condition on the channel. Fixes a
1310 2003-04-02 Joe Shaw <joe@ximian.com>
1312 * libsoup/soup-context.c (connection_death): Just call
1313 soup_connection_release() from here and return whether the
1314 connection is in use.
1316 2003-03-31 Ian Peters <itp@ximian.com>
1318 * libsoup/soup-gnutls.c (soup_gnutls_close): loop on gnutls_bye in
1319 case of EAGAIN or EINTR, since shutting down an SSL connection
1320 requires more than just closing a socket.
1322 2003-03-28 Dan Winship <danw@ximian.com>
1324 * libsoup/soup-message.c (soup_message_set_context): If the new
1325 context points to a different server from the old context, call
1326 soup_message_cleanup. Otherwise it tries to reuse the old
1329 2003-03-25 Joe Shaw <joe@ximian.com>
1331 * configure.in: Bump up to 1.99.16
1333 2003-03-24 Joe Shaw <joe@ximian.com>
1335 * soup-error.[ch]: Add SOUP_ERROR_SSL_FAILED which gives a
1336 slightly better error message on various SSL failures than the
1339 * soup-queue.c (soup_queue_error_cb): Throw the
1340 SOUP_ERROR_SSL_FAILED error when we fail an SSL handshake.
1342 2003-03-21 Joe Shaw <joe@ximian.com>
1344 * soup-server.c: Use non-deprecated g_main_loop_* calls
1346 (soup_server_unref): Don't unref the main loop if it's NULL.
1347 Fixes a glib warning.
1349 2003-03-18 Dan Winship <danw@ximian.com>
1351 * configure.in: comment out NSS checks. The NSS code doesn't work
1352 and there are no current plans to fix it.
1354 * README (Features): Mention GnuTLS, remove NSS and the rest of
1355 the "Planned Features" section.
1357 * MAINTAINERS: remove Alex
1359 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Bump the
1360 timeout to 10 seconds (and get rid of the 3 tries) so we don't
1361 fail to connect just because the server is slow/far away.
1363 2003-03-17 Joe Shaw <joe@ximian.com>
1365 * configure.in: Bump up to 1.99.15.
1367 2003-03-12 Ian Peters <itp@ximian.com>
1369 * libsoup/soup-gnutls.c: because creating client credentials is
1370 expensive, keep the same one around as long as possible, only
1371 recreating it if the ssl_ca_file changes. Wrap
1372 gnutls_certificate_credentials in a refcounted struct to avoid
1373 freeing it while another established connection may potentially
1374 need it (say, to rehandshake).
1376 2003-03-11 Frank Belew <frb@ximian.com>
1378 * soup-2.0.pc.in: add ssl libs to defaults, since ssl doesn't
1381 2003-03-10 Joe Shaw <joe@ximian.com>
1383 * configure.in: Bump up to 1.99.14.
1385 * configure.in, libsoup/Makefile.am, libsoup/soup.gnutls.[ch],
1386 libsoup/soup-ssl.c: Add support for GnuTLS. Patch from Ian
1389 2003-03-07 Joe Shaw <joe@ximian.com>
1391 * configure.in: Bump up to 1.99.13.
1393 * libsoup/soup-context.c (soup_context_connect_cb): Add G_IO_IN to
1394 the list of conditions to watch. If the remote end hangs up the
1395 connection, we'll get a successful read of 0 bytes, not a HUP.
1396 The connection will have to be released by the point we check for
1397 it in connection_death().
1399 * libsoup/soup-queue.c (soup_queue_error_cb): Get rid of some
1400 (apparently) errant resetting of the read and write tags. I think
1401 this might have been causing some reentrancy and crashes.
1403 * libsoup/soup-socket.c (soup_socket_get_iochannel): Set the IO
1404 channel to NULL encoding and not buffered.
1406 * libsoup/soup-transfer.c (soup_transfer_read_cb): Remove some
1409 2003-02-28 Joe Shaw <joe@ximian.com>
1411 * configure.in: Bump up to 1.99.12.
1413 * libsoup/soup-transfer.c (soup_transfer_read_cb): We can get a
1414 header_len of 0 and a total_read of 0 in the case of a SIGPIPE; in
1415 this case we probably don't want to call the error callback, we
1416 just want to act like our transfer was cancelled.
1418 2003-02-27 Joe Shaw <joe@ximian.com>
1420 Try to apply some order to the iochannel refcounting...
1422 * configure.in: Bump up to 1.99.11.
1424 * libsoup/soup-context.c (soup_connection_get_iochannel): The
1425 connections needs to own a reference to the iochannel! If we're
1426 using HTTPS, release the ref we get from soup_socket_get_iochannel
1427 and replace it with the ref we get from soup_ssl_get_iochannel().
1428 Then, always ref the channel that we return (ugh, but that's the
1430 (connection_free): Release the connection's ref to the iochannel.
1432 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1433 iochannel. The reference we pass back will be owned by the
1435 (soup_ssl_hup_waitpid): Release our ref.
1437 2003-02-27 Joe Shaw <joe@ximian.com>
1439 * configure.in: Bump up to 1.99.10.
1441 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Ref the
1442 iochannel, return to the status quo. Sigh.
1444 2003-02-26 Joe Shaw <joe@ximian.com>
1446 * configure.in: Bump up to 1.99.9.
1448 * libsoup/soup-ssl.c (soup_ssl_hup_waitpid): Comment out the unref,
1449 it's causing problems with HTTPS and proxies; the iochannel
1450 refcounting is waaaaaay horked.
1452 2003-02-26 Frank Belew <frb@ximian.com>
1454 * libsoup/Makefile.am: added workaround to link ssl-proxy statically
1456 2003-02-11 Joe Shaw <joe@ximian.com>
1458 * configure.in: Bump up to 1.99.8 for snaps.
1460 * libsoup/soup-address.c (soup_gethostbyname): Fix this for Solaris.
1461 It returns the address to the resulting hostent or NULL on failure,
1462 unlike Linux which returns an error code.
1464 2003-02-11 Joe Shaw <joe@ximian.com>
1466 * configure.in: Bump up to 1.99.7 for snaps.
1468 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Print out
1469 the error string from OpenSSL if we can't establish a connection.
1471 2003-02-04 Joe Shaw <joe@ximian.com>
1473 * configure.in: Bump up to 1.99.6 for snaps.
1475 * libsoup/soup-server.c (destroy_message): We already assigned
1476 chan, so don't reassign it, and unref it in all cases.
1477 (issue_bad_request): Always unref after a call to
1478 soup_socket_get_iochannel(), because it refs it.
1479 (conn_accept): Fix some funky GIOChannel reffing here.
1481 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Don't call
1482 g_io_channel_ref() on the socket. This is the exact opposite of
1483 what we want to do. Create a temporary structure containing the
1484 parent pid and the old socket and unref the socket when our
1485 callback is called. This should fix GIOChannels being leaked on
1488 * libsoup/soup-ssl-proxy.c: Always close the GIOChannels after the
1491 2003-01-22 Joe Shaw <joe@ximian.com>
1493 * configure.in: Bump up to 1.99.5 for the snaps.
1495 * libsoup/soup-address.c (soup_address_new): If we found the
1496 address in our hash, we need to return NULL or else Soup will
1497 think we're doing an async lookup and do some cancellation on
1498 us. Besides, we were returning the wrong type anyway and it
1499 was crashing things.
1501 2003-01-17 Joe Shaw <joe@ximian.com>
1503 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): It's not
1504 uncommon for us to get a G_IO_ERROR_AGAIN when trying to write
1505 out, so keep trying until we succeed.
1507 2003-01-10 Joe Shaw <joe@ximian.com>
1509 * libsoup/soup-openssl.c (verify_cb): Load some X509 and SSL error
1510 strings and print out the error when the cert can't verify.
1512 2003-01-09 Dan Winship <danw@ximian.com>
1514 * libsoup/soup-address.c (soup_gethostbyname): Fix a memcpy
1515 overrun noticed by valgrind
1517 2002-12-20 Joe Shaw <joe@ximian.com>
1519 * libsoup/soup-server.c (soup_server_new_with_host): Added.
1520 Starts a server only on the interface specified, instead of all
1523 2002-12-16 Jeremy Katz <katzj@redhat.com>
1525 * configure.in: use $libdir instead of /usr/lib when looking for
1528 2002-12-11 Joe Shaw <joe@ximian.com>
1530 * libsoup/soup-queue.c (proxy_https_connect_cb): I am an idiot.
1531 Don't set a variable to NULL and then immediately try to
1534 2002-12-09 Joe Shaw <joe@ximian.com>
1536 * libsoup/soup-openssl.c (soup_openssl_get_iochannel): Put a
1537 timeout on the select()s when we get SSL_ERROR_WANT_READ/WRITE so
1538 we don't hang forever if we don't get more data.
1540 * libsoup/soup-ssl-proxy.c (main): Don't set our fds to blocking
1541 or else we'll hang forever in SSL_connect() if the other side
1544 * libsoup/soup-queue.c (proxy_https_connect_cb): We never want to
1545 release the connection on message free, even if the connection was
1548 2002-12-03 Joe Shaw <joe@ximian.com>
1550 * libsoup/soup-ssl.c (soup_ssl_get_iochannel_real): Call
1551 g_io_channel_set_close_on_unref() on the second half of the socket
1552 pair so we don't leak file descriptors.
1554 2002-12-03 Frank Belew <frb@ximian.com>
1556 * libsoup/soup-address.c: add signal.h to the list of headers to
1559 2002-11-25 Joe Shaw <joe@ximian.com>
1561 * Makefile.am: Build the tests directory again
1563 2002-11-21 Rodney Dawes <dobey@ximian.com>
1565 * configure.in: Don't require autoconf 2.5x, needs to work with 2.13
1567 2002-11-20 Michael Meeks <michael@ximian.com>
1569 * configure.in: require autoconf 2.52 not 2.53.
1571 2002-11-18 Dan Winship <danw@ximian.com>
1573 * libsoup/soup-address.c (soup_address_hash): Don't use s6_addr32
1574 since it's apparently non-portable. Use s6_addr instead.
1575 (soup_gethostbyaddr): fix a sometimes-uninitialized variable.
1577 * libsoup/soup-error.c: Fix spelling of
1578 SOUP_ERROR_MOVED_PERMANENTLY and its description.
1580 * libsoup/soup-message.c (soup_message_get_request_header, etc):
1581 Remove long-deprecated API.
1583 * libsoup/soup-socket.c (soup_socket_connect): remove unused
1586 * libsoup/soup-openssl.c (soup_openssl_read): Use gsize.
1587 * libsoup/soup-server.c (cgi_read): Likewise
1588 * libsoup/soup-socks.c (soup_socks_write, soup_socks_read):
1590 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Likewise.
1591 * libsoup/soup-transfer.c (soup_transfer_read_cb,
1592 soup_transfer_write_cb): Likewise.
1594 * tests/timeserver.c: Add "-6" to listen on the IPv6 local address
1595 instead of IPv4. (Tested on OS X.)
1597 2002-11-15 Dan Winship <danw@ximian.com>
1599 * libsoup/*: Change old Helix Code refs to Ximian (and update
1602 2002-11-15 Frank Belew <frb@ximian.com>
1604 * tests/Makefile.am: uncomment lines to make timeserver build
1607 2002-11-14 Joe Shaw <joe@ximian.com>
1609 * libsoup/soup-address.c (soup_address_new): When we get an
1610 address from the hash, call our address lookup callback or else
1611 the connection will hang.
1613 2002-11-13 Dan Winship <danw@ximian.com>
1615 * tests/timeserver.c: Oops, commit this.
1617 * tests/Makefile.am (noinst_PROGRAMS): reenable timeserver.
1619 2002-11-13 Joe Shaw <joe@ximian.com>
1621 * libsoup/Makefile.am: Replace the BINDIR define with LIBEXECDIR.
1622 (install-exec-hook): Install libsoup-ssl-proxy into libexecdir
1625 * libsoup/soup-openssl.c (soup_openssl_close): Call SSL_shutdown()
1626 to properly shut down the SSL connection before closing the
1629 * libsoup/soup-ssl-proxy.c (soup_ssl_proxy_readwrite): Close the
1630 iochannels before quitting the main loop.
1632 * tests/Makefile.am: disable building timeserver, the source file
1635 2002-11-12 Dan Winship <danw@ximian.com>
1637 * configure.in: Check for IPv6 support in networking headers.
1639 * libsoup/soup-address.c: Make the internal structure of
1640 SoupAddress entirely private, and make SoupAddress be more like a
1641 hostent and less like a sockaddr. (Ie, make it not have a port
1642 associated with it.) Document undocumented functions. Add
1643 completely-untested support for IPv6.
1644 (soup_address_new_from_sockaddr): New, to parse a sockaddr into a
1645 SoupAddress and a port.
1646 (soup_address_ipv4_any, soup_address_ipv6_any): Return static
1647 addresses corresponding to the IPv6 and IPv6 "any" addresses.
1648 (soup_address_get_canonical_name): Use inet_ntop/inet_ntoa.
1649 (soup_address_make_sockaddr): Now constructs a new sockaddr, which
1650 may be a sockaddr_in or sockaddr_in6.
1651 (soup_address_gethostname, soup_address_gethostaddr): Remove
1652 these. They aren't reliable, especially on multihomed hosts.
1653 (soup_gethostbyname, soup_gethostbyaddr): support IPv6
1654 (soup_address_new): Keep pending lookups in a separate hash table
1655 from completed lookups. Fix a bug when canceling a lookup when
1656 there was more one outstanding request for it.
1657 (soup_address_lookup_in_cache): Removed.
1659 * libsoup/soup-socket.c: Add a port field to SoupSocket (since
1660 it's not in SoupAddress any more).
1661 (soup_socket_connect): Simplify this. Don't use
1662 soup_address_lookup_in_cache, just call soup_address_new, since we
1663 already know the code can deal with the callback being invoked
1665 (soup_socket_new_sync, soup_socket_new): Take a port argument.
1666 (soup_socket_server_new): Take a SoupAddress to use as the local
1667 address to bind to. This lets the caller choose between the IPv4
1668 and IPv6 "any" addresses, and also lets you bind to a single
1669 interface of a multi-homed machine.
1670 (soup_socket_server_accept, soup_socket_server_try_accept): Merge
1673 * libsoup/soup-server.c (soup_server_new): Pass
1674 soup_address_ipv4_any() to soup_socket_server_new().
1676 * libsoup/soup-socks.c (soup_connect_socks_proxy,
1677 soup_socks_write): Fix up for the API changes, but it won't work
1680 * tests/timeserver.c: Another really simple test, for the server
1683 * tests/Makefile.am: build timeserver
1685 2002-11-11 Dan Winship <danw@ximian.com>
1687 * libsoup/soup-address.c: Move the SoupAddress code from
1688 soup-socket.c and soup-socket-unix.c to here.
1690 * libsoup/soup-socket.c: Move the remaining code from
1691 soup-socket-unix.c here.
1693 * libsoup/soup-socket-unix.c: Gone
1695 * tests/get.c: really really trivial test program
1697 * configure.in (AC_OUTPUT):
1698 * Makefile.am (SUBDIRS): add tests/
1700 2002-11-05 Dan Winship <danw@ximian.com>
1702 * Split libsoup out of soup. ChangeLog.old contains the original
1705 * Makefile.am, etc: Fix things up to work with the new directory
1706 layout. Disable docs until we fix them.
1708 * autogen.sh: Use gnome-autogen.sh
1710 * configure.in: Require autoconf 2.53. Remove stuff that was only
1711 needed for httpd or wsdl code. Remove glib1 support. Bump version
1714 * libsoup/Makefile.am: Rename library to libsoup-2.0, put includes
1715 in ${includedir}/soup-2.0
1717 * libsoup/*: Merge soup-0-7 back onto the trunk. Remove
1718 SOAP-specific stuff, Windows support, and other things that
1719 weren't being maintained.
1721 * soup-config.in, soupConf.sh: Kill these. We only support