diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-02 16:17:30 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-08-02 16:17:30 +0200 |
commit | 6295adad6db050d42d608236fb2ba2e0f455c6a3 (patch) | |
tree | f0debd403d1d3c086b8cbe539a755f6de0de3e77 /src/plugins | |
parent | e29f01b4fb4f87cca68b8485a17559103ac978b5 (diff) | |
download | weechat-6295adad6db050d42d608236fb2ba2e0f455c6a3.zip |
relay: fix number of bytes sent/received on 32-bit systems
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/relay/relay-client.c | 12 | ||||
-rw-r--r-- | src/plugins/relay/relay-client.h | 4 | ||||
-rw-r--r-- | src/plugins/relay/relay-command.c | 2 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index 51df04ec2..690afc7f2 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -1253,9 +1253,9 @@ relay_client_new_with_infolist (struct t_infolist *infolist) new_client->hook_fd = NULL; new_client->last_activity = weechat_infolist_time (infolist, "last_activity"); sscanf (weechat_infolist_string (infolist, "bytes_recv"), - "%lu", &(new_client->bytes_recv)); + "%llu", &(new_client->bytes_recv)); sscanf (weechat_infolist_string (infolist, "bytes_sent"), - "%lu", &(new_client->bytes_sent)); + "%llu", &(new_client->bytes_sent)); new_client->recv_data_type = weechat_infolist_integer (infolist, "recv_data_type"); new_client->send_data_type = weechat_infolist_integer (infolist, "send_data_type"); str = weechat_infolist_string (infolist, "partial_message"); @@ -1554,10 +1554,10 @@ relay_client_add_to_infolist (struct t_infolist *infolist, return 0; if (!weechat_infolist_new_var_time (ptr_item, "last_activity", client->last_activity)) return 0; - snprintf (value, sizeof (value), "%lu", client->bytes_recv); + snprintf (value, sizeof (value), "%llu", client->bytes_recv); if (!weechat_infolist_new_var_string (ptr_item, "bytes_recv", value)) return 0; - snprintf (value, sizeof (value), "%lu", client->bytes_sent); + snprintf (value, sizeof (value), "%llu", client->bytes_sent); if (!weechat_infolist_new_var_string (ptr_item, "bytes_sent", value)) return 0; if (!weechat_infolist_new_var_integer (ptr_item, "recv_data_type", client->recv_data_type)) @@ -1622,8 +1622,8 @@ relay_client_print_log () weechat_log_printf (" end_time. . . . . . . : %ld", ptr_client->end_time); weechat_log_printf (" hook_fd . . . . . . . : 0x%lx", ptr_client->hook_fd); weechat_log_printf (" last_activity . . . . : %ld", ptr_client->last_activity); - weechat_log_printf (" bytes_recv. . . . . . : %lu", ptr_client->bytes_recv); - weechat_log_printf (" bytes_sent. . . . . . : %lu", ptr_client->bytes_sent); + weechat_log_printf (" bytes_recv. . . . . . : %llu", ptr_client->bytes_recv); + weechat_log_printf (" bytes_sent. . . . . . : %llu", ptr_client->bytes_sent); weechat_log_printf (" recv_data_type. . . . : %d (%s)", ptr_client->recv_data_type, relay_client_data_type_string[ptr_client->recv_data_type]); diff --git a/src/plugins/relay/relay-client.h b/src/plugins/relay/relay-client.h index 017c712ea..8ca05ceb4 100644 --- a/src/plugins/relay/relay-client.h +++ b/src/plugins/relay/relay-client.h @@ -93,8 +93,8 @@ struct t_relay_client time_t end_time; /* time of client disconnection */ struct t_hook *hook_fd; /* hook for socket or child pipe */ time_t last_activity; /* time of last byte received/sent */ - unsigned long bytes_recv; /* bytes received from client */ - unsigned long bytes_sent; /* bytes sent to client */ + unsigned long long bytes_recv; /* bytes received from client */ + unsigned long long bytes_sent; /* bytes sent to client */ enum t_relay_client_data_type recv_data_type; /* type recv from client */ enum t_relay_client_data_type send_data_type; /* type sent to client */ char *partial_message; /* partial text message received */ diff --git a/src/plugins/relay/relay-command.c b/src/plugins/relay/relay-command.c index f5b29777c..664c65748 100644 --- a/src/plugins/relay/relay-command.c +++ b/src/plugins/relay/relay-command.c @@ -82,7 +82,7 @@ relay_command_client_list (int full) { weechat_printf (NULL, _(" %s%s%s (%s%s%s), started on: %s, last activity: %s, " - "bytes: %lu recv, %lu sent"), + "bytes: %llu recv, %llu sent"), RELAY_COLOR_CHAT_CLIENT, ptr_client->desc, RELAY_COLOR_CHAT, |