Every incoming request to Apache has an associated conn_rec object which contains information about the connection. This object can also be used to directly read and write to the remote client.
conn_rec.base_server
This attribute is a reference to a server_rec object on which the connection came in.
conn_rec.local_addr
This string attribute contains the local address that the request came in on. Example: 127.0.0.1
conn_rec.remote_addr
This string attribute contains the remote address of the incoming connection. Example: 69.0.0.1
conn_rec.write( the_skinny)
the_skinny - string data to write to the remote client
Returns a tuple (status, nbytes), where status is one of the APR error codes in the mod_snake module, and nbytes are the number of bytes successfully written.
Occasionally a module writer may wish to write directly to the remote connection, such as when using a protocol other than HTTP. This routine allows the module to communicate directly with the remote client.
conn_rec.read( nbytes)
nbytes - The number of bytes to read
Returns a tuple (status, nbytes, data) where status is one of the APR error codes in the mod_snake module, nbytes is the number of bytes read, and data is the actual data read from the client.
This method allows modules to read data from the remote client.
conn_rec.flush
This method flushes the buffered output, as sent from conn_rec.write()
conn_rec.remote_ip
This string attribute contains the remote IP address of the incoming connection. Example: 127.0.0.1
conn_rec.keepalive
This integer attribute indicates whether or not HTTP keep-alive is in effect for the current connection. -1 indiciates a fatal error, 0 undecided, and 1 yes.
conn_rec.keptalive
This true/false attribute indicates whether or not HTTP keep-alive was used during the request.
conn_rec.double_reverse
This integer attribute indicates whether or not double-reverse DNS has been performed. -1 = failure, 0 = not yet, 1 = yes
conn_rec.keepalives
This integer attribute indicates how many times this connection has been used for requests.
conn_rec.local_ip
This string attribute contains the IP of the server that the connection came in on.
conn_rec.local_host
This string attribute contains the hostname of the server that the connection came in on.