1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 07:16:37 +02:00

relay: fix number of bytes sent/received on 32-bit systems

This commit is contained in:
Sébastien Helleu
2014-08-02 16:17:30 +02:00
parent e29f01b4fb
commit 6295adad6d
16 changed files with 39 additions and 38 deletions
+6 -6
View File
@@ -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]);
+2 -2
View File
@@ -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 */
+1 -1
View File
@@ -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,