41#include "HttpServer.h"
42#ifndef SharkSslStandalone
43#include "CspCompileCommon.h"
66__attribute__((__packed__))
70typedef struct GzipHeader GzipHeader;
73#define FLG_FTEXT ( 1 << 0 )
74#define FLG_FHCRC ( 1 << 1 )
75#define FLG_FEXTRA ( 1 << 2 )
76#define FLG_FNAME ( 1 << 3 )
77#define FLG_FCOMMENT ( 1 << 4 )
83 U8 uncompressedSize[4];
86__attribute__((__packed__))
90typedef struct GzipTrailer GzipTrailer;
108 struct CspReader* o,
void* data, U32 offset, U32 size,
int blockStart);
110#define CspReader_validFlag 0xA503
122 void operator delete(
void* d) {
if(d)
::baFree(d); }
123 void *
operator new(size_t,
void *place) {
return place; }
124 void operator delete(
void*,
void *) { }
128 int read(
void* data, U32 offset, U32 size,
bool blockStart);
129 void setIsValid() { validFlag=CspReader_validFlag; }
139#define CspReader_constructor(o, httpDiskRead) do {\
140 (o)->readCB = httpDiskRead; \
141 (o)->validFlag = (U16)~CspReader_validFlag; \
144#define CspReader_isValid(o) (((CspReader*)o)->readCB != 0 && \
145 ((CspReader*)o)->validFlag == CspReader_validFlag)
146#define CspReader_setIsValid(o) ((CspReader*)o)->validFlag=CspReader_validFlag
147#define CspReader_read(httpData, data, offset, size, blockStart) \
148 (*((CspReader*)httpData)->readCB)((CspReader*)httpData, data, \
149 offset, size, blockStart)
153 return CspReader_isValid(
this) ? true :
false;
155inline int CspReader::read(
void* data, U32 offset, U32 size,
bool blockStart) {
156 return CspReader_read(
this, data, offset, size, blockStart);
160#ifndef SharkSslStandalone
163typedef struct HttpStaticMemPage
168 HttpDiskBlock mimeBlock;
169 HttpDiskBlock payloadBlock;
177BA_API
int httpWriteSection(
179BA_API
int httpUnzipAndWrite(
CspReader* data,
195BA_API
void HttpStaticMemPage_loadAndInit(HttpStaticMemPage* o,
197 U32 nameOffset, U32 nameSize,
198 U32 mimeOffset, U32 mimeSize,
199 U32 payloadOffset, U32 payloadSize,
200 char isCompressed,
HttpDir* parent);
202BA_API
void HttpDynamicMemPage_loadAndInit(
205 U32 nameOffset, U32 nameSize);
struct CspReader CspReader
Abstract interface class for reading the "dat" file generated byHttpLink.
int(* CspReader_Read)(struct CspReader *o, void *data, U32 offset, U32 size, int blockStart)
Prototype for the CspReader callback function.
Definition: CspRunTm.h:107
void * baMalloc(size_t size)
Returns pointer to uninitialized newly-allocated space for an object of size "size",...
void baFree(void *p)
Deallocates space to which it points.
void(* HttpPage_Service)(struct HttpPage *page, HttpRequest *request, HttpResponse *response)
The HttpPage service function.
Definition: HttpServer.h:2190
Abstract interface class for reading the "dat" file generated byHttpLink.
Definition: CspRunTm.h:119
bool isValid()
Returns true if the reader object is valid.
Definition: CspRunTm.h:152
An instance of the HttpDir class, which is a collection of zero or more resources,...
Definition: HttpServer.h:2368
An HttpPage, which is typically created by the CSP compiler, is similar to a Java servlet.
Definition: HttpServer.h:2256
The HttpServer creates an HttpRequest object when the HttpServer parses a client request.
Definition: HttpServer.h:808
This object is used when sending response messages back to the client.
Definition: HttpServer.h:1178