mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
Initial import
This commit is contained in:
commit
c91b3c5006
14915 changed files with 590219 additions and 0 deletions
82
net/http/http.h
Normal file
82
net/http/http.h
Normal file
|
@ -0,0 +1,82 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_HTTP_HTTP_H_
|
||||
#define COSMOPOLITAN_LIBC_HTTP_HTTP_H_
|
||||
#include "libc/alg/alg.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
struct FILE;
|
||||
|
||||
enum HttpHeader {
|
||||
kHttpAccept = 1,
|
||||
kHttpAcceptCharset,
|
||||
kHttpAcceptEncoding,
|
||||
kHttpAcceptLanguage,
|
||||
kHttpAge,
|
||||
kHttpAllow,
|
||||
kHttpAuthorization,
|
||||
kHttpCacheControl,
|
||||
kHttpChunked,
|
||||
kHttpClose,
|
||||
kHttpConnection,
|
||||
kHttpContentBase,
|
||||
kHttpContentEncoding,
|
||||
kHttpContentLanguage,
|
||||
kHttpContentLength,
|
||||
kHttpContentLocation,
|
||||
kHttpContentMd5,
|
||||
kHttpContentRange,
|
||||
kHttpContentType,
|
||||
kHttpDate,
|
||||
kHttpEtag,
|
||||
kHttpExpires,
|
||||
kHttpFrom,
|
||||
kHttpHost,
|
||||
kHttpIfMatch,
|
||||
kHttpIfModifiedSince,
|
||||
kHttpIfNoneMatch,
|
||||
kHttpIfRange,
|
||||
kHttpIfUnmodifiedSince,
|
||||
kHttpKeepAlive,
|
||||
kHttpMaxForwards,
|
||||
kHttpPragma,
|
||||
kHttpProxyAuthenticate,
|
||||
kHttpProxyAuthorization,
|
||||
kHttpProxyConnection,
|
||||
kHttpRange,
|
||||
kHttpReferer,
|
||||
kHttpTransferEncoding,
|
||||
kHttpUpgrade,
|
||||
kHttpUserAgent,
|
||||
kHttpVia,
|
||||
kHttpLocation,
|
||||
kHttpPublic,
|
||||
kHttpRetryAfter,
|
||||
kHttpServer,
|
||||
kHttpVary,
|
||||
kHttpWarning,
|
||||
kHttpWwwAuthenticate,
|
||||
kHttpLastModified,
|
||||
};
|
||||
|
||||
struct HttpStr {
|
||||
char *p;
|
||||
size_t i, n;
|
||||
};
|
||||
|
||||
struct HttpRequest {
|
||||
struct HttpStr uri; /* /foo/bar.html, etc. */
|
||||
struct HttpStr method; /* "GET", "POST", etc. */
|
||||
struct critbit0 headers; /* TreeMultiMap<"key:value"> (no space delims) */
|
||||
struct HttpStr version; /* "HTTP/1.1", etc. */
|
||||
struct HttpStr scratch; /* "HTTP/1.1", etc. */
|
||||
};
|
||||
|
||||
int parsehttprequest(struct HttpRequest *, struct FILE *) paramsnonnull();
|
||||
void clearhttprequest(struct HttpRequest *) paramsnonnull();
|
||||
void freehttprequest(struct HttpRequest **) paramsnonnull();
|
||||
int negotiatehttprequest(int, const char *, uint32_t *, char *, uint32_t *,
|
||||
uint32_t *, bool, long double);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_HTTP_HTTP_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue