client.h
935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef __CLIENT_H__
#define __CLIENT_H__
#include <stdio.h> /* for FILE */
#include <expat.h>
#include "httpRequest.h"
#define READBUFSIZE 2048 /* Size of receive readBuffer */
#define CLIENTMULTMAX 512U /* 1MB maximum size the readbuffer may grow */
#define READ_ERR_LONGLINE -2
#define READ_ERR_MEMORY -3
extern int verbose;
typedef struct {
int socket;
char * readBuffer;
char * writeBuffer;
unsigned int readPos;
unsigned int writePos;
unsigned int readBufMult;
char remoteAddr[16];
tHttpHeader httpHeader;
unsigned int bodyLenRemaining;
XML_Parser parser;
} tClient;
void clientClose(tClient * client);
int clientRead(tClient * client);
int clientWrite(tClient * client);
char * clientGetLine(tClient *, const char *, unsigned int *);
char * clientRemoveLine(tClient *, const char *, unsigned int *);
#endif // __CLIENT_H__