cvs: /php4/sapi/aolserver aolserver.c
| From: | Sascha Schumann | Date: | Thu, 07 Oct 1999 21:24:25 +0000 |
| Subject: | cvs: /php4/sapi/aolserver aolserver.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5347@lists.php.net to get a copy of this message | ||
sas Thu Oct 7 17:24:25 1999 EDT
Modified files:
/php4/sapi/aolserver aolserver.c
Log:
POST works now and does not block anymore.
Index: php4/sapi/aolserver/aolserver.c
diff -u php4/sapi/aolserver/aolserver.c:1.5 php4/sapi/aolserver/aolserver.c:1.6
--- php4/sapi/aolserver/aolserver.c:1.5 Thu Oct 7 16:21:55 1999
+++ php4/sapi/aolserver/aolserver.c Thu Oct 7 17:23:55 1999
@@ -21,7 +21,7 @@
* - write documentation
*/
-/* $Id: aolserver.c,v 1.5 1999/10/07 20:21:55 sas Exp $ */
+/* $Id: aolserver.c,v 1.6 1999/10/07 21:23:55 sas Exp $ */
/* conflict between PHP and AOLserver */
#define Debug php_Debug
@@ -68,6 +68,7 @@
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 @@
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 @@
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;
}
/*