From: pk910 Date: Wed, 10 Aug 2011 00:49:50 +0000 (+0200) Subject: debug output... X-Git-Tag: v5.3~635 X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=ec69a208027e99296d60d3af50a66b83d1595b85;p=NeonServV5.git debug output... --- diff --git a/ClientSocket.c b/ClientSocket.c index 20ec724..f90403a 100644 --- a/ClientSocket.c +++ b/ClientSocket.c @@ -147,9 +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("ADD 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/IRCParser.c b/IRCParser.c index 5d52923..0bbe797 100644 --- a/IRCParser.c +++ b/IRCParser.c @@ -10,6 +10,7 @@ static void parse_raw(struct ClientSocket *client, char *from, char *cmd, char * int parse_lines(struct ClientSocket *client, char *lines, int len) { int i, startpos = 0; + printf("PARSE: %s %d\n", lines, len); for(i = 0; i < len; i++) { if(lines[i] == '\r') //just zero it out :D lines[i] = 0; @@ -17,6 +18,7 @@ int parse_lines(struct ClientSocket *client, char *lines, int len) { lines[i] = 0; parse_line(client, lines); lines += strlen(lines)+1; + printf("SKIP %d: %s\n", strlen(lines)+1, lines); startpos = i+1; } }