debug output...
authorpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 00:49:50 +0000 (02:49 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 00:49:50 +0000 (02:49 +0200)
ClientSocket.c
IRCParser.c

index 20ec7246a92af4bf506fc6fa59db7bcf986f2946..f90403a026ed2d9401ec059d4dcd26fa6fa271c7 100644 (file)
@@ -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;
             }
index 5d52923b91b527602c7d9787ba678932fa430025..0bbe7975b13536b1645cd9843e487389ea94534f 100644 (file)
@@ -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;
         }
     }