42 #include <sys/types.h>
61 HttpResponse response;
71 response =
new(HttpResponse,
"HTTP/1.1", 200,
"OK");
72 message = (HttpMessage)response;
74 message->asset = asset;
75 message->body = asset->data;
76 message->nbody = asset->size;
78 nexpires =
rfc1123Gmt(expires,
sizeof(expires), &exptime);
81 new(HttpHeader,
CSTRA(
"Content-Type"),
82 asset->mime_type, asset->nmime_type));
84 new(HttpHeader,
CSTRA(
"ETag"), asset->etag, asset->netag));
86 new(HttpHeader,
CSTRA(
"Expires"), expires, nexpires));
88 new(HttpHeader,
CSTRA(
"Last-Modified"),
89 asset->mtime, asset->nmtime));
Asset assetPoolGet(const char *, size_t)
HttpResponse httpResponseAsset(const char *fname, size_t nfname, time_t exptime)
#define CSTRA(val)
Const STRing Argument.
size_t rfc1123Gmt(char *, size_t, const time_t *)
void * hashAdd(Hash, void *)