diff options
-rw-r--r-- | src/plugins/xfer/xfer-network.c | 2 | ||||
-rw-r--r-- | src/plugins/xfer/xfer.c | 23 | ||||
-rw-r--r-- | src/plugins/xfer/xfer.h | 4 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c index 4e1e13e0a..8f7609bb3 100644 --- a/src/plugins/xfer/xfer-network.c +++ b/src/plugins/xfer/xfer-network.c @@ -523,7 +523,7 @@ xfer_network_fd_cb (const void *pointer, void *data, int fd) if (xfer->status == XFER_STATUS_CONNECTING) { - if (XFER_IS_PASSIVE(xfer->type)) + if (XFER_IS_FILE_PASSIVE(xfer->type)) { xfer->last_activity = time (NULL); sock = accept (xfer->sock, diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c index aaa13680a..317cd4277 100644 --- a/src/plugins/xfer/xfer.c +++ b/src/plugins/xfer/xfer.c @@ -702,7 +702,7 @@ xfer_new (const char *plugin_name, const char *plugin_id, new_xfer->remote_address_str = strdup (""); } - if (XFER_IS_PASSIVE(type)) + if (XFER_IS_FILE_PASSIVE(type) || (type == XFER_TYPE_CHAT_SEND)) { rc = getnameinfo ((struct sockaddr *)local_address, local_address_length, str_address, sizeof (str_address), NULL, 0, NI_NUMERICHOST); @@ -1102,7 +1102,8 @@ xfer_add_cb (const void *pointer, void *data, } } - if (XFER_IS_RECV(type)) + if ((type == XFER_TYPE_FILE_RECV_ACTIVE) + || (type == XFER_TYPE_FILE_RECV_PASSIVE)) { filename2 = strdup (filename); sscanf (weechat_infolist_string (infolist, "size"), "%llu", &file_size); @@ -1203,7 +1204,7 @@ xfer_add_cb (const void *pointer, void *data, goto error; } } - if (XFER_IS_PASSIVE(type)) + if (XFER_IS_FILE_PASSIVE(type) || (type == XFER_TYPE_CHAT_SEND)) { memset (&bind_addr, 0, sizeof (bind_addr)); @@ -1351,7 +1352,8 @@ xfer_add_cb (const void *pointer, void *data, } } - if (XFER_IS_RECV(type)) + if ((type == XFER_TYPE_FILE_RECV_ACTIVE) + || (type == XFER_TYPE_FILE_RECV_PASSIVE)) { if (filename2) { @@ -1365,14 +1367,19 @@ xfer_add_cb (const void *pointer, void *data, { ptr_xfer = xfer_new (plugin_name, plugin_id, type, protocol, remote_nick, local_nick, charset_modifier, - short_filename, file_size, proxy, remote_addr, - remote_addr_length, local_addr, local_addr_length, port, sock, filename2, token); + short_filename, file_size, proxy, + remote_addr, remote_addr_length, + local_addr, local_addr_length, + port, sock, filename2, token); } else { ptr_xfer = xfer_new (plugin_name, plugin_id, type, protocol, - remote_nick, local_nick, charset_modifier, NULL, - 0, proxy, NULL, 0, local_addr, local_addr_length, port, sock, NULL, token); + remote_nick, local_nick, charset_modifier, + NULL, 0, proxy, + remote_addr, remote_addr_length, + local_addr, local_addr_length, + port, sock, NULL, token); } if (!ptr_xfer) diff --git a/src/plugins/xfer/xfer.h b/src/plugins/xfer/xfer.h index fd213f6a8..554eb4390 100644 --- a/src/plugins/xfer/xfer.h +++ b/src/plugins/xfer/xfer.h @@ -133,8 +133,8 @@ enum t_xfer_hash_status (type == XFER_TYPE_CHAT_SEND)) #define XFER_IS_ACTIVE(type) ((type == XFER_TYPE_FILE_RECV_ACTIVE) || \ (type == XFER_TYPE_FILE_SEND_ACTIVE)) -#define XFER_IS_PASSIVE(type) ((type == XFER_TYPE_FILE_RECV_PASSIVE) || \ - (type == XFER_TYPE_FILE_SEND_PASSIVE)) +#define XFER_IS_FILE_PASSIVE(type) ((type == XFER_TYPE_FILE_RECV_PASSIVE) || \ + (type == XFER_TYPE_FILE_SEND_PASSIVE)) #define XFER_HAS_ENDED(status) ((status == XFER_STATUS_DONE) || \ (status == XFER_STATUS_FAILED) || \ |