From: Sascha Schumann Date: Mon, 15 Jan 2001 14:48:14 +0000 (+0000) Subject: Try harder to push data through the wire. X-Git-Tag: php-4.0.5RC1~560 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6eae19147469aeda1fdcd5706e213230257ace8;p=php Try harder to push data through the wire. I just learned that the AOLserver module will be used for a 100k users webmail service. Wheee! --- diff --git a/sapi/aolserver/aolserver.c b/sapi/aolserver/aolserver.c index aabfe5a9e1..8735b82871 100644 --- a/sapi/aolserver/aolserver.c +++ b/sapi/aolserver/aolserver.c @@ -93,15 +93,22 @@ static void php_ns_config(php_ns_context *ctx, char global); static int php_ns_sapi_ub_write(const char *str, uint str_length) { - int sent_bytes; + int n; + uint sent = 0; NSLS_FETCH(); - sent_bytes = Ns_ConnWrite(NSG(conn), (void *) str, str_length); + while (str_length > 0) { + n = Ns_ConnWrite(NSG(conn), (void *) str, str_length); - if (sent_bytes != str_length) - php_handle_aborted_connection(); + if (n == -1) + php_handle_aborted_connection(); + + str += n; + sent += n; + str_length -= n; + } - return sent_bytes; + return sent; } /*