If the auth status is PENDING, return an NTLM request string. Otherwise
authorDan Winship <danw@src.gnome.org>
Fri, 9 May 2003 15:25:33 +0000 (15:25 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 9 May 2003 15:25:33 +0000 (15:25 +0000)
commit533577bf6c699798c622aa84efd21a3d377958a9
tree68615eb9ab2d7d3e12cd7a5835d7c7d53e06b9be
parent9fad830652629e64ebf58f9ffe59bc017cc36c92
If the auth status is PENDING, return an NTLM request string. Otherwise

* libsoup/soup-auth.c (ntlm_auth): If the auth status is PENDING,
return an NTLM request string. Otherwise return the "response"
field (which should include the NTLM authenticate message)
(ntlm_init): Don't bother setting "response" to the NTLM request
string. Just leave it NULL in that case.

* libsoup/soup-message.c (authorize_handler): Never try to reuse
an NTLM auth returned from soup_auth_lookup. Only set the auth on
the connection when it's SOUP_AUTH_STATUS_SUCCESSFUL. Otherwise,
call soup_auth_set_context() on it just like for non-NTLM auth.
The net effect of all of this is that now we record when a context
needs NTLM auth just like with non-NTLM auth, so that that info
gets preserved across connections.
(soup_message_requeue): No longer need the hackery here to
preserve the connection auth state.

* libsoup/soup-context.c (soup_connection_set_in_use): New, to
toggle the connection's in_use flag, and set up the death watch
when it's not in use.
(connection_death): This is only hooked up when the connection is
not in use now, so don't need to check that. Should fix the
infinite connection_death loop.
(soup_connection_is_new): Keep a distinct "new" flag rather than
defining "new" as "has been released at least once".
(soup_connection_set_used): Mark a connection no-longer new.
(soup_context_connect_cb): Mark the connection as new. Don't set
up the death watch since it's in_use.
(try_existing_connections): Use soup_connection_set_in_use.
(soup_connection_release): Likewise

* libsoup/soup-message.c (requeue_read_finished): Call
soup_connection_set_used so that the connection isn't still
considered new when we send the message the second time.

* libsoup/soup-queue.c (soup_queue_error_cb): Call
soup_connection_set_used (assuming we don't close the connection)
(soup_queue_read_done_cb): Likewise.

* libsoup/soup-transfer.c (soup_transfer_read_cb): If we read
nothing, call soup_transfer_read_error_cb rather than just
cancelling, or else it will get cancelled again later.
ChangeLog
libsoup/soup-auth.c
libsoup/soup-context.c
libsoup/soup-context.h
libsoup/soup-message.c
libsoup/soup-private.h
libsoup/soup-queue.c
libsoup/soup-transfer.c