mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 06:26:15 +01:00
Merge branch 'benzea/fix-socks-eof' into 'master'
gsocks5proxy: Handle EOF when reading from a stream See merge request GNOME/glib!2032
This commit is contained in:
commit
4854cf8796
@ -717,6 +717,16 @@ nego_reply_read_cb (GObject *source,
|
||||
return;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CONNECTION_CLOSED,
|
||||
"Connection to SOCKSv5 proxy server lost");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
data->offset += read;
|
||||
|
||||
if (data->offset == data->length)
|
||||
@ -821,6 +831,16 @@ auth_reply_read_cb (GObject *source,
|
||||
return;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CONNECTION_CLOSED,
|
||||
"Connection to SOCKSv5 proxy server lost");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
data->offset += read;
|
||||
|
||||
if (data->offset == data->length)
|
||||
@ -923,6 +943,16 @@ connect_reply_read_cb (GObject *source,
|
||||
return;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CONNECTION_CLOSED,
|
||||
"Connection to SOCKSv5 proxy server lost");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
data->offset += read;
|
||||
|
||||
if (data->offset == data->length)
|
||||
@ -983,6 +1013,16 @@ connect_addr_len_read_cb (GObject *source,
|
||||
return;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CONNECTION_CLOSED,
|
||||
"Connection to SOCKSv5 proxy server lost");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
data->length = data->buffer[0] + 2;
|
||||
data->offset = 0;
|
||||
|
||||
@ -1009,6 +1049,16 @@ connect_addr_read_cb (GObject *source,
|
||||
return;
|
||||
}
|
||||
|
||||
if (read == 0)
|
||||
{
|
||||
g_task_return_new_error (task,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_CONNECTION_CLOSED,
|
||||
"Connection to SOCKSv5 proxy server lost");
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
data->offset += read;
|
||||
|
||||
if (data->offset == data->length)
|
||||
|
Loading…
Reference in New Issue
Block a user