43#include "BaServerLib.h"
44#include "HttpServer.h"
48typedef void (*HttpRdFilter_Service)(
struct HttpRdFilter* o,
59 HttpRdFilter_Service serviceFp;
63BA_API
void HttpRdFilter_constructor(
64 HttpRdFilter* o,
const char* ext, HttpRdFilter_Service serviceFp);
241 DoubleList filterList;
246 HttpResRdrHeader* headers;
257BA_API
void HttpResRdr_constructor(
260BA_API
void HttpResRdr_constructor2(
265BA_API
void HttpResRdr_destructor(
HttpResRdr* o);
267#define HttpResRdr_setMaxAge(o, maxAgeMA) (o)->maxAge=maxAgeMA
268#define HttpResRdr_setAuthenticator(o, authenticator, realm) \
269 HttpDir_setAuthenticator((HttpDir*)o, authenticator, realm)
270BA_API
void HttpResRdr_sendFile(
IoIntf* io,
const char* name,
274BA_API
void HttpResRdr_setHeader(
HttpResRdr* o, HttpResRdrHeader* headers);
277#define HttpResRdr_getIo(o) (o)->io
280inline HttpResRdr::HttpResRdr(
IoIntf* io,
const char* domain,
const char* p404,
282 HttpResRdr_constructor2(
this, io, domain, p404, alloc, priority);
284inline HttpResRdr::HttpResRdr(
IoIntf* io,
const char* dirName,
286 HttpResRdr_constructor(
this, io, dirName, alloc, priority);
290 return HttpResRdr_insertPrologDir(
this, dir);
293inline HttpResRdr::~HttpResRdr(){
294 HttpResRdr_destructor(
this);
297 return HttpResRdr_installFilter(
this, filter);
300 HttpResRdr_setMaxAge(
this, maxAge);
304 HttpResRdr_sendFile(io,name,st,cmd);
307 return HttpResRdr_getIo(
this);
ResIntfPtr(* IoIntf_DeflateGzip)(ResIntfPtr resPtr, const char *name, ThreadMutex *m, BaFileSize *size, BaBool *isCompressed)
Deflate a file or portion of a file to temporary storage.
Definition: IoIntf.h:269
int(* HttpDir_Service)(struct HttpDir *o, const char *relPath, HttpCommand *cmd)
The HttpDir service callback function.
Definition: HttpServer.h:2334
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:10 GMT – i....
Definition: GenPrimT.h:93
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:83
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:1818
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2368
Superclass for HttpResRdr filters.
Definition: HttpResRdr.h:57
The HTTP resource reader searches and presents IoIntf resources to HTTP clients requesting such infor...
Definition: HttpResRdr.h:144
IoIntf * getIo()
Returns the IoIntf used by the HttpResRdr.
Definition: HttpResRdr.h:306
int insertPrologDir(HttpDir *dir)
Insert a prologue HttpDir.
Definition: HttpResRdr.h:289
int installFilter(HttpRdFilter *filter)
Install a filter.
Definition: HttpResRdr.h:296
static void sendFile(IoIntf *io, const char *name, IoStat *st, HttpCommand *cmd)
Send resource to a client.
Definition: HttpResRdr.h:302
void setMaxAge(BaTime maxAge)
Makes the HttpResRdr instance set the HTTP header "Cache-Control: max-age" for all resources.
Definition: HttpResRdr.h:299
The IoIntf class specifies an abstract file API, implementations include ZipIo, DiskIo,...
Definition: IoIntf.h:377
Resource information.
Definition: IoIntf.h:168