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)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to