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/ssl_fd_struct.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/ssl_fd_struct.c') diff --git a/src/ssl_fd_struct.c b/src/ssl_fd_struct.c index 301602f..6522491 100644 --- a/src/ssl_fd_struct.c +++ b/src/ssl_fd_struct.c @@ -19,12 +19,13 @@ */ #include +#include +#include #include "activefor.h" #include "stats.h" #include "logging.h" #include "ssl_fd_struct.h" -#include /* * Function name: SslFd_new @@ -36,6 +37,7 @@ SslFd* SslFd_new() { SslFd* tmp = calloc(1, sizeof(SslFd)); + assert(tmp != NULL); if (tmp == NULL) { return NULL; } @@ -51,9 +53,11 @@ SslFd_new() void SslFd_free(SslFd** sf) { + assert(sf != NULL); if (sf == NULL) { return; } + assert((*sf) != NULL); if ((*sf) == NULL) { return; } @@ -75,6 +79,7 @@ SslFd_free(SslFd** sf) void SslFd_set_fd(SslFd* sf, int fd) { + assert(sf != NULL); if (sf == NULL) { return; } @@ -92,6 +97,7 @@ SslFd_set_fd(SslFd* sf, int fd) void SslFd_set_ssl_general(SslFd* sf, SSL* ssl, int free) { + assert(sf != NULL); if (sf == NULL) { return; } @@ -138,6 +144,7 @@ SslFd_set_ssl_nf(SslFd* sf, SSL* ssl) int SslFd_get_fd(SslFd* sf) { + assert(sf != NULL); if (sf == NULL) { return -1; } @@ -154,6 +161,7 @@ SslFd_get_fd(SslFd* sf) SSL* SslFd_get_ssl(SslFd* sf) { + assert(sf != NULL); if (sf == NULL) { return NULL; } @@ -179,6 +187,9 @@ SslFd_send_message(char type, SslFd* sf, unsigned char* buf, int amount) int length; static unsigned char buffer[9000]; + assert(sf != NULL); + assert(buf != NULL); + if ((sf == NULL) || (buf == NULL)) { return -1; } @@ -246,6 +257,10 @@ SslFd_get_message(char type, SslFd* sf, unsigned char* buf, int amount) int length; unsigned long elen; static unsigned char bufor[9000]; + + assert(sf != NULL); + assert(buf != NULL); + if ((sf == NULL) || (buf == NULL)) { return -1; } @@ -301,6 +316,9 @@ SslFd_swap_content(SslFd* sf1, SslFd* sf2) { int tmpfd; SSL* tmpssl; + + assert(sf1 != NULL); + assert(sf2 != NULL); tmpfd = SslFd_get_fd(sf1); tmpssl = SslFd_get_ssl(sf2); -- cgit v1.1