1 --- apache_1.3.12/src/main/buff.c~ Sun Feb 27 07:16:27 2000
2 +++ apache_1.3.12/src/main/buff.c Sun Feb 27 07:39:15 2000
3 @@ -1133,6 +1133,102 @@
7 +/* The SGI Performance patch replaces writev_it_all by ap_bwritev
8 + * We don't want this, as it breaks mod_ssl ... the code is commented
11 + * static int writev_it_all(BUFF *fb, struct iovec *vec, int nvec)
13 + * return (ap_bwritev(fb, vec, nvec) >= 0) ? 0 : -1;
19 + * Write data using writev() if available, write() otherwise.
20 + * Returns number of bytes written or -1 on error.
21 + * Note that it may modify iov;
24 +ap_bwritev(BUFF *fb, struct iovec *iov, int iovcnt)
28 + if ((fb->flags & (B_EOUT | B_WRERR | B_WR)) == B_WR) {
35 + for (i = 0; i < iovcnt; i++)
36 + len += iov[i].iov_len;
41 + w = (iovcnt > 1) ? (int) writev(fb->fd, iov, iovcnt) :
42 + (int) write(fb->fd, iov->iov_base, iov->iov_len);
45 + fb->bytes_sent += w;
49 + break; /* shortcut the common case */
51 + while (w > iov[0].iov_len) {
52 + w -= iov[0].iov_len;
56 + iov[0].iov_base = (char *) iov[0].iov_base + w;
57 + iov[0].iov_len -= w;
58 + } else if (errno != EINTR && errno != EAGAIN) {
64 + if (fb->flags & B_EOUT) { /* set asynchronously */
73 + for (i = 0; i < iovcnt; i++) {
74 + while (iov[i].iov_len > 0) {
77 + w = write(fb->fd, iov[i].iov_base, iov[i].iov_len);
80 + fb->bytes_sent += w;
81 + iov[i].iov_base = (char *) iov[i].iov_base + w;
82 + iov[i].iov_len -= w;
83 + } else if (errno != EINTR && errno != EAGAIN) {
89 + if (fb->flags & B_EOUT) { /* set asynchronously */
103 /* A wrapper for buff_write which deals with error conditions and
104 * bytes_sent. Also handles non-blocking writes.