There was an error while loading. Please reload this page.
1 parent 6d3fe27 commit f00b285Copy full SHA for f00b285
TextConferencingLab/LAB1/client.c
@@ -33,6 +33,7 @@ void *receive(void *socketfd_void_p) {
33
fprintf(stderr, "client receive: recv\n");
34
return NULL;
35
}
36
+if (numbytes == 0) continue;
37
buf[numbytes] = 0;
38
//fprintf(stdout, "buf: %s\n", buf);
39
stringToPacket(buf, &packet);
@@ -49,7 +50,7 @@ void *receive(void *socketfd_void_p) {
49
50
} else if (packet.type == QU_ACK) {
51
fprintf(stdout, "User id\t\tSession ids\n%s", packet.data);
52
} else if (packet.type == MESSAGE){
- fprintf(stdout, "%s: %s\n", packet.source, packet.data);
53
+ fprintf(stdout, "%s: %s\n", packet.source, packet.data);
54
} else {
55
fprintf(stdout, "Unexpected packet received: type %d, data %s\n",
56
packet.type, packet.data);
0 commit comments