diff options
author | Alex Graveley <alex@ximian.com> | 2001-10-17 18:03:22 +0000 |
---|---|---|
committer | Alex Graveley <orph@src.gnome.org> | 2001-10-17 18:03:22 +0000 |
commit | 79c0ad6b0b968bff5e1090360fa682f212f0afab (patch) | |
tree | 4a01692013cfc69008e433938fa0f28265829e03 /libsoup/soup-queue.c | |
parent | 92c258d44f80575e88b367bd895c6ee70e2d44f7 (diff) | |
download | libsoup-79c0ad6b0b968bff5e1090360fa682f212f0afab.tar.gz |
Add some bounds checking.
2001-10-17 Alex Graveley <alex@ximian.com>
* src/libsoup/soup-transfer.c (remove_block_at_index): Add some
bounds checking.
* src/libsoup/soup-queue.c (soup_queue_connect_cb): Handle
iochannel creation failure which can happen when using SSL.
Diffstat (limited to 'libsoup/soup-queue.c')
-rw-r--r-- | libsoup/soup-queue.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libsoup/soup-queue.c b/libsoup/soup-queue.c index 3cea04e4..b26f71ba 100644 --- a/libsoup/soup-queue.c +++ b/libsoup/soup-queue.c @@ -433,7 +433,28 @@ soup_queue_connect_cb (SoupContext *ctx, } channel = soup_connection_get_iochannel (conn); - overwrt = req->priv->msg_flags & SOUP_MESSAGE_OVERWRITE_CHUNKS; + if (!channel) { + gchar *phrase; + + if (proto == SOUP_PROTOCOL_HTTPS) + phrase = "Unable to create secure data channel"; + else + phrase = "Unable to create data channel"; + + if (ctx != req->context) + soup_message_set_error_full ( + req, + SOUP_ERROR_CANT_CONNECT_PROXY, + phrase); + else + soup_message_set_error_full ( + req, + SOUP_ERROR_CANT_CONNECT, + phrase); + + soup_message_issue_callback (req); + return; + } if (req->priv->req_header) { g_string_free (req->priv->req_header, TRUE); @@ -451,6 +472,8 @@ soup_queue_connect_cb (SoupContext *ctx, soup_queue_error_cb, req); + overwrt = req->priv->msg_flags & SOUP_MESSAGE_OVERWRITE_CHUNKS; + req->priv->read_tag = soup_transfer_read (channel, overwrt, |