--- www/thttpd/Makefile.orig Sun Feb 1 06:51:54 2004 +++ www/thttpd/Makefile Thu Apr 1 12:02:08 2004 @@ -6,7 +6,7 @@ # PORTNAME= thttpd -PORTVERSION= 2.24 +PORTVERSION= 2.25b CATEGORIES= www ipv6 MASTER_SITES= http://www.acme.com/software/thttpd/ \ http://atreides.freenix.no/~anders/ --- www/thttpd/distinfo.orig Wed Mar 31 06:12:29 2004 +++ www/thttpd/distinfo Thu Apr 1 12:04:15 2004 @@ -1,3 +1,3 @@ -MD5 (thttpd/thttpd-2.24.tar.gz) = 9e72c27986548d0cbc8ea850b7b47bdd -SIZE (thttpd/thttpd-2.24.tar.gz) = 130116 +MD5 (thttpd/thttpd-2.25b.tar.gz) = a0e9cd87455d3a0ea11e5ea7e947adf6 +SIZE (thttpd/thttpd-2.25b.tar.gz) = 132363 MD5 (thttpd/notes.html) = IGNORE --- www/thttpd/files/extra-patch-config.h.orig Sun Feb 1 06:51:54 2004 +++ www/thttpd/files/extra-patch-config.h Thu Apr 1 22:06:15 2004 @@ -1,6 +1,6 @@ ---- config.h.old Sat Jan 31 22:17:25 2004 -+++ config.h Sat Jan 31 22:17:38 2004 -@@ -380,4 +380,6 @@ +--- config.h.orig Sun Nov 30 05:40:00 2003 ++++ config.h Thu Apr 1 22:05:51 2004 +@@ -395,4 +395,6 @@ */ #define MIN_WOULDBLOCK_DELAY 100L --- www/thttpd/files/patch-libhttpd.c.orig Mon Oct 21 02:29:02 2002 +++ www/thttpd/files/patch-libhttpd.c Thu Apr 1 22:08:13 2004 @@ -1,6 +1,6 @@ ---- libhttpd.c.orig Mon May 27 01:22:26 2002 -+++ libhttpd.c Sun Oct 20 23:49:58 2002 -@@ -3816,6 +3816,9 @@ +--- libhttpd.c.orig Thu Dec 25 21:06:05 2003 ++++ libhttpd.c Thu Apr 1 22:07:47 2004 +@@ -3842,6 +3842,9 @@ httpd_send_err( hc, 500, err500title, "", err500form, hc->encodedurl ); return -1; } --- www/thttpd/files/patch-libhttpd.h.orig Mon Oct 21 02:29:02 2002 +++ www/thttpd/files/patch-libhttpd.h Thu Apr 1 22:09:05 2004 @@ -1,6 +1,6 @@ ---- libhttpd.h.orig Sun Oct 20 23:50:43 2002 -+++ libhttpd.h Sun Oct 20 23:51:10 2002 -@@ -141,6 +141,9 @@ +--- libhttpd.h.orig Mon Dec 8 18:20:51 2003 ++++ libhttpd.h Thu Apr 1 22:08:38 2004 +@@ -142,6 +142,9 @@ struct stat sb; int conn_fd; char* file_address; --- www/thttpd/files/patch-mmc.c.orig Fri Nov 14 20:32:49 2003 +++ www/thttpd/files/patch-mmc.c Thu Apr 1 22:35:03 2004 @@ -1,6 +1,6 @@ ---- mmc.c.orig Tue Oct 22 09:42:01 2002 -+++ mmc.c Fri Nov 14 12:26:39 2003 -@@ -74,6 +74,9 @@ +--- mmc.c.orig Thu Dec 25 21:06:35 2003 ++++ mmc.c Thu Apr 1 22:34:47 2004 +@@ -83,6 +83,9 @@ time_t ctime; int refcount; time_t reftime; @@ -10,7 +10,7 @@ void* addr; unsigned int hash; int hash_idx; -@@ -140,7 +143,11 @@ +@@ -149,7 +152,11 @@ /* Yep. Just return the existing map */ ++m->refcount; m->reftime = now; @@ -22,7 +22,7 @@ } /* Open the file. */ -@@ -186,7 +193,9 @@ +@@ -195,7 +202,9 @@ else { size_t size_size = (size_t) m->size; /* loses on files >2GB */ @@ -33,7 +33,7 @@ /* Map the file into memory. */ m->addr = mmap( 0, size_size, PROT_READ, MAP_PRIVATE, fd, 0 ); if ( m->addr == (void*) -1 && errno == ENOMEM ) -@@ -234,8 +243,9 @@ +@@ -243,8 +252,9 @@ } #endif /* HAVE_MMAP */ } @@ -44,7 +44,7 @@ /* Put the Map into the hash table. */ if ( add_hash( m ) < 0 ) { -@@ -253,8 +263,12 @@ +@@ -262,8 +272,12 @@ /* Update the total byte count. */ mapped_bytes += m->size; @@ -57,7 +57,7 @@ } -@@ -267,14 +281,18 @@ +@@ -276,14 +290,18 @@ if ( sbP != (struct stat*) 0 ) { m = find_hash( sbP->st_ino, sbP->st_dev, sbP->st_size, sbP->st_ctime ); @@ -76,7 +76,7 @@ if ( m == (Map*) 0 ) syslog( LOG_ERR, "mmc_unmap failed to find entry!" ); else if ( m->refcount <= 0 ) -@@ -363,7 +381,9 @@ +@@ -372,7 +390,9 @@ m = *mm; if ( m->size != 0 ) { --- www/thttpd/files/patch-thttpd.c.orig Tue Oct 28 23:58:59 2003 +++ www/thttpd/files/patch-thttpd.c Fri Apr 2 00:02:40 2004 @@ -1,56 +1,56 @@ ---- thttpd.c.orig Tue May 13 17:14:33 2003 -+++ thttpd.c Wed Oct 29 05:50:14 2003 -@@ -1593,12 +1593,45 @@ +--- thttpd.c.orig Thu Dec 25 21:06:52 2003 ++++ thttpd.c Fri Apr 2 00:01:19 2004 +@@ -1723,12 +1723,45 @@ if ( hc->responselen == 0 ) { /* No, just write the file. */ +#ifdef USE_SENDFILE -+ off_t sbytes; -+ -+ sz = sendfile( -+ hc->file_fd, hc->conn_fd, c->bytes_sent, -+ MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ), -+ NULL, &sbytes, 0 ); -+ if (sz == -1 && errno == EAGAIN) -+ sz = sbytes > 0 ? sbytes : -1; -+ else if (sz == 0) -+ sz = sbytes; -+#else ++ off_t sbytes; ++ ++ sz = sendfile( ++ hc->file_fd, hc->conn_fd, c->bytes_sent, ++ MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ), ++ NULL, &sbytes, 0 ); ++ if (sz == -1 && errno == EAGAIN) ++ sz = sbytes > 0 ? sbytes : -1; ++ else if (sz == 0) ++ sz = sbytes; ++#else sz = write( - hc->conn_fd, &(hc->file_address[c->bytes_sent]), - MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ) ); + hc->conn_fd, &(hc->file_address[c->next_byte_index]), + MIN( c->end_byte_index - c->next_byte_index, max_bytes ) ); +#endif } else { +#ifdef USE_SENDFILE -+ struct sf_hdtr sf; -+ struct iovec iv; -+ off_t sbytes; ++ struct sf_hdtr sf; ++ struct iovec iv; ++ off_t sbytes; + -+ iv.iov_base = hc->response; -+ iv.iov_len = hc->responselen; -+ sf.headers = &iv; -+ sf.hdr_cnt = 1; -+ sf.trailers = NULL; -+ sf.trl_cnt = 0; -+ sz = sendfile( -+ hc->file_fd, hc->conn_fd, c->bytes_sent, -+ MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ), -+ &sf, &sbytes, 0 ); -+ if (sz == -1 && errno == EAGAIN) -+ sz = sbytes > 0 ? sbytes : -1; -+ else if (sz == 0) -+ sz = sbytes; -+#else ++ iv.iov_base = hc->response; ++ iv.iov_len = hc->responselen; ++ sf.headers = &iv; ++ sf.hdr_cnt = 1; ++ sf.trailers = NULL; ++ sf.trl_cnt = 0; ++ sz = sendfile( ++ hc->file_fd, hc->conn_fd, c->bytes_sent, ++ MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ), ++ &sf, &sbytes, 0 ); ++ if (sz == -1 && errno == EAGAIN) ++ sz = sbytes > 0 ? sbytes : -1; ++ else if (sz == 0) ++ sz = sbytes; ++#else /* Yes. We'll combine headers and file into a single writev(), ** hoping that this generates a single packet. */ -@@ -1609,6 +1642,7 @@ - iv[1].iov_base = &(hc->file_address[c->bytes_sent]); - iv[1].iov_len = MIN( c->bytes_to_send - c->bytes_sent, c->max_limit ); +@@ -1739,6 +1772,7 @@ + iv[1].iov_base = &(hc->file_address[c->next_byte_index]); + iv[1].iov_len = MIN( c->end_byte_index - c->next_byte_index, max_bytes ); sz = writev( hc->conn_fd, iv, 2 ); +#endif } - if ( sz == 0 || + if ( sz < 0 && errno == EINTR )