diff options
author | Sascha Schumann <sas@php.net> | 1999-10-07 21:23:55 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 1999-10-07 21:23:55 +0000 |
commit | 02553b5e7cf7dde0a62fae15905fa7344df07eb2 (patch) | |
tree | 1bae4cd4c561714c5fe760544aa252f5bad88674 | |
parent | 3f1c010615475b4fa4be936614fc2d92ecbcc5c9 (diff) | |
download | php-git-02553b5e7cf7dde0a62fae15905fa7344df07eb2.tar.gz |
POST works now and does not block anymore.
-rw-r--r-- | sapi/aolserver/aolserver.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index 125a810454..a4bff672ea 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -68,6 +68,7 @@ typedef struct { typedef struct { Ns_Conn *conn; + size_t data_avail; } ns_globals_struct; static void php_ns_config(php_ns_context *ctx); @@ -147,13 +148,18 @@ php_ns_sapi_send_headers(sapi_headers_struct *sapi_headers SLS_DC) static int php_ns_sapi_read_post(char *buf, uint count_bytes SLS_DC) { + uint max_read; uint total_read = 0; NSLS_FETCH(); - total_read = Ns_ConnRead(NSG(conn), buf, count_bytes); + max_read = MIN(NSG(data_avail), count_bytes); + + total_read = Ns_ConnRead(NSG(conn), buf, max_read); if(total_read == NS_ERROR) { total_read = -1; + } else { + NSG(data_avail) -= total_read; } return total_read; @@ -295,6 +301,8 @@ php_ns_request_ctor(NSLS_D SLS_DC) Ns_SetValue(NSG(conn)->headers, index); SG(request_info).auth_user = NULL; SG(request_info).auth_password = NULL; + + NSG(data_avail) = SG(request_info).content_length; } /* |