]> granicus.if.org Git - libevent/commitdiff
Merge remote-tracking branch 'origin/patches-2.0'
authorNick Mathewson <nickm@torproject.org>
Thu, 18 Aug 2011 02:08:06 +0000 (22:08 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 18 Aug 2011 02:08:06 +0000 (22:08 -0400)
Conflict in buffer.c: the new file-segment logic conflicted with the
solaris sendfile fix.

1  2 
.gitignore
buffer.c
bufferevent-internal.h
bufferevent_ratelim.c

diff --cc .gitignore
Simple merge
diff --cc buffer.c
index df6402e858d10a29f8011a60a3b27e973f97f29a,744c8a9edebd1069de1dd924bdf3cacb6f438c8e..d9ab22c8ae01eecd40beae3302e8c807ae2841a9
+++ b/buffer.c
@@@ -2218,12 -2267,18 +2218,18 @@@ evbuffer_write_sendfile(struct evbuffe
        }
        return (res);
  #elif defined(SENDFILE_IS_SOLARIS)
-       res = sendfile(dest_fd, source_fd, &offset, chain->off);
-       if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
-               /* if this is EAGAIN or EINTR return 0; otherwise, -1 */
-               return (0);
+       {
+               const off_t offset_orig = offset;
 -              res = sendfile(fd, info->fd, &offset, chain->off);
++              res = sendfile(dest_fd, source_fd, &offset, chain->off);
+               if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
+                       if (offset - offset_orig)
+                               return offset - offset_orig;
+                       /* if this is EAGAIN or EINTR and no bytes were
+                        * written, return 0 */
+                       return (0);
+               }
+               return (res);
        }
-       return (res);
  #endif
  }
  #endif
Simple merge
Simple merge