summaryrefslogtreecommitdiff
path: root/src/plugins/xfer/xfer-network.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-11-27 22:45:22 +0100
committerSebastien Helleu <flashcode@flashtux.org>2012-11-27 22:45:22 +0100
commit37a3001dc7d59c8f91ac3140c7f883e9f5892733 (patch)
tree2f72e5dfffb7abdb01d7582ead76ba51a4b70b67 /src/plugins/xfer/xfer-network.c
parent9c3ee3c4074cb18a351ea6add554dc48ffa3a1b1 (diff)
downloadweechat-37a3001dc7d59c8f91ac3140c7f883e9f5892733.zip
xfer: display remote IP address for DCC chat/file (task #12289) (patch from Nils Görs)
Diffstat (limited to 'src/plugins/xfer/xfer-network.c')
-rw-r--r--src/plugins/xfer/xfer-network.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c
index 9580bf073..e33612f67 100644
--- a/src/plugins/xfer/xfer-network.c
+++ b/src/plugins/xfer/xfer-network.c
@@ -215,6 +215,22 @@ xfer_network_send_file_fork (struct t_xfer *xfer)
_exit (EXIT_SUCCESS);
}
+ weechat_printf (NULL,
+ _("%s: sending file to %s (%ld.%ld.%ld.%ld, %s.%s), "
+ "name: %s (local filename: %s), %llu bytes (protocol: %s)"),
+ XFER_PLUGIN_NAME,
+ xfer->remote_nick,
+ xfer->remote_address >> 24,
+ (xfer->remote_address >> 16) & 0xff,
+ (xfer->remote_address >> 8) & 0xff,
+ xfer->remote_address & 0xff,
+ xfer->plugin_name,
+ xfer->plugin_id,
+ xfer->filename,
+ xfer->local_filename,
+ xfer->size,
+ xfer_protocol_string[xfer->protocol]);
+
/* parent process */
xfer->child_pid = pid;
close (xfer->child_write);
@@ -364,7 +380,7 @@ xfer_network_fd_cb (void *arg_xfer, int fd)
xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
return WEECHAT_RC_OK;
}
- xfer->address = ntohl (addr.sin_addr.s_addr);
+ xfer->remote_address = ntohl (addr.sin_addr.s_addr);
xfer->status = XFER_STATUS_ACTIVE;
xfer->start_transfer = time (NULL);
xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
@@ -406,7 +422,7 @@ xfer_network_fd_cb (void *arg_xfer, int fd)
xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
return WEECHAT_RC_OK;
}
- xfer->address = ntohl (addr.sin_addr.s_addr);
+ xfer->remote_address = ntohl (addr.sin_addr.s_addr);
xfer->status = XFER_STATUS_ACTIVE;
xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
xfer->hook_fd = weechat_hook_fd (xfer->sock,
@@ -506,8 +522,8 @@ xfer_network_connect (struct t_xfer *xfer)
flags = 0;
if (fcntl (xfer->sock, F_SETFL, flags | O_NONBLOCK) == -1)
return 0;
- weechat_network_connect_to (xfer->proxy, xfer->sock, xfer->address,
- xfer->port);
+ weechat_network_connect_to (xfer->proxy, xfer->sock,
+ xfer->remote_address, xfer->port);
xfer->hook_fd = weechat_hook_fd (xfer->sock,
1, 0, 0,