diff options
| author | Sascha Schumann <sas@php.net> | 2001-04-25 06:42:24 +0000 |
|---|---|---|
| committer | Sascha Schumann <sas@php.net> | 2001-04-25 06:42:24 +0000 |
| commit | 6602b48071130bd3a4619f21f226f0a1d711e228 (patch) | |
| tree | 7fbd0bb460c236056322b8ada8e8b6b1f2a12a97 /sapi/thttpd/thttpd.c | |
| parent | ef1835f54fe0f6a4f76a9f3f4592faa34c0172ba (diff) | |
| download | php-git-6602b48071130bd3a4619f21f226f0a1d711e228.tar.gz | |
Fix optimization -- we did not send out custom Response Status Lines.
Diffstat (limited to 'sapi/thttpd/thttpd.c')
| -rw-r--r-- | sapi/thttpd/thttpd.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sapi/thttpd/thttpd.c b/sapi/thttpd/thttpd.c index 0d0bb5b78d..f65421270e 100644 --- a/sapi/thttpd/thttpd.c +++ b/sapi/thttpd/thttpd.c @@ -77,17 +77,24 @@ static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers SLS_DC) int n = 0; zend_llist_position pos; sapi_header_struct *h; + size_t len; if (!SG(sapi_headers).http_status_line) { - size_t len; - snprintf(buf, 1023, "HTTP/1.0 %d Something\r\n", SG(sapi_headers).http_response_code); len = strlen(buf); vec[n].iov_base = buf; - vec[n++].iov_len = len; - TG(hc)->status = SG(sapi_headers).http_response_code; - TG(hc)->bytes_sent += len; + vec[n].iov_len = len; + } else { + vec[n].iov_base = SG(sapi_headers).http_status_line; + len = strlen(vec[n].iov_base); + vec[n].iov_len = len; + vec[++n].iov_base = "\r\n"; + vec[n].iov_len = 2; + len += 2; } + TG(hc)->status = SG(sapi_headers).http_response_code; + TG(hc)->bytes_sent += len; + n++; h = zend_llist_get_first_ex(&sapi_headers->headers, &pos); while (h) { |
