|
Posted by Chung Leong on 10/07/41 11:36
Shailesh Humbad wrote:
> Here is an advanced PHP question. Can anyone think of a way to detect
> the number of bytes written to output when a script is aborted?
If you are using Apache and can recompile the SAPI module, you can add
the following function to php_functions.c:
/* {{{ proto integer apache_get_bytes_sent(void)
Get the number of bytes actually sent */
PHP_FUNCTION(apache_get_bytes_sent)
{
php_struct *ctx;
ctx = SG(server_context);
RETURN_LONG(ctx->r->bytes_sent);
}
/* }}} */
If TCP/IP guarenteed delivery is to be believed, then that should be
the exact number of bytes received (but not necessarily saved) by the
client.
Navigation:
[Reply to this message]
|