mirror of
https://github.com/irssi/irssi.git
synced 2026-08-11 12:53:42 +02:00
Implemented network transmit buffer. If all data couldn't be sent
immediately, it's sent after a small timeout. This cleans up some code with IRC command sending. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@478 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
c6f949ef6f
commit
ee226421f1
8 changed files with 238 additions and 49 deletions
|
|
@ -23,6 +23,7 @@
|
|||
#include "commands.h"
|
||||
#include "network.h"
|
||||
#include "net-nonblock.h"
|
||||
#include "net-sendbuffer.h"
|
||||
#include "line-split.h"
|
||||
#include "settings.h"
|
||||
|
||||
|
|
@ -281,7 +282,7 @@ static void cmd_dcc_chat(const char *data, IRC_SERVER_REC *server)
|
|||
if (server == NULL || !server->connected)
|
||||
cmd_param_error(CMDERR_NOT_CONNECTED);
|
||||
|
||||
if (net_getsockname(server->handle, &own_ip, NULL) == -1)
|
||||
if (net_getsockname(net_sendbuffer_handle(server->handle), &own_ip, NULL) == -1)
|
||||
cmd_param_error(CMDERR_ERRNO);
|
||||
|
||||
port = settings_get_int("dcc_port");
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "signals.h"
|
||||
#include "commands.h"
|
||||
#include "network.h"
|
||||
#include "net-sendbuffer.h"
|
||||
#include "line-split.h"
|
||||
#include "misc.h"
|
||||
#include "settings.h"
|
||||
|
|
@ -541,7 +542,7 @@ static void cmd_dcc_send(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *i
|
|||
lseek(hfile, 0, SEEK_SET);
|
||||
|
||||
/* get the IP address we use with IRC server */
|
||||
if (net_getsockname(chat != NULL ? chat->handle : server->handle, &own_ip, NULL) == -1) {
|
||||
if (net_getsockname(chat != NULL ? chat->handle : net_sendbuffer_handle(server->handle), &own_ip, NULL) == -1) {
|
||||
close(hfile);
|
||||
cmd_param_error(CMDERR_ERRNO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue