From dc8bd638e395eada4cdea03c5f1a1c28d506f003 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 21 Nov 2002 17:48:40 +0000 Subject: Irssi now uses 64bit file offets if it's only supported by system. Also did a few changes to DCC so that it should be possible to send >4GB files. DCC protocol uses 32bit "n bytes transferred" notifications, so I had to bend the protocol a bit to allow 64bit files by truncating the value to lowest 32bits. I'm not sure how other clients handle those notifications, but irssi uses it only to figure out when the DCC SEND transfer is complete, so it's quite safe to assume that if we've managed to write() all the bytes and we receive the last 32bit of file size, it means the total file size instead of the total - (n+1)*4GB. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3018 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/irc/dcc/dcc-get.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/irc/dcc/dcc-get.c') diff --git a/src/irc/dcc/dcc-get.c b/src/irc/dcc/dcc-get.c index e8847698..9340645d 100644 --- a/src/irc/dcc/dcc-get.c +++ b/src/irc/dcc/dcc-get.c @@ -89,7 +89,7 @@ void dcc_get_send_received(GET_DCC_REC *dcc) { guint32 recd; - recd = (guint32) htonl(dcc->transfd); + recd = (guint32) htonl(dcc->transfd & 0xffffffff); memcpy(dcc->count_buf, &recd, 4); dcc->count_pos = @@ -133,7 +133,7 @@ static void sig_dccget_send(GET_DCC_REC *dcc) } memcpy(&recd, dcc->count_buf, 4); - if (recd != (guint32) htonl(dcc->transfd)) + if (recd != (guint32) htonl(dcc->transfd & 0xffffffff)) dcc_get_send_received(dcc); } @@ -323,7 +323,7 @@ static void ctcp_msg_dcc_send(IRC_SERVER_REC *server, const char *data, char **params, *fname; int paramcount, fileparams; int port, len, quoted = FALSE; - long size; + uoff_t size; /* SEND
[...] */ params = g_strsplit(data, " ", -1); @@ -341,7 +341,7 @@ static void ctcp_msg_dcc_send(IRC_SERVER_REC *server, const char *data, address = params[fileparams]; dcc_str2ip(address, &ip); port = atoi(params[fileparams+1]); - size = atol(params[fileparams+2]); + size = str_to_uofft(params[fileparams+2]); params[fileparams] = NULL; fname = g_strjoinv(" ", params); -- cgit v1.2.3