Browse Source

complain when we hit wsaenobufs on recv or write too.
perhaps this will help us hunt the bug.


svn:r6321

Roger Dingledine 18 years ago
parent
commit
fab1feee26
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/or/buffers.c

+ 8 - 0
src/or/buffers.c

@@ -402,6 +402,10 @@ read_to_buf_impl(int s, size_t at_most, buf_t *buf,
   if (read_result < 0) {
     int e = tor_socket_errno(s);
     if (!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
+#ifdef MS_WINDOWS
+      if (e == WSAENOBUFS)
+        log_warn(LD_NET,"recv() failed: WSAENOBUFS. Not enough ram?");
+#endif
       return -1;
     }
     return 0; /* would block. */
@@ -572,6 +576,10 @@ flush_buf_impl(int s, buf_t *buf, size_t sz, size_t *buf_flushlen)
   if (write_result < 0) {
     int e = tor_socket_errno(s);
     if (!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
+#ifdef MS_WINDOWS
+      if (e == WSAENOBUFS)
+        log_warn(LD_NET,"write() failed: WSAENOBUFS. Not enough ram?");
+#endif
       return -1;
     }
     log_debug(LD_NET,"write() would block, returning.");