#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"

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) |
| TServer * | ConnServer (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 |
| 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 | |||
| ) |
Definition at line 104 of file abyss_conn.c.
References _TConn::bufferpos, _TConn::buffersize, _TConn::done, FALSE, _TConn::finished, _TConn::inbytes, _TConn::job, makeThread(), MALLOCVAR, NULL, _TConn::outbytes, _TConn::peerip, _TConn::server, SocketGetPeerName(), _TConn::socketP, _TConn::trace, and xmlrpc_asprintf().
| 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 | |||
| ) |
Definition at line 293 of file abyss_conn.c.
References _TConn::buffer, _TConn::buffersize, bufferSpace(), FALSE, _TConn::inbytes, MIN, NULL, SocketAvailableReadBytes(), _TConn::socketP, SocketRead(), SocketWait(), traceSocketRead(), and TRUE.
| abyss_bool ConnReadHeader | ( | TConn *const | connectionP, | |
| char **const | headerP | |||
| ) |
Definition at line 522 of file abyss_conn.c.
References _TConn::buffer, _TConn::bufferpos, _TConn::buffersize, ConnRead(), FALSE, NULL, processHeaderLine(), _TConn::server, TServer::timeout, and TRUE.
Referenced by readRequestLine(), and RequestRead().
| void ConnReadInit | ( | TConn *const | connectionP | ) |
Definition at line 219 of file abyss_conn.c.
References _TConn::buffer, _TConn::bufferpos, _TConn::buffersize, _TConn::inbytes, and _TConn::outbytes.
Referenced by serverFunc(), and SessionRefillBuffer().
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] |
Definition at line 75 of file abyss_conn.c.
References connJob, FALSE, _TConn::hasOwnThread, NULL, ThreadCreate(), threadDone, _TConn::threadP, TRUE, xmlrpc_asprintf(), and xmlrpc_strfree().
Referenced by ConnCreate().
| 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] |
| 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().
TThreadProc connJob [static] |
TThreadDoneFn threadDone [static] |
1.5.6