summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/irc/dcc/dcc-chat.c7
-rw-r--r--src/irc/dcc/dcc.c2
-rw-r--r--src/irc/dcc/dcc.h1
3 files changed, 7 insertions, 3 deletions
diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c
index 8cae1265..173d48b1 100644
--- a/src/irc/dcc/dcc-chat.c
+++ b/src/irc/dcc/dcc-chat.c
@@ -40,9 +40,8 @@ void dcc_chat_send(DCC_REC *dcc, const char *data)
g_return_if_fail(dcc != NULL);
g_return_if_fail(data != NULL);
- /* FIXME: we need output queue! */
- net_transmit(dcc->handle, data, strlen(data));
- net_transmit(dcc->handle, "\n", 1);
+ net_sendbuffer_send(dcc->sendbuf, data, strlen(data));
+ net_sendbuffer_send(dcc->sendbuf, "\n", 1);
}
/* If `item' is a query of a =nick, return DCC chat record of nick */
@@ -204,6 +203,7 @@ static void dcc_chat_listen(DCC_REC *dcc)
dcc->starttime = time(NULL);
dcc->handle = handle;
+ dcc->sendbuf = net_sendbuffer_create(handle, 0);
memcpy(&dcc->addr, &ip, sizeof(IPADDR));
net_ip2host(&dcc->addr, dcc->addrstr);
dcc->port = port;
@@ -228,6 +228,7 @@ static void sig_chat_connected(DCC_REC *dcc)
/* connect ok. */
g_source_remove(dcc->tagconn);
dcc->starttime = time(NULL);
+ dcc->sendbuf = net_sendbuffer_create(dcc->handle, 0);
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
(GInputFunction) dcc_chat_input, dcc);
diff --git a/src/irc/dcc/dcc.c b/src/irc/dcc/dcc.c
index eca81507..62665ff7 100644
--- a/src/irc/dcc/dcc.c
+++ b/src/irc/dcc/dcc.c
@@ -22,6 +22,7 @@
#include "signals.h"
#include "commands.h"
#include "network.h"
+#include "net-sendbuffer.h"
#include "line-split.h"
#include "settings.h"
@@ -113,6 +114,7 @@ void dcc_destroy(DCC_REC *dcc)
if (dcc->tagconn != -1) g_source_remove(dcc->tagconn);
if (dcc->tagread != -1) g_source_remove(dcc->tagread);
if (dcc->tagwrite != -1) g_source_remove(dcc->tagwrite);
+ if (dcc->sendbuf != NULL) net_sendbuffer_destroy(dcc->sendbuf, FALSE);
if (dcc->type == DCC_TYPE_CHAT)
line_split_free((LINEBUF_REC *) dcc->databuf);
diff --git a/src/irc/dcc/dcc.h b/src/irc/dcc/dcc.h
index 91694a24..cfd5b932 100644
--- a/src/irc/dcc/dcc.h
+++ b/src/irc/dcc/dcc.h
@@ -41,6 +41,7 @@ typedef struct DCC_REC {
long size, transfd, skipped; /* file size / bytes transferred / skipped at start */
int handle; /* socket handle */
+ void *sendbuf;
int tagconn, tagread, tagwrite;
int fhandle; /* file handle */
time_t starttime; /* transfer start time */