The process_connection phase is used to process incoming connections. Only protocol modules should assign handlers for this phase, as it gives them an opportunity to replace the standard HTTP processing with processing for some other protocol (e.g., POP3, FTP, etc.).
Apache will continue executing all handlers registered for this phase until the first handler returns something other than Apache::DECLINED.
The PerlProcessConnectionHandler directive may appear in the main configuration files and within <VirtualHost> sections.
The process_connection handler can be written in two ways. The first way is to manipulate bucket brigades, in a way very similar to the filters. The second, simpler way is to bypass all the filters and to read from and write to the connection socket directly.
A process_connection handler accepts a connection record object as its only argument:
sub handler { my ($c) = @_; # ... return Apache::OK; }
Now let's look at two examples of connection handlers. The first uses the connection socket to read and write the data, and the second uses bucket brigades to accomplish the same thing and allow the connection filters to do their work.
 
Continue to: