View | Details | Raw Unified | Return to bug 116762
Collapse All | Expand All

(-)libsoup/soup-connection-ntlm.c (-2 / +10 lines)
Lines 28-34 Link Here
28
} SoupConnectionNTLMState;
28
} SoupConnectionNTLMState;
29
29
30
typedef struct {
30
typedef struct {
31
	char *user;
32
	guchar nt_hash[21], lm_hash[21];
31
	guchar nt_hash[21], lm_hash[21];
33
	SoupConnectionNTLMState state;
32
	SoupConnectionNTLMState state;
34
} SoupConnectionNTLMPrivate;
33
} SoupConnectionNTLMPrivate;
Lines 56-62 Link Here
56
{
55
{
57
	SoupConnectionNTLMPrivate *priv = SOUP_CONNECTION_NTLM_GET_PRIVATE (object);
56
	SoupConnectionNTLMPrivate *priv = SOUP_CONNECTION_NTLM_GET_PRIVATE (object);
58
57
59
	g_free (priv->user);
60
	memset (priv->nt_hash, 0, sizeof (priv->nt_hash));
58
	memset (priv->nt_hash, 0, sizeof (priv->nt_hash));
61
	memset (priv->lm_hash, 0, sizeof (priv->lm_hash));
59
	memset (priv->lm_hash, 0, sizeof (priv->lm_hash));
62
60
Lines 161-166 Link Here
161
	    soup_message_get_header (msg->request_headers, "Authorization")) {
159
	    soup_message_get_header (msg->request_headers, "Authorization")) {
162
		/* We just added the last Auth header, so restart it. */
160
		/* We just added the last Auth header, so restart it. */
163
		priv->state = SOUP_CONNECTION_NTLM_SENT_RESPONSE;
161
		priv->state = SOUP_CONNECTION_NTLM_SENT_RESPONSE;
162
163
		/* soup_message_restarted() will call soup_message_io_stop(),
164
		 * which will release the connection, and may cause another
165
		 * message to be queued on the connection before it returns.
166
		 * That's no good, so we stop the message first and then
167
		 * reclaim the connection so that soup_message_restarted()
168
		 * won't be able to steal it.
169
		 */
170
		soup_message_io_stop (msg);
171
		soup_connection_reserve (conn);
164
		soup_message_restarted (msg);
172
		soup_message_restarted (msg);
165
		soup_connection_send_request (conn, msg);
173
		soup_connection_send_request (conn, msg);
166
	}
174
	}
(-)libsoup/soup-connection.c (-4 / +8 lines)
Lines 355-368 Link Here
355
	SoupConnectionPrivate *priv = SOUP_CONNECTION_GET_PRIVATE (conn);
355
	SoupConnectionPrivate *priv = SOUP_CONNECTION_GET_PRIVATE (conn);
356
356
357
	if (priv->cur_req) {
357
	if (priv->cur_req) {
358
		if (!soup_message_is_keepalive (priv->cur_req))
358
		SoupMessage *cur_req = priv->cur_req;
359
			soup_connection_disconnect (conn);
360
		else
361
			priv->last_used = time (NULL);
362
359
363
		g_object_remove_weak_pointer (G_OBJECT (priv->cur_req),
360
		g_object_remove_weak_pointer (G_OBJECT (priv->cur_req),
364
					      (gpointer *)&priv->cur_req);
361
					      (gpointer *)&priv->cur_req);
365
		priv->cur_req = NULL;
362
		priv->cur_req = NULL;
363
364
		if (!soup_message_is_keepalive (cur_req))
365
			soup_connection_disconnect (conn);
366
		else {
367
			priv->last_used = time (NULL);
368
			soup_message_io_stop (cur_req);
369
		}
366
	}
370
	}
367
	priv->in_use = FALSE;
371
	priv->in_use = FALSE;
368
}
372
}
(-)libsoup/soup-message-io.c (-2 / +6 lines)
Lines 128-135 Link Here
128
128
129
	if (io->read_state != SOUP_MESSAGE_IO_STATE_DONE)
129
	if (io->read_state != SOUP_MESSAGE_IO_STATE_DONE)
130
		soup_socket_disconnect (io->sock);
130
		soup_socket_disconnect (io->sock);
131
	else if (io->conn)
131
	else if (io->conn) {
132
		soup_connection_release (io->conn);
132
		SoupConnection *conn = io->conn;
133
		io->conn = NULL;
134
		soup_connection_release (conn);
135
		g_object_unref (conn);
136
	}
133
}
137
}
134
138
135
#define SOUP_MESSAGE_IO_EOL            "\r\n"
139
#define SOUP_MESSAGE_IO_EOL            "\r\n"

Return to bug 116762