added some debug output
authorpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 00:39:13 +0000 (02:39 +0200)
committerpk910 <philipp@zoelle1.de>
Wed, 10 Aug 2011 00:39:13 +0000 (02:39 +0200)
ClientSocket.c
ClientSocket.h

index 37a5ebd7e75a31b3b4410f3a00cf247b7637e4c0..c071e1cfbd31db235a34a39037d8694dbe16d089 100644 (file)
@@ -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;
             }
index 55f4625784b3a25bf34b5ffbd541c6574f9d6752..39118ec51e57e526ccb42a84a6257f94da7d59f2 100644 (file)
@@ -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