You are here: Re: detect bytes written on abort « PHP Programming Language « IT news, forums, messages
Re: detect bytes written on abort

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация