Commit e05bf8cf authored by Junker's avatar Junker
Browse files

fix uploading large files (#3)

parent 578772e4
......@@ -292,9 +292,27 @@ static void jabber_hfu_xfer_cancel_send(PurpleXfer *xfer)
static gssize jabber_hfu_xfer_write(const guchar *buffer, size_t len, PurpleXfer *xfer)
{
gssize len;
HFUXfer *hfux = purple_xfer_get_protocol_data(xfer);
return purple_ssl_write(hfux->ssl_conn, buffer, len);
len = purple_ssl_write(hfux->ssl_conn, buffer, len);
if (len == -1)
{
if (purple_xfer_get_bytes_sent(xfer) >= purple_xfer_get_size(xfer))
purple_xfer_set_completed(xfer, TRUE);
if ((errno != EAGAIN) && (errno != EINTR))
return -1;
return 0;
}
if ((purple_xfer_get_bytes_sent(xfer) + len) >= purple_xfer_get_size(xfer))
purple_xfer_set_completed(xfer, TRUE);
return len;
}
static void jabber_hfu_xfer_init(PurpleXfer *xfer)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment