aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library.js2
-rw-r--r--tests/websockets.c2
-rw-r--r--tests/websockets_bi.c2
-rw-r--r--tests/websockets_bi_bigdata.c2
-rw-r--r--tests/websockets_bi_listener.c2
-rw-r--r--tests/websockets_gethostbyname.c2
6 files changed, 6 insertions, 6 deletions
diff --git a/src/library.js b/src/library.js
index cb892251..4cce7184 100644
--- a/src/library.js
+++ b/src/library.js
@@ -7023,7 +7023,7 @@ LibraryManager.library = {
if (!info) return -1;
if (info.inQueue.length == 0) {
___setErrNo(ERRNO_CODES.EAGAIN); // no data, and all sockets are nonblocking, so this is the right behavior
- return 0; // should this be -1 like the spec says?
+ return -1;
}
var buffer = info.inQueue.shift();
#if SOCKET_DEBUG
diff --git a/tests/websockets.c b/tests/websockets.c
index 57549e94..59acbd69 100644
--- a/tests/websockets.c
+++ b/tests/websockets.c
@@ -50,7 +50,7 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
}
}
- if(n < 0) {
+ if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
fprintf(stderr, "error in get_all_buf!");
exit(EXIT_FAILURE);
}
diff --git a/tests/websockets_bi.c b/tests/websockets_bi.c
index c2dbb7da..18cdd664 100644
--- a/tests/websockets_bi.c
+++ b/tests/websockets_bi.c
@@ -35,7 +35,7 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
}
}
- if(n < 0) {
+ if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
fprintf(stderr, "error in get_all_buf!");
exit(EXIT_FAILURE);
}
diff --git a/tests/websockets_bi_bigdata.c b/tests/websockets_bi_bigdata.c
index 5db2c951..2039f83c 100644
--- a/tests/websockets_bi_bigdata.c
+++ b/tests/websockets_bi_bigdata.c
@@ -37,7 +37,7 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
}
}
- if(n < 0) {
+ if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
fprintf(stderr, "error in get_all_buf!");
exit(EXIT_FAILURE);
}
diff --git a/tests/websockets_bi_listener.c b/tests/websockets_bi_listener.c
index 587fbed2..6c3b17b1 100644
--- a/tests/websockets_bi_listener.c
+++ b/tests/websockets_bi_listener.c
@@ -35,7 +35,7 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
}
}
- if(n < 0) {
+ if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
fprintf(stderr, "error in get_all_buf!");
exit(EXIT_FAILURE);
}
diff --git a/tests/websockets_gethostbyname.c b/tests/websockets_gethostbyname.c
index 6b8777f1..cba2c635 100644
--- a/tests/websockets_gethostbyname.c
+++ b/tests/websockets_gethostbyname.c
@@ -35,7 +35,7 @@ unsigned int get_all_buf(int sock, char* output, unsigned int maxsize)
}
}
- if(n < 0) {
+ if(n < 0 && errno != EAGAIN && errno != EWOULDBLOCK) {
fprintf(stderr, "error in get_all_buf!");
exit(EXIT_FAILURE);
}