Changeset: 771a2d5a9079 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=771a2d5a9079
Modified Files:
        common/stream/stream.c
Branch: Apr2019
Log Message:

Check for timeout after check for error and only if no data.
Also, implement the check for the timeout function in accordance with
the comment (no function is equivalent to a function returning true).
This does the same as what the patch in bug 4056 does.


diffs (26 lines):

diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2524,16 +2524,17 @@ socket_read(stream *restrict s, void *re
                                s->stream_data.s + 1,
 #endif
                                &fds, NULL, NULL, &tv);
-                       if (s->timeout_func && s->timeout_func()) {
-                               s->errnr = MNSTR_TIMEOUT;
-                               return -1;
-                       }
                        if (ret == SOCKET_ERROR) {
                                s->errnr = MNSTR_READ_ERROR;
                                return -1;
                        }
-                       if (ret == 0)
+                       if (ret == 0) {
+                               if (s->timeout_func == NULL || 
s->timeout_func()) {
+                                       s->errnr = MNSTR_TIMEOUT;
+                                       return -1;
+                               }
                                continue;
+                       }
                        assert(ret == 1);
                        assert(FD_ISSET(s->stream_data.s, &fds));
                }
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to