abyss_conn.c File Reference

#include <time.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <assert.h>
#include "abyss_mallocvar.h"
#include "abyss_xmlrpc_int.h"
#include <xmlrpc-c/abyss.h>
#include "abyss_socket.h"
#include "abyss_server.h"
#include "abyss_thread.h"
#include "abyss_conn.h"

Include dependency graph for abyss_conn.c:

Go to the source code of this file.

Functions

static uint32_t bufferSpace (TConn *const connectionP)
void ConnCreate (TConn **const connectionPP, TServer *const serverP, TSocket *const connectedSocketP, TThreadProc *const job, TThreadDoneFn *const done, enum abyss_foreback const foregroundBackground, abyss_bool const useSigchld, const char **const errorP)
static void connDone (TConn *const connectionP)
static void connJob (void *const userHandle)
abyss_bool ConnKill (TConn *connectionP)
abyss_bool ConnProcess (TConn *const connectionP)
abyss_bool ConnRead (TConn *const connectionP, uint32_t const timeout)
abyss_bool ConnReadHeader (TConn *const connectionP, char **const headerP)
void ConnReadInit (TConn *const connectionP)
TServerConnServer (TConn *const connectionP)
void ConnWaitAndRelease (TConn *const connectionP)
abyss_bool ConnWrite (TConn *const connectionP, const void *const buffer, uint32_t const size)
abyss_bool ConnWriteFromFile (TConn *const connectionP, TFile *const fileP, uint64_t const start, uint64_t const last, void *const buffer, uint32_t const buffersize, uint32_t const rate)
static void makeThread (TConn *const connectionP, enum abyss_foreback const foregroundBackground, abyss_bool const useSigchld, const char **const errorP)
static void processHeaderLine (char *const start, const char *const headerStart, TConn *const connectionP, time_t const deadline, abyss_bool *const gotHeaderP, char **const nextP, abyss_bool *const errorP)
static void threadDone (void *const userHandle)
static void traceBuffer (const char *const label, const char *const buffer, unsigned int const size)
static void traceSocketRead (TConn *const connectionP, unsigned int const size)
static void traceSocketWrite (TConn *const connectionP, const char *const buffer, unsigned int const size, abyss_bool const failed)

Variables

static TThreadProc connJob
static TThreadDoneFn threadDone


Function Documentation

static uint32_t bufferSpace ( TConn *const   connectionP  )  [static]

Definition at line 285 of file abyss_conn.c.

References BUFFER_SIZE, and _TConn::buffersize.

Referenced by ConnRead().

void ConnCreate ( TConn **const   connectionPP,
TServer *const   serverP,
TSocket *const   connectedSocketP,
TThreadProc *const   job,
TThreadDoneFn *const   done,
enum abyss_foreback const   foregroundBackground,
abyss_bool const   useSigchld,
const char **const   errorP 
)

static void connDone ( TConn *const   connectionP  )  [static]

Definition at line 49 of file abyss_conn.c.

References _TConn::done, _TConn::finished, and TRUE.

Referenced by ConnProcess(), and threadDone().

static void connJob ( void *const   userHandle  )  [static]

Definition at line 26 of file abyss_conn.c.

References _TConn::finished, _TConn::job, ThreadExit(), and TRUE.

abyss_bool ConnKill ( TConn connectionP  ) 

Definition at line 211 of file abyss_conn.c.

References _TConn::finished, ThreadKill(), _TConn::threadP, and TRUE.

abyss_bool ConnProcess ( TConn *const   connectionP  ) 

Definition at line 171 of file abyss_conn.c.

References connDone(), _TConn::hasOwnThread, _TConn::job, _TConn::threadP, ThreadRun(), and TRUE.

Referenced by serverRun2(), and serverRunConn().

abyss_bool ConnRead ( TConn *const   connectionP,
uint32_t const   timeout 
)

abyss_bool ConnReadHeader ( TConn *const   connectionP,
char **const   headerP 
)

void ConnReadInit ( TConn *const   connectionP  ) 

TServer* ConnServer ( TConn *const   connectionP  ) 

Definition at line 591 of file abyss_conn.c.

References _TConn::server.

Referenced by ResponseWriteStart(), and ServerDefaultHandlerFunc().

void ConnWaitAndRelease ( TConn *const   connectionP  ) 

Definition at line 201 of file abyss_conn.c.

References _TConn::hasOwnThread, _TConn::threadP, and ThreadWaitAndRelease().

Referenced by freeFinishedConns(), and serverRunConn().

abyss_bool ConnWrite ( TConn *const   connectionP,
const void *const   buffer,
uint32_t const   size 
)

Definition at line 359 of file abyss_conn.c.

References _TConn::outbytes, _TConn::socketP, SocketWrite(), and traceSocketWrite().

abyss_bool ConnWriteFromFile ( TConn *const   connectionP,
TFile *const   fileP,
uint64_t const   start,
uint64_t const   last,
void *const   buffer,
uint32_t const   buffersize,
uint32_t const   rate 
)

Definition at line 378 of file abyss_conn.c.

References ConnWrite(), FALSE, FileRead(), FileSeek(), MIN, and xmlrpc_millisecond_sleep().

static void makeThread ( TConn *const   connectionP,
enum abyss_foreback const   foregroundBackground,
abyss_bool const   useSigchld,
const char **const   errorP 
) [static]

static void processHeaderLine ( char *const   start,
const char *const   headerStart,
TConn *const   connectionP,
time_t const   deadline,
abyss_bool *const   gotHeaderP,
char **const   nextP,
abyss_bool *const   errorP 
) [static]

Definition at line 440 of file abyss_conn.c.

References ConnRead(), CR, FALSE, LF, NULL, and TRUE.

Referenced by ConnReadHeader().

static void threadDone ( void *const   userHandle  )  [static]

Definition at line 65 of file abyss_conn.c.

References connDone().

static void traceBuffer ( const char *const   label,
const char *const   buffer,
unsigned int const   size 
) [static]

Definition at line 235 of file abyss_conn.c.

Referenced by traceSocketRead(), and traceSocketWrite().

static void traceSocketRead ( TConn *const   connectionP,
unsigned int const   size 
) [static]

Definition at line 259 of file abyss_conn.c.

References _TConn::buffer, _TConn::buffersize, _TConn::trace, and traceBuffer().

Referenced by ConnRead().

static void traceSocketWrite ( TConn *const   connectionP,
const char *const   buffer,
unsigned int const   size,
abyss_bool const   failed 
) [static]

Definition at line 270 of file abyss_conn.c.

References _TConn::trace, and traceBuffer().

Referenced by ConnWrite().


Variable Documentation

TThreadProc connJob [static]

Definition at line 23 of file abyss_conn.c.

Referenced by makeThread().

TThreadDoneFn threadDone [static]

Definition at line 62 of file abyss_conn.c.

Referenced by makeThread().


Generated on Thu May 17 10:00:33 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6