cosmopolitan/net/http/gethttpheader.gperf
Justine Tunney 416fd86676 Make improvements
- Emulator can now test the αcτµαlly pδrταblε εxεcµταblε bootloader

- Whipped up a webserver named redbean. It services 150k requests per
  second on a single core. Bundling assets inside zip enables extremely
  fast serving for two reasons. The first is that zip central directory
  lookups go faster than stat() system calls. The second is that both
  zip and gzip content-encoding use DEFLATE, therefore, compressed
  responses can be served via the sendfile() system call which does an
  in-kernel copy directly from the zip executable structure. Also note
  that red bean zip executables can be deployed easily to all platforms,
  since these native executables work on Linux, Mac, BSD, and Windows.

- Address sanitizer now works very well
2020-09-14 00:02:34 -07:00

62 lines
2.1 KiB
Text

%{
#include "libc/str/str.h"
#include "net/http/http.h"
#define GPERF_DOWNCASE
%}
%compare-strncmp
%ignore-case
%language=ANSI-C
%readonly-tables
%struct-type
%define lookup-function-name LookupHttpHeader
struct HttpHeaderSlot { char *name; char code; };
%%
Accept, kHttpAccept
Accept-Charset, kHttpAcceptCharset
Accept-Encoding, kHttpAcceptEncoding
Accept-Language, kHttpAcceptLanguage
Age, kHttpAge
Allow, kHttpAllow
Authorization, kHttpAuthorization
Cache-Control, kHttpCacheControl
Chunked, kHttpChunked
Close, kHttpClose
Connection, kHttpConnection
Content-Base, kHttpContentBase
Content-Encoding, kHttpContentEncoding
Content-Language, kHttpContentLanguage
Content-Length, kHttpContentLength
Content-Location, kHttpContentLocation
Content-Md5, kHttpContentMd5
Content-Range, kHttpContentRange
Content-Type, kHttpContentType
Date, kHttpDate
Etag, kHttpEtag
Expires, kHttpExpires
From, kHttpFrom
Host, kHttpHost
If-Match, kHttpIfMatch
If-Modified-Since, kHttpIfModifiedSince
If-None-Match, kHttpIfNoneMatch
If-Range, kHttpIfRange
If-Unmodified-Since, kHttpIfUnmodifiedSince
Keep-Alive, kHttpKeepAlive
Max-Forwards, kHttpMaxForwards
Pragma, kHttpPragma
Proxy-Authenticate, kHttpProxyAuthenticate
Proxy-Authorization, kHttpProxyAuthorization
Proxy-Connection, kHttpProxyConnection
Range, kHttpRange
Referer, kHttpReferer
Transfer-Encoding, kHttpTransferEncoding
Upgrade, kHttpUpgrade
User-Agent, kHttpUserAgent
Via, kHttpVia
Location, kHttpLocation
Public, kHttpPublic
Retry-After, kHttpRetryAfter
Server, kHttpServer
Vary, kHttpVary
Warning, kHttpWarning
WWW-Authenticate, kHttpWwwAuthenticate
Last-Modified, kHttpLastModified