can't get bytes_sent to work
"Mark Wilmoth" <[email protected]>
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <000501c40630$ef73b130$0200a8c0@rome> |
Is there a trick to get Apache#request.bytes_sent to work?
I have:
Apache 2.0.47
mod_ruby 1.0.7
Here is an example of the code with the call at the end and it always
returns zero.
-----
require "mysql"
r = Apache.request
r.content_type = "text/html"
r.send_http_header
exit(Apache::OK) if r.header_only?
print "REMOTE_HOST: #{r.remote_host(Apache::REMOTE_HOST)} REMOTE_NAME:
#{r.remote_host(Apache::REMOTE_NAME)} REMOTE_DOUBLE_REV:
#{r.remote_host(Apache::REMOTE_DOUBLE_REV)} REMOTE_NOLOOKUP:
#{r.remote_host(Apache::REMOTE_NOLOOKUP)}<br>\n"
print "URI: #{r.uri} HOST: #{r.hostname} PORT: #{r.server_port} SERVER
NAME: #{r.server_name}<br>\n"
print "Your IP: #{r.connection.remote_ip} Your Host:
#{r.connection.remote_host} Your Port: #{r.connection.remote_port}<br>\n"
print <<HDOC
<!DOCTYPE HTML PUBLIC '-//W3C/DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/strict.dtd'>
<html>
<head>
<title>MySQL & mod_ruby Test!</title>
<meta http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>
</head>
<body>
HDOC
#<snip some SQL stuff>
print <<HDOC
</body>
</html>
HDOC
print "REQUEST TIME: #{r.request_time}<br>\n"
print "BYTES SENT: #{r.bytes_sent}\n"
-----
Thanks,
Mark