Main Page   Data Structures   File List   Data Fields   Globals   Related Pages  

conn_handler.c File Reference

connection handler object (represents a connection to a user agent). More...

#include "common.h"
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "conn_handler.h"
#include "xmalloc.h"
#include "buffer.h"
#include "conftable.h"
#include "logger.h"
#include "http.h"

Include dependency graph for conn_handler.c:

Include dependency graph

Go to the source code of this file.

Data Structures

struct  ConnHandler
 holds a connections handler's internal state. More...


Defines

#define MSG_NOSIGNAL   0
 Solaris does not know about MSG_NOSIGNAL so define it if needed.


Functions

int chModulePreInit ()
 initialise module (calculate constant values and allocate common buffers). More...

int chModuleTerminate ()
 free all ressources allocated by the module. More...

ConnHandler chInit (int server_socket)
 creates and returns a new CHData connection handler object. More...

int chGetSocket (const ConnHandler this)
 returns a file descriptor to the connection handler's communication socket. More...

time_t chGetStamp (const ConnHandler this)
 get a ConnectionHandler's transmit timestamp. More...

int readData (ConnHandler this)
 reads a block of pending data from the communication socket.

int chReceive (ConnHandler this)
 handles a request pending at the connection handlers socket. More...

int byteInQueue (const ConnHandler this)
 returns amount of data in send queue.

int chIsDataPending (const ConnHandler this)
 returns true if there is pending data. More...

int forwardSendToProtHandler (ConnHandler this)
 issue a "send"-request to the active protocol handler.

int chSend (ConnHandler this)
 send some of the data currently in queue. More...

int chProcess (ConnHandler this)
 do additional data processing. More...

int chGetError (const ConnHandler this)
 return the connection handler's current error status. More...

int chTerminate (ConnHandler this)
 terminate the connection handler. More...


Detailed Description

connection handler object (represents a connection to a user agent).

Definition in file conn_handler.c.


Function Documentation

int chGetError const ConnHandler    this
 

return the connection handler's current error status.

Parameters:
this  connection handler
Returns:
0 if no error occured, an errno error code else

Definition at line 309 of file conn_handler.c.

int chGetSocket const ConnHandler    this
 

returns a file descriptor to the connection handler's communication socket.

Parameters:
the  connection handler whose socket is to be returned
Returns:
file descriptor of the connection handler's comm. socket

Definition at line 154 of file conn_handler.c.

time_t chGetStamp const ConnHandler    this
 

get a ConnectionHandler's transmit timestamp.

returns the time the ConnectionHandler ch made its last transmission from or to the remote end

Parameters:
the  connection handler
Returns:
the time the last transmission from or to the remote end was made

Definition at line 160 of file conn_handler.c.

ConnHandler chInit int    server_socket
 

creates and returns a new CHData connection handler object.

Parameters:
server_socket  a server socket with a pending connection request
chInit creates and initializes a CHData connection handler object. If a connection can be established a CHData object representing the connection is returned.

Returns:
pointer to a CHData object on success, NULL on failure

Definition at line 110 of file conn_handler.c.

int chIsDataPending const ConnHandler    this
 

returns true if there is pending data.

Parameters:
this  connection handler
/retval true there is data currently waiting to be send /retval false send queue is idle

Definition at line 227 of file conn_handler.c.

int chModulePreInit  
 

initialise module (calculate constant values and allocate common buffers).

Returns:
0 on success and -1 on failure

Definition at line 94 of file conn_handler.c.

int chModuleTerminate  
 

free all ressources allocated by the module.

Returns:
0 on success and -1 on failure

Definition at line 102 of file conn_handler.c.

int chProcess ConnHandler    this
 

do additional data processing.

Parameters:
this  connection handler
Gives the thread of control to the connection handler this, allowing it to preprocess some data while it's socket is busy. In most cases it will just call a protocol handlers phProcess in turn to allow it to fill a second send buffer until the socket is idle again.

Returns:
don't know...

Definition at line 299 of file conn_handler.c.

int chReceive ConnHandler    this
 

handles a request pending at the connection handlers socket.

Parameters:
this  connection handler with pending data
chReceive reads all pending data from the connection handlers communication socket and takes appropriate actions.

Returns:
don't know...

Definition at line 197 of file conn_handler.c.

int chSend ConnHandler    this
 

send some of the data currently in queue.

Parameters:
this  connection handler
The connection handler this is requested to send some data.

Returns:
don't know...

Definition at line 253 of file conn_handler.c.

int chTerminate ConnHandler    this
 

terminate the connection handler.

Parameters:
this  connection handler to be terminated
Closes the connection, terminates all related objects and frees all buffers

Returns:
don't know...

Definition at line 315 of file conn_handler.c.


Generated on Fri Jan 25 22:40:44 2002 for PDepp Webserver by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001