From b457fec36399c1f7de093d5e92bb4fa453b79c86 Mon Sep 17 00:00:00 2001 From: Jakub Sławiński Date: Sun, 5 Feb 2006 15:14:03 +0100 Subject: v0.8 - Fixed: infinite loop after buffering message - Fixed: corrupt packets after closing connections in the stopped state - Fixed: bug in mapping user numbers between afclient and afserver - Fixed: premature close of the service connection - Fixed: invalid buffering when the connection is closing - Added: Multiple tunnels in one afclient<->afserver connection --- src/user_stats_struct.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/user_stats_struct.c') diff --git a/src/user_stats_struct.c b/src/user_stats_struct.c index 33cc8b3..df7ea9a 100644 --- a/src/user_stats_struct.c +++ b/src/user_stats_struct.c @@ -22,6 +22,7 @@ #include #include +#include #include "user_stats_struct.h" @@ -35,6 +36,7 @@ UserStats* UserStats_new() { UserStats* tmp = calloc(1, sizeof(UserStats)); + assert(tmp != NULL); if (tmp == NULL) { return NULL; } @@ -50,9 +52,11 @@ UserStats_new() void UserStats_free(UserStats** us) { + assert(us != NULL); if (us == NULL) { return; } + assert((*us) != NULL); if ((*us) == NULL) { return; } @@ -70,6 +74,7 @@ UserStats_free(UserStats** us) void UserStats_set_lastActivity(UserStats* us, time_t lastActivity) { + assert(us != NULL); if (us == NULL) { return; } @@ -86,6 +91,7 @@ UserStats_set_lastActivity(UserStats* us, time_t lastActivity) void UserStats_set_totalDownloadedBytes(UserStats* us, int totalDownloadedBytes) { + assert(us != NULL); if (us == NULL) { return; } @@ -102,6 +108,7 @@ UserStats_set_totalDownloadedBytes(UserStats* us, int totalDownloadedBytes) void UserStats_set_totalUploadedBytes(UserStats* us, int totalUploadedBytes) { + assert(us != NULL); if (us == NULL) { return; } @@ -118,6 +125,7 @@ UserStats_set_totalUploadedBytes(UserStats* us, int totalUploadedBytes) time_t UserStats_get_lastActivity(UserStats* us) { + assert(us != NULL); if (us == NULL) { return 0; } @@ -134,6 +142,7 @@ UserStats_get_lastActivity(UserStats* us) int UserStats_get_totalDownloadedBytes(UserStats* us) { + assert(us != NULL); if (us == NULL) { return 0; } @@ -150,6 +159,7 @@ UserStats_get_totalDownloadedBytes(UserStats* us) int UserStats_get_totalUploadedBytes(UserStats* us) { + assert(us != NULL); if (us == NULL) { return 0; } @@ -168,6 +178,9 @@ void UserStats_add_download(UserStats* us, int bytes) { time_t now; + + assert(us != NULL); + if (us == NULL) { return; } @@ -218,6 +231,9 @@ void UserStats_add_upload(UserStats* us, int bytes) { time_t now; + + assert(us != NULL); + if (us == NULL) { return; } @@ -267,6 +283,9 @@ double UserStats_get_downloadSpeed(UserStats* us) { time_t now; + + assert(us != NULL); + if (us == NULL) { return 0.0; } @@ -311,6 +330,9 @@ double UserStats_get_uploadSpeed(UserStats* us) { time_t now; + + assert(us != NULL); + if (us == NULL) { return 0.0; } @@ -353,6 +375,7 @@ UserStats_get_uploadSpeed(UserStats* us) void UserStats_clear(UserStats* us) { + assert(us != NULL); if (us == NULL) { return; } -- cgit v1.1