00001 #ifndef __CLIENT_H__ 00002 #define __CLIENT_H__ 00003 00004 #include <stdio.h> /* for FILE */ 00005 00006 #include <expat.h> 00007 00008 #include "httpRequest.h" 00009 00010 #define READBUFSIZE 2048 /* Size of receive readBuffer */ 00011 #define CLIENTMULTMAX 512U /* 1MB maximum size the readbuffer may grow */ 00012 00013 #define READ_ERR_LONGLINE -2 00014 #define READ_ERR_MEMORY -3 00015 00016 extern int verbose; 00017 00018 typedef struct { 00019 int socket; 00020 char * readBuffer; 00021 char * writeBuffer; 00022 unsigned int readPos; 00023 unsigned int writePos; 00024 unsigned int readBufMult; 00025 char remoteAddr[16]; 00026 00027 tHttpHeader httpHeader; 00028 unsigned int bodyLenRemaining; 00029 00030 XML_Parser parser; 00031 } tClient; 00032 00033 00034 void clientClose(tClient * client); 00035 int clientRead(tClient * client); 00036 int clientWrite(tClient * client); 00037 char * clientGetLine(tClient *, const char *, unsigned int *); 00038 char * clientRemoveLine(tClient *, const char *, unsigned int *); 00039 00040 #endif // __CLIENT_H__
1.5.8