projects
/
p2p-kernel-protocol.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
f1d5f09
)
add support for multiple packets to test server
author
TudorCazangiu
<tudor.cazangiu@gmail.com>
Sat, 2 Jun 2012 13:16:05 +0000
(16:16 +0300)
committer
TudorCazangiu
<tudor.cazangiu@gmail.com>
Sat, 2 Jun 2012 13:16:05 +0000
(16:16 +0300)
test/server/server.c
patch
|
blob
|
history
diff --git
a/test/server/server.c
b/test/server/server.c
index
cf7b245
..
317c9a1
100644
(file)
--- a/
test/server/server.c
+++ b/
test/server/server.c
@@
-47,12
+47,14
@@
int main(int argc, char **argv)
printf("Bound to: %s:%s\n", argv[0], argv[1]);
argv += 2;
printf("Bound to: %s:%s\n", argv[0], argv[1]);
argv += 2;
- err = read(sock, argv[0], sizeof(argv[0]));
- if (err < 0) {
- printf("Error while receiving file %s: %s(%d)\n", argv[0],
- strerror(errno), errno);
- return err;
- }
+ do {
+ err = read(sock, argv[0], sizeof(argv[0]));
+ if (err < 0) {
+ printf("Error while receiving file %s: %s(%d)\n", argv[0],
+ strerror(errno), errno);
+ return err;
+ }
+ } while (err > 0);
printf("Successfully read file %s\n", argv[0]);
printf("Successfully read file %s\n", argv[0]);