summaryrefslogtreecommitdiff
path: root/libpurple/protocols/oscar/peer.c
diff options
context:
space:
mode:
authorMark Doliner <markdoliner@pidgin.im>2007-09-07 06:09:42 +0000
committerMark Doliner <markdoliner@pidgin.im>2007-09-07 06:09:42 +0000
commitc06b2dc9b733e4e4ca284c1cf211913e4b7f79d3 (patch)
tree1c800aa72afe64719d9afad1fcc8fa51eb58400c /libpurple/protocols/oscar/peer.c
parenta0735915133a47fb98f2611d8bf1fbd1dc761413 (diff)
downloadpidgin-c06b2dc9b733e4e4ca284c1cf211913e4b7f79d3.tar.gz
AIM 6, when sending a file through a proxy, requires that it receive
an entire OFT frame at once. When I was testing the frame was almost always fragmented. So work around it by jumping to the front of the circbuffer when we're able to. See the length comment for more detail.
Diffstat (limited to 'libpurple/protocols/oscar/peer.c')
-rw-r--r--libpurple/protocols/oscar/peer.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libpurple/protocols/oscar/peer.c b/libpurple/protocols/oscar/peer.c
index 42c4c95194..a41e337183 100644
--- a/libpurple/protocols/oscar/peer.c
+++ b/libpurple/protocols/oscar/peer.c
@@ -416,6 +416,25 @@ send_cb(gpointer data, gint source, PurpleInputCondition cond)
{
purple_input_remove(conn->watcher_outgoing);
conn->watcher_outgoing = 0;
+ /*
+ * The buffer is currently empty, so reset the current input
+ * and output positions to the start of the buffer. We do
+ * this so that the next chunk of data that we put into the
+ * buffer can be read back out of the buffer in one fell swoop.
+ * Otherwise it gets fragmented and we have to read from the
+ * second half of the buffer than go back and read the rest of
+ * the chunk from the first half.
+ *
+ * We're using TCP, which is a stream based protocol, so this
+ * isn't supposed to matter. However, experience has shown
+ * that at least the proxy file transfer code in AIM 6.1.41.2
+ * requires that the entire OFT frame arrive all at once. If
+ * the frame is fragmented then AIM freaks out and aborts the
+ * file transfer. Somebody should teach those guys how to
+ * write good TCP code.
+ */
+ conn->buffer_outgoing->inptr = conn->buffer_outgoing->buffer;
+ conn->buffer_outgoing->outptr = conn->buffer_outgoing->buffer;
return;
}