2008-05-23 20:56:24 +00:00
|
|
|
#ifndef HTTP_H_INCLUDED
|
|
|
|
#define HTTP_H_INCLUDED
|
|
|
|
|
2012-10-13 11:37:25 -05:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2008-05-23 20:56:24 +00:00
|
|
|
#include "bool.h"
|
|
|
|
#include "conn.h"
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
** Request
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
bool RequestValidURI(TSession * const r);
|
|
|
|
bool RequestValidURIPath(TSession * const r);
|
|
|
|
bool RequestUnescapeURI(TSession *r);
|
|
|
|
|
|
|
|
void
|
2012-10-13 11:37:25 -05:00
|
|
|
RequestRead(TSession * const sessionP,
|
|
|
|
uint32_t const timeout,
|
|
|
|
const char ** const errorP,
|
|
|
|
uint16_t * const httpErrorCodeP);
|
2008-05-23 20:56:24 +00:00
|
|
|
|
|
|
|
void RequestInit(TSession * const r,TConn * const c);
|
|
|
|
void RequestFree(TSession * const r);
|
|
|
|
|
|
|
|
bool
|
|
|
|
RequestAuth(TSession * const sessionP,
|
|
|
|
const char * const credential,
|
|
|
|
const char * const user,
|
|
|
|
const char * const pass);
|
|
|
|
|
|
|
|
/*********************************************************************
|
|
|
|
** HTTP
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
const char *
|
|
|
|
HTTPReasonByStatus(uint16_t const code);
|
|
|
|
|
|
|
|
int32_t
|
|
|
|
HTTPRead(TSession * const sessionP,
|
|
|
|
const char * const buffer,
|
|
|
|
uint32_t const len);
|
|
|
|
|
|
|
|
bool
|
|
|
|
HTTPWriteBodyChunk(TSession * const sessionP,
|
|
|
|
const char * const buffer,
|
|
|
|
uint32_t const len);
|
|
|
|
|
|
|
|
bool
|
|
|
|
HTTPWriteEndChunk(TSession * const sessionP);
|
|
|
|
|
|
|
|
bool
|
|
|
|
HTTPKeepalive(TSession * const sessionP);
|
|
|
|
|
|
|
|
bool
|
|
|
|
HTTPWriteContinue(TSession * const sessionP);
|
|
|
|
|
|
|
|
#endif
|