From: pk910 Date: Wed, 10 Aug 2011 00:39:13 +0000 (+0200) Subject: added some debug output X-Git-Tag: v5.3~639 X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=4e142107885890558cea13225f76a320e1647184;p=NeonServV5.git added some debug output --- diff --git a/ClientSocket.c b/ClientSocket.c index 37a5ebd..c071e1c 100644 --- a/ClientSocket.c +++ b/ClientSocket.c @@ -147,10 +147,13 @@ void socket_loop(int timeout_seconds) { sock->buffer[sock->bufferpos + i] = buffer[i]; } sock->bufferpos += i; + sock->buffer[sock->bufferpos] = 0; //debug only + printf("BUFFER: %s\n", sock->buffer); } } else { bytes = read(sock->sock, sock->buffer, sizeof(sock->buffer)); sock->buffer[bytes] = 0; //debug only + printf("BUFFER: %s\n", sock->buffer); if(bytes > 0) sock->bufferpos = bytes; } diff --git a/ClientSocket.h b/ClientSocket.h index 55f4625..39118ec 100644 --- a/ClientSocket.h +++ b/ClientSocket.h @@ -29,6 +29,6 @@ int connect_socket(struct ClientSocket *client); int close_socket(struct ClientSocket *client); int write_socket(struct ClientSocket *client, char* msg, int len); void socket_loop(int timeout_seconds); -void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(1, 2); +void putsock(struct ClientSocket *client, const char *text, ...) PRINTF_LIKE(2, 3); #endif \ No newline at end of file