cvs: php4 /sapi/thttpd thttpd.c

From: Date: Sun, 18 Feb 2001 19:03:36 +0000
Subject: cvs: php4 /sapi/thttpd thttpd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-4113@lists.php.net to get a copy of this message
sas Sun Feb 18 11:03:36 2001 EDT Modified files: /php4/sapi/thttpd thttpd.c Log: Save 50% of the syscalls when writing the HTTP header. Index: php4/sapi/thttpd/thttpd.c diff -u php4/sapi/thttpd/thttpd.c:1.33 php4/sapi/thttpd/thttpd.c:1.34 --- php4/sapi/thttpd/thttpd.c:1.33 Wed Jan 10 05:51:58 2001 +++ php4/sapi/thttpd/thttpd.c Sun Feb 18 11:03:36 2001 @@ -83,14 +83,20 @@ static void sapi_thttpd_send_header(sapi_header_struct *sapi_header, void *server_context) { + struct iovec vec[2]; + int n = 0; TLS_FETCH(); if (sapi_header) { - send(TG(hc)->conn_fd, sapi_header->header, sapi_header->header_len, 0); + vec[n].iov_base = sapi_header->header; + vec[n++].iov_len = sapi_header->header_len; TG(hc)->bytes += sapi_header->header_len; } - send(TG(hc)->conn_fd, "\r\n", sizeof("\r\n") - 1, 0); + vec[n].iov_base = "\r\n"; + vec[n++].iov_len = 2; TG(hc)->bytes += 2; + + writev(TG(hc)->conn_fd, vec, n); } static int sapi_thttpd_read_post(char *buffer, uint count_bytes SLS_DC)

« previous php.cvs (#4113) next »