diff options
author | mnag <mnag@FreeBSD.org> | 2007-09-23 07:13:47 +0800 |
---|---|---|
committer | mnag <mnag@FreeBSD.org> | 2007-09-23 07:13:47 +0800 |
commit | 0e97e4637f6a4a8770e4058207ede7cd1170e4d4 (patch) | |
tree | 905948edd82aeb7caedb13d241f59742ed526dd7 /www | |
parent | 0f6c4f163b62de58cdd266ddbdc977fa2c134278 (diff) | |
download | freebsd-ports-gnome-0e97e4637f6a4a8770e4058207ede7cd1170e4d4.tar.gz freebsd-ports-gnome-0e97e4637f6a4a8770e4058207ede7cd1170e4d4.tar.zst freebsd-ports-gnome-0e97e4637f6a4a8770e4058207ede7cd1170e4d4.zip |
- Respect EAGAIN and retry sendfile() instead close connection.
- Remove empty lines and add two more cases to switch(errno)
- Bump PORTREVISION
Diffstat (limited to 'www')
-rw-r--r-- | www/lighttpd/Makefile | 1 | ||||
-rw-r--r-- | www/lighttpd/files/patch-src__network_freebsd_sendfile.c | 47 |
2 files changed, 48 insertions, 0 deletions
diff --git a/www/lighttpd/Makefile b/www/lighttpd/Makefile index 04ef381e85ef..60294f51b2ea 100644 --- a/www/lighttpd/Makefile +++ b/www/lighttpd/Makefile @@ -7,6 +7,7 @@ PORTNAME= lighttpd PORTVERSION= 1.4.18 +PORTREVISION= 1 CATEGORIES= www MASTER_SITES= http://www.lighttpd.net/download/ \ http://mirrors.cat.pdx.edu/lighttpd/ diff --git a/www/lighttpd/files/patch-src__network_freebsd_sendfile.c b/www/lighttpd/files/patch-src__network_freebsd_sendfile.c new file mode 100644 index 000000000000..cfa1f1083818 --- /dev/null +++ b/www/lighttpd/files/patch-src__network_freebsd_sendfile.c @@ -0,0 +1,47 @@ +# +# Respect EAGAIN and retry sendfile() instead close connection. +# Remove empty lines and add two more cases to switch(errno) +# +--- src/network_freebsd_sendfile.c.orig 2007-09-22 19:55:26.000000000 -0300 ++++ src/network_freebsd_sendfile.c 2007-09-22 19:43:28.000000000 -0300 +@@ -151,23 +151,23 @@ + if (-1 == c->file.fd) { + if (-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) { + log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno)); +- + return -1; + } +- + #ifdef FD_CLOEXEC + fcntl(c->file.fd, F_SETFD, FD_CLOEXEC); + #endif + } + +- r = 0; +- ++eagain: + /* FreeBSD sendfile() */ ++ r = 0; + if (-1 == sendfile(c->file.fd, fd, offset, toSend, NULL, &r, 0)) { + switch(errno) { + case EAGAIN: ++ case EINTR: + break; + case ENOTCONN: ++ case ENOTSOCK: + return -2; + default: + log_error_write(srv, __FILE__, __LINE__, "ssd", "sendfile: ", strerror(errno), errno); +@@ -190,12 +190,10 @@ + if (offset >= sce->st.st_size) { + /* file shrinked, close the connection */ + errno = oerrno; +- + return -1; + } + + errno = oerrno; +- return -2; + } + + c->offset += r; |