This is the fast-http Reference Manual, version 0.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:05:09 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
fast-http
A fast HTTP protocol parser in Common Lisp
Eitaro Fukamachi
MIT
# fast-http
[![Build Status](https://travis-ci.org/fukamachi/fast-http.svg?branch=master)](https://travis-ci.org/fukamachi/fast-http)
This is a fast HTTP request/response protocol parser for Common Lisp.
## Features
* Parses both HTTP requests and responses.
* Handles persistent streams (keep-alive).
* Decodes chunked encoding.
* Exports low-level APIs which don’t any memory allocations during parsing.
## API differences from http-parse
The API is quite similar to [http-parse](https://github.com/orthecreedence/http-parse), although there’s some differences.
* ‘http‘, ‘http-request‘ and ‘http-response‘ are structure classes, not standard classes.
* ‘http‘ doesn’t have ‘:force-stream‘ option. (always streaming)
* ‘http‘ doesn’t have ‘:store-body‘ option because it can consume much memory.
* ‘body-callback‘ for ‘make-parser‘ doesn’t take a flag ‘body-complete-p‘.
* Use ‘finish-callback‘ to know if the parsing is finished.
* ‘body-callback‘ for ‘make-parser‘ takes pointers ‘start‘ and ‘end‘.
* ‘multipart-callback‘ for ‘make-parser‘ has been deleted.
* Use ‘make-multipart-parser‘ and ‘body-callback‘ by yourself.
* ‘:callback‘ of ‘make-multipart-parser‘ takes a stream, not a body octet vector at the 4th argument.
* Raises errors aggressively while parsing.
* Handle ‘fast-http-error‘ as you needed.
* Doesn’t use a property list as a representation of HTTP headers. (See [issue #1](https://github.com/fukamachi/fast-http/issues/1))
## APIs
### \[Structure] http
Base structure class extended by ‘http-request‘ and ‘http-response‘.
**NOTE**: Don’t use this class directly unless you’re intended to use low-level APIs of fast-http.
“‘common-lisp
(make-http)
;=> #S(FAST-HTTP.HTTP:HTTP
; :METHOD NIL
; :MAJOR-VERSION 0
; :MINOR-VERSION 9
; :STATUS 0
; :CONTENT-LENGTH NIL
; :CHUNKED-P NIL
; :UPGRADE-P NIL
; :HEADERS NIL
; :HEADER-READ 0
; :MARK -1
; :STATE 0)
“‘
#### Methods
- ‘http-method‘: Returns a HTTP request method in a keyword (such like ‘:GET‘, ‘:POST‘ or ‘:HEAD‘).
- ‘http-major-version‘: Returns a HTTP protocol major version in an integer (such like ‘1‘ or ‘0‘).
- ‘http-minor-version‘: Returns a HTTP protocol minor version in an integer (such like ‘1‘ or ‘0‘).
- ‘http-version‘: Returns a HTTP protocol version in a float (such like ‘1.0‘ or ‘1.1‘).
- ‘http-status‘: Returns a HTTP response status code in an integer (such like ‘200‘ or ‘302‘).
- ‘http-content-length‘: Returns a value of ‘Content-Length‘ header in an integer. If the header doesn’t exist, it returns ‘NIL‘.
- ‘http-chunked-p‘: Returns ‘T‘ if the value of ‘Transfer-Encoding‘ header is ‘chunked‘. If the header doesn’t exist, it returns ‘NIL‘.
- ‘http-upgrade-p‘: Returns ‘T‘ if ‘Upgrade‘ header exists.
- ‘http-headers‘: Returns a hash-table which represents HTTP headers. Note all hash keys are lower-cased and all values are string except ‘Set-Cookie‘ header, whose value is a list of strings. (‘Content-Length‘ -> ‘"content-length"‘).
### \[Structure] http-request (extends http)
Structure class holds values specific to an HTTP request.
“‘common-lisp
(make-http-request)
;=> #S(FAST-HTTP.HTTP:HTTP-REQUEST
; :METHOD NIL
; :MAJOR-VERSION 0
; :MINOR-VERSION 9
; :STATUS 0
; :CONTENT-LENGTH NIL
; :CHUNKED-P NIL
; :UPGRADE-P NIL
; :HEADERS NIL
; :HEADER-READ 0
; :MARK -1
; :STATE 0
; :RESOURCE NIL)
“‘
#### Methods
- ‘http-resource‘: Returns an URI string.
### \[Structure] http-response (extends http)
Structure class holds values specific to an HTTP response.
“‘common-lisp
(make-http-response)
;=> #S(FAST-HTTP.HTTP:HTTP-RESPONSE
; :METHOD NIL
; :MAJOR-VERSION 0
; :MINOR-VERSION 9
; :STATUS 0
; :CONTENT-LENGTH NIL
; :CHUNKED-P NIL
; :UPGRADE-P NIL
; :HEADERS NIL
; :HEADER-READ 0
; :MARK -1
; :STATE 0
; :STATUS-TEXT NIL)
“‘
#### Methods
- ‘http-status-text‘: Returns an response status text (such like ‘Continue‘, ‘OK‘ or ‘Bad Request‘).
### \[Function] make-parser (http &key first-line-callback header-callback body-callback finish-callback)
Makes a parser closure and returns it.
“‘common-lisp
(let ((http (make-http-request)))
(make-parser http
:body-callback
(lambda (data start end)
(write-to-buffer data start end))
:finish-callback
(lambda ()
(handle-response http))))
;=> #<CLOSURE (LAMBDA (DATA &KEY (START 0) END)
; :IN
; FAST-HTTP.PARSER:MAKE-PARSER) {10090BDD0B}>
“‘
The closure takes one required argument ‘data‘, that is a simple byte vector and two keyword arguments ‘start‘ and ‘end‘.
#### Callbacks
- ‘first-line-callback‘ (): This callback function will be called when the first line is parsed.
- ‘header-callback‘ (headers-hash-table): This callback function will be called when the header lines are parsed. This function is the same object to the ‘http‘ object holds.
- ‘body-callback‘ (data-byte-vector): This callback function will be called whenever it gets a chunk of HTTP body. Which means this can be called multiple times.
- ‘finish-callback‘ (): This callback function will be called when the HTTP message ends.
NOTE: If the HTTP request/response has multiple messages (like HTTP/1.1 pipelining), all these functions can be called multiple times.
### \[Function] make-multipart-parser (content-type callback)
Makes a multipart/form-data parser closure and returns it.
This takes 2 arguments, ‘content-type‘ (such like ‘"multipart/form-data; boundary=–AsB03x"‘) and ‘callback‘. The ‘callback‘ is a function which takes exact 4 arguments – a field name, field headers, field meta data and body bytes.
## Low-level APIs
The following functions are intended to be used for internally. These APIs are likely to change in the future.
Most of functions are declared as ‘(optimize (speed 3) (safety 0))‘ which means it won’t check the type of arguments.
### \[Structure] callbacks
Structure class holds callback functions. The callbacks are similar to ‘make-parser‘’s, but don’t correspond to them directly.
#### Slots
- ‘message-begin‘ (http): This will be called when a new HTTP message begins.
- ‘url‘ (http data start end): This will be called when an URL part of the HTTP request parsed.
- ‘first-line‘ (http): This will be called when the first line of the HTTP request/response parsed.
- ‘status‘ (http data start end): This will be called when the status text (not code) of the HTTP response parsed.
- ‘header-field‘ (http data start end): This will be called when a header field parsed.
- ‘header-value‘ (http data start end): This will be called when a header value parsed. This function can be called multiple times when the header value is folded onto multiple lines.
- ‘headers-complete‘ (http): This will be called when all headers parsed.
- ‘body‘ (http data start end): This will be called whenever the parser gets a chunk of HTTP body.
- ‘message-complete‘ (http): This will be called when the HTTP message ends.
### \[Function] parse-request (http callbacks data &key (start 0) end)
Parses ‘data‘ as an HTTP request, sets values to ‘http‘ and invokes callbacks in ‘callbacks‘.
This takes a ‘http‘ object, a ‘callbacks‘ object, and a simple byte vector ‘data‘ and two pointers – ‘start‘ and ‘end‘. If ‘end‘ is ‘nil‘, the length of ‘data‘ will be used.
### \[Function] parse-response (http callbacks data &key (start 0) end)
Parses ‘data‘ as an HTTP response, sets values to ‘http‘ and invokes callbacks in ‘callbacks‘.
Takes a ‘http‘ object, a ‘callbacks‘ object, and a simple byte vector ‘data‘ and two pointers – ‘start‘ and ‘end‘. If ‘end‘ is ‘nil‘, the length of ‘data‘ will be used.
### \[Condition] eof
Will be raised when the ‘data‘ ends in the middle of parsing.
## Installation
“‘common-lisp
(ql:quickload :fast-http)
“‘
## Running tests
“‘common-lisp
(asdf:test-system :fast-http)
“‘
## Benchmark
- Parsing an HTTP request header 100000 times.
In this benchmark, fast-http is **1.25 times faster** than [http-parser](https://github.com/joyent/http-parser), a C equivalent.
| http-parser (C) | fast-http |
| —————:| ———:|
| 0.108s | 0.086s |
### Environment
* Travis CI
* SBCL 1.2.6
You can see the latest result at [Travis CI](https://travis-ci.org/fukamachi/fast-http).
### fast-http (Common Lisp)
“‘common-lisp
(ql:quickload :fast-http-test)
(fast-http-test.benchmark:run-ll-benchmark)
“‘
“‘
Evaluation took:
0.086 seconds of real time
0.085897 seconds of total run time (0.084763 user, 0.001134 system)
100.00% CPU
257,140,751 processor cycles
0 bytes consed
“‘
### http-parser (C)
“‘c
#include "http_parser.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <time.h>
static http_parser *parser;
static http_parser_settings settings_null =
{.on_message_begin = 0
,.on_header_field = 0
,.on_header_value = 0
,.on_url = 0
,.on_status = 0
,.on_body = 0
,.on_headers_complete = 0
,.on_message_complete = 0
};
int
main (void)
{
const char *buf;
int i;
float start, end;
size_t parsed;
parser = malloc(sizeof(http_parser));
buf = "GET /cookies HTTP/1.1\r\nHost: 127.0.0.1:8090\r\nConnection: keep-alive\r\nCache-Control: max-age=0\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17\r\nAccept-Encoding: gzip,deflate,sdch\r\nAccept-Language: en-US,en;q=0.8\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3\r\nCookie: name=wookie\r\n\r\n";
start = (float)clock()/CLOCKS_PER_SEC;
for (i = 0; i < 100000; i++) {
http_parser_init(parser, HTTP_REQUEST);
parsed = http_parser_execute(parser, &settings_null, buf, strlen(buf));
}
end = (float)clock()/CLOCKS_PER_SEC;
free(parser);
parser = NULL;
printf("Elapsed %f seconds.\n", (end - start));
return 0;
}
“‘
“‘
$ make http_parser.o
$ gcc -Wall -Wextra -Werror -Wno-error=unused-but-set-variable -O3 http_parser.o mybench.c -o mybench
$ mybench
Elapsed 0.108815 seconds.
“‘
## Author
* Eitaro Fukamachi (e.arrows@gmail.com)
## Copyright
Copyright (c) 2014 Eitaro Fukamachi
## License
Licensed under the MIT License.
0.2.0
alexandria
(system).
cl-utilities
(system).
proc-parse
(system).
babel
(system).
xsubseq
(system).
smart-buffer
(system).
src
(module).
Modules are listed depth-first from the system components tree.
fast-http/src
fast-http
(system).
fast-http.lisp
(file).
http.lisp
(file).
parser.lisp
(file).
multipart-parser.lisp
(file).
byte-vector.lisp
(file).
error.lisp
(file).
util.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
fast-http/fast-http.asd
fast-http/src/fast-http.lisp
fast-http/src/http.lisp
fast-http/src/parser.lisp
fast-http/src/multipart-parser.lisp
fast-http/src/byte-vector.lisp
fast-http/src/error.lisp
fast-http/src/util.lisp
fast-http/src/fast-http.lisp
http.lisp
(file).
parser.lisp
(file).
multipart-parser.lisp
(file).
byte-vector.lisp
(file).
error.lisp
(file).
src
(module).
make-multipart-parser
(function).
make-parser
(function).
find-boundary
(function).
fast-http/src/http.lisp
src
(module).
+state-body+
(constant).
+state-chunk-body-end-crlf+
(constant).
+state-chunk-size+
(constant).
+state-first-line+
(constant).
+state-headers+
(constant).
+state-trailing-headers+
(constant).
http
(structure).
http-chunked-p
(reader).
(setf http-chunked-p)
(writer).
http-content-length
(reader).
(setf http-content-length)
(writer).
http-header-read
(reader).
(setf http-header-read)
(writer).
http-headers
(reader).
(setf http-headers)
(writer).
http-major-version
(reader).
(setf http-major-version)
(writer).
http-mark
(reader).
(setf http-mark)
(writer).
http-method
(reader).
(setf http-method)
(writer).
http-minor-version
(reader).
(setf http-minor-version)
(writer).
http-p
(function).
http-request
(structure).
http-request-p
(function).
http-resource
(reader).
(setf http-resource)
(writer).
http-response
(structure).
http-response-p
(function).
http-state
(reader).
(setf http-state)
(writer).
http-status
(reader).
(setf http-status)
(writer).
http-status-text
(reader).
(setf http-status-text)
(writer).
http-upgrade-p
(reader).
(setf http-upgrade-p)
(writer).
http-version
(function).
make-http
(function).
make-http-request
(function).
make-http-response
(function).
status-code
(type).
copy-http
(function).
copy-http-request
(function).
copy-http-response
(function).
fast-http/src/parser.lisp
http.lisp
(file).
error.lisp
(file).
byte-vector.lisp
(file).
util.lisp
(file).
src
(module).
callbacks
(structure).
eof
(condition).
make-callbacks
(function).
parse-request
(function).
parse-response
(function).
pointer
(type).
+max-header-line+
(constant).
+tokens+
(constant).
+unhex+
(constant).
callback-data
(macro).
callback-notify
(macro).
callbacks-body
(reader).
(setf callbacks-body)
(writer).
callbacks-first-line
(reader).
(setf callbacks-first-line)
(writer).
callbacks-header-field
(reader).
(setf callbacks-header-field)
(writer).
callbacks-header-value
(reader).
(setf callbacks-header-value)
(writer).
callbacks-headers-complete
(reader).
(setf callbacks-headers-complete)
(writer).
callbacks-message-begin
(reader).
(setf callbacks-message-begin)
(writer).
callbacks-message-complete
(reader).
(setf callbacks-message-complete)
(writer).
callbacks-p
(function).
callbacks-status
(reader).
(setf callbacks-status)
(writer).
callbacks-url
(reader).
(setf callbacks-url)
(writer).
copy-callbacks
(function).
expect-failed
(condition).
http-message-needs-eof-p
(function).
parse-body
(function).
parse-chunked-body
(function).
parse-header-field-and-value
(function).
parse-header-line
(function).
parse-header-value
(function).
parse-header-value-content-length
(function).
parse-header-value-parameters
(function).
parse-header-value-transfer-encoding
(function).
parse-headers
(function).
parse-http-version
(function).
parse-method
(function).
parse-status-code
(function).
parse-url
(function).
read-body-data
(function).
unhex-byte
(function).
fast-http/src/multipart-parser.lisp
parser.lisp
(file).
byte-vector.lisp
(file).
error.lisp
(file).
src
(module).
http-multipart-parse
(function).
ll-multipart-parser
(structure).
ll-multipart-parser-state
(reader).
(setf ll-multipart-parser-state)
(writer).
make-ll-multipart-parser
(function).
+body-almost-done+
(constant).
+body-done+
(constant).
+body-start+
(constant).
+header-field-start+
(constant).
+looking-for-delimiter+
(constant).
+maybe-delimiter-first-dash+
(constant).
+maybe-delimiter-second-dash+
(constant).
+maybe-delimiter-start+
(constant).
+parsing-delimiter+
(constant).
+parsing-delimiter-almost-done+
(constant).
+parsing-delimiter-dash+
(constant).
+parsing-delimiter-dash-start+
(constant).
+parsing-delimiter-done+
(constant).
+parsing-delimiter-end+
(constant).
copy-ll-multipart-parser
(function).
ll-multipart-parser-body-buffer
(reader).
(setf ll-multipart-parser-body-buffer)
(writer).
ll-multipart-parser-body-mark
(reader).
(setf ll-multipart-parser-body-mark)
(writer).
ll-multipart-parser-boundary
(reader).
(setf ll-multipart-parser-boundary)
(writer).
ll-multipart-parser-boundary-buffer
(reader).
(setf ll-multipart-parser-boundary-buffer)
(writer).
ll-multipart-parser-boundary-mark
(reader).
(setf ll-multipart-parser-boundary-mark)
(writer).
ll-multipart-parser-header-parser
(reader).
(setf ll-multipart-parser-header-parser)
(writer).
ll-multipart-parser-p
(function).
fast-http/src/byte-vector.lisp
src
(module).
+cr+
(constant).
+crlf+
(constant).
+dash+
(constant).
+lf+
(constant).
+page+
(constant).
+space+
(constant).
+tab+
(constant).
alpha-byte-char-p
(function).
alpha-byte-char-to-lower-char
(function).
alphanumeric-byte-char-p
(function).
append-byte-vectors
(function).
ascii-octets-to-lower-string
(function).
ascii-octets-to-string
(function).
digit-byte-char-p
(function).
digit-byte-char-to-integer
(function).
mark-byte-char-p
(function).
simple-byte-vector
(type).
byte-to-ascii-lower
(function).
fast-http/src/error.lisp
src
(module).
callback-error
(condition).
cb-body
(condition).
cb-first-line
(condition).
cb-header-field
(condition).
cb-header-value
(condition).
cb-headers-complete
(condition).
cb-message-begin
(condition).
cb-message-complete
(condition).
cb-status
(condition).
cb-url
(condition).
closed-connection
(condition).
fast-http-error
(condition).
header-overflow
(condition).
header-value-parsing-error
(condition).
invalid-boundary
(condition).
invalid-chunk-size
(condition).
invalid-constant
(condition).
invalid-content-length
(condition).
invalid-eof-state
(condition).
invalid-fragment
(condition).
invalid-header-token
(condition).
invalid-header-value
(condition).
invalid-host
(condition).
invalid-internal-state
(condition).
invalid-method
(condition).
invalid-multipart-body
(condition).
invalid-parameter-key
(condition).
invalid-parameter-value
(condition).
invalid-path
(condition).
invalid-port
(condition).
invalid-query-string
(condition).
invalid-status
(condition).
invalid-url
(condition).
invalid-version
(condition).
lf-expected
(condition).
multipart-parsing-error
(condition).
parsing-error
(condition).
paused-error
(condition).
strict-error
(condition).
unknown-error
(condition).
fast-http/src/util.lisp
error.lisp
(file).
src
(module).
case-byte
(macro).
casev
(macro).
casev=
(macro).
defun-careful
(macro).
defun-insane
(macro).
defun-speedy
(macro).
make-collector
(function).
number-string-p
(function).
tagcase
(macro).
tagcasev
(macro).
tagcasev=
(macro).
%whitespacep
(function).
*careful-declaration*
(special variable).
*insane-declaration*
(special variable).
*speedy-declaration*
(special variable).
position-not-whitespace
(function).
Packages are listed by definition order.
fast-http.multipart-parser
fast-http
fast-http-asd
fast-http.parser
fast-http.error
fast-http.http
fast-http.util
fast-http.byte-vector
fast-http.multipart-parser
common-lisp
.
fast-http.byte-vector
.
fast-http.error
.
http-multipart-parse
(function).
ll-multipart-parser
(structure).
ll-multipart-parser-state
(reader).
(setf ll-multipart-parser-state)
(writer).
make-ll-multipart-parser
(function).
+body-almost-done+
(constant).
+body-done+
(constant).
+body-start+
(constant).
+header-field-start+
(constant).
+looking-for-delimiter+
(constant).
+maybe-delimiter-first-dash+
(constant).
+maybe-delimiter-second-dash+
(constant).
+maybe-delimiter-start+
(constant).
+parsing-delimiter+
(constant).
+parsing-delimiter-almost-done+
(constant).
+parsing-delimiter-dash+
(constant).
+parsing-delimiter-dash-start+
(constant).
+parsing-delimiter-done+
(constant).
+parsing-delimiter-end+
(constant).
copy-ll-multipart-parser
(function).
ll-multipart-parser-body-buffer
(reader).
(setf ll-multipart-parser-body-buffer)
(writer).
ll-multipart-parser-body-mark
(reader).
(setf ll-multipart-parser-body-mark)
(writer).
ll-multipart-parser-boundary
(reader).
(setf ll-multipart-parser-boundary)
(writer).
ll-multipart-parser-boundary-buffer
(reader).
(setf ll-multipart-parser-boundary-buffer)
(writer).
ll-multipart-parser-boundary-mark
(reader).
(setf ll-multipart-parser-boundary-mark)
(writer).
ll-multipart-parser-header-parser
(reader).
(setf ll-multipart-parser-header-parser)
(writer).
ll-multipart-parser-p
(function).
fast-http
common-lisp
.
fast-http.byte-vector
.
fast-http.error
.
fast-http.http
.
fast-http.multipart-parser
.
fast-http.parser
.
xsubseq
.
make-multipart-parser
(function).
make-parser
(function).
find-boundary
(function).
fast-http.parser
common-lisp
.
fast-http.error
.
fast-http.http
.
proc-parse
.
callbacks
(structure).
eof
(condition).
make-callbacks
(function).
parse-request
(function).
parse-response
(function).
pointer
(type).
+max-header-line+
(constant).
+tokens+
(constant).
+unhex+
(constant).
callback-data
(macro).
callback-notify
(macro).
callbacks-body
(reader).
(setf callbacks-body)
(writer).
callbacks-first-line
(reader).
(setf callbacks-first-line)
(writer).
callbacks-header-field
(reader).
(setf callbacks-header-field)
(writer).
callbacks-header-value
(reader).
(setf callbacks-header-value)
(writer).
callbacks-headers-complete
(reader).
(setf callbacks-headers-complete)
(writer).
callbacks-message-begin
(reader).
(setf callbacks-message-begin)
(writer).
callbacks-message-complete
(reader).
(setf callbacks-message-complete)
(writer).
callbacks-p
(function).
callbacks-status
(reader).
(setf callbacks-status)
(writer).
callbacks-url
(reader).
(setf callbacks-url)
(writer).
copy-callbacks
(function).
expect-failed
(condition).
http-message-needs-eof-p
(function).
parse-body
(function).
parse-chunked-body
(function).
parse-header-field-and-value
(function).
parse-header-line
(function).
parse-header-value
(function).
parse-header-value-content-length
(function).
parse-header-value-parameters
(function).
parse-header-value-transfer-encoding
(function).
parse-headers
(function).
parse-http-version
(function).
parse-method
(function).
parse-status-code
(function).
parse-url
(function).
read-body-data
(function).
unhex-byte
(function).
fast-http.error
common-lisp
.
callback-error
(condition).
cb-body
(condition).
cb-first-line
(condition).
cb-header-field
(condition).
cb-header-value
(condition).
cb-headers-complete
(condition).
cb-message-begin
(condition).
cb-message-complete
(condition).
cb-status
(condition).
cb-url
(condition).
closed-connection
(condition).
fast-http-error
(condition).
header-overflow
(condition).
header-value-parsing-error
(condition).
invalid-boundary
(condition).
invalid-chunk-size
(condition).
invalid-constant
(condition).
invalid-content-length
(condition).
invalid-eof-state
(condition).
invalid-fragment
(condition).
invalid-header-token
(condition).
invalid-header-value
(condition).
invalid-host
(condition).
invalid-internal-state
(condition).
invalid-method
(condition).
invalid-multipart-body
(condition).
invalid-parameter-key
(condition).
invalid-parameter-value
(condition).
invalid-path
(condition).
invalid-port
(condition).
invalid-query-string
(condition).
invalid-status
(condition).
invalid-url
(condition).
invalid-version
(condition).
lf-expected
(condition).
multipart-parsing-error
(condition).
parsing-error
(condition).
paused-error
(condition).
strict-error
(condition).
unknown-error
(condition).
description
(slot).
fast-http.http
common-lisp
.
+state-body+
(constant).
+state-chunk-body-end-crlf+
(constant).
+state-chunk-size+
(constant).
+state-first-line+
(constant).
+state-headers+
(constant).
+state-trailing-headers+
(constant).
http
(structure).
http-chunked-p
(reader).
(setf http-chunked-p)
(writer).
http-content-length
(reader).
(setf http-content-length)
(writer).
http-header-read
(reader).
(setf http-header-read)
(writer).
http-headers
(reader).
(setf http-headers)
(writer).
http-major-version
(reader).
(setf http-major-version)
(writer).
http-mark
(reader).
(setf http-mark)
(writer).
http-method
(reader).
(setf http-method)
(writer).
http-minor-version
(reader).
(setf http-minor-version)
(writer).
http-p
(function).
http-request
(structure).
http-request-p
(function).
http-resource
(reader).
(setf http-resource)
(writer).
http-response
(structure).
http-response-p
(function).
http-state
(reader).
(setf http-state)
(writer).
http-status
(reader).
(setf http-status)
(writer).
http-status-text
(reader).
(setf http-status-text)
(writer).
http-upgrade-p
(reader).
(setf http-upgrade-p)
(writer).
http-version
(function).
make-http
(function).
make-http-request
(function).
make-http-response
(function).
status-code
(type).
copy-http
(function).
copy-http-request
(function).
copy-http-response
(function).
fast-http.util
common-lisp
.
case-byte
(macro).
casev
(macro).
casev=
(macro).
defun-careful
(macro).
defun-insane
(macro).
defun-speedy
(macro).
make-collector
(function).
number-string-p
(function).
tagcase
(macro).
tagcasev
(macro).
tagcasev=
(macro).
%whitespacep
(function).
*careful-declaration*
(special variable).
*insane-declaration*
(special variable).
*speedy-declaration*
(special variable).
position-not-whitespace
(function).
fast-http.byte-vector
common-lisp
.
+cr+
(constant).
+crlf+
(constant).
+dash+
(constant).
+lf+
(constant).
+page+
(constant).
+space+
(constant).
+tab+
(constant).
alpha-byte-char-p
(function).
alpha-byte-char-to-lower-char
(function).
alphanumeric-byte-char-p
(function).
append-byte-vectors
(function).
ascii-octets-to-lower-string
(function).
ascii-octets-to-string
(function).
digit-byte-char-p
(function).
digit-byte-char-to-integer
(function).
mark-byte-char-p
(function).
simple-byte-vector
(type).
byte-to-ascii-lower
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
mark
.
common-lisp
.
(quote nil)
:error
(quote "the body callback failed")
(quote "the first line callback failed")
(quote "the header-field callback failed")
(quote "the header-value callback failed")
(quote "the headers-complete callback failed")
(quote "the message-begin callback failed")
(quote "the message-complete callback failed")
(quote "the status callback failed")
(quote "the url callback failed")
(quote "data received after completed connection: close message")
condition
.
simple-error
.
(quote "too many header bytes seen; overflow detected")
(quote "invalid boundary")
(quote "invalid character in chunk size header")
(quote "invalid constant string")
(quote "invalid character in content-length header")
(quote "stream ended at an unexpected time")
(quote "invalid fragment")
(quote "invalid character in header")
(quote "invalid header value")
(quote "invalid host")
(quote "invalid http method")
(quote "invalid multipart body")
(quote "invalid parameter key")
(quote "invalid parameter value")
(quote "invalid path")
(quote "invalid port")
(quote "invalid query string")
(quote "invalid url")
(quote "invalid http version")
(quote "lf character expected")
closed-connection
.
expect-failed
.
header-overflow
.
invalid-chunk-size
.
invalid-constant
.
invalid-content-length
.
invalid-eof-state
.
invalid-fragment
.
invalid-header-token
.
invalid-host
.
invalid-internal-state
.
invalid-method
.
invalid-path
.
invalid-port
.
invalid-query-string
.
invalid-status
.
invalid-url
.
invalid-version
.
lf-expected
.
paused-error
.
strict-error
.
unknown-error
.
(quote "parser is paused")
(quote "an unknown error occured")
structure-object
.
(or null function)
(or null function)
(or null function)
(or null function)
(or null function)
(or null function)
(or null function)
(or null function)
(or null function)
structure-object
.
common-lisp
.
symbol
fixnum
0
fixnum
9
fast-http.http:status-code
0
(or null integer)
boolean
boolean
fixnum
0
fixnum
-1
fixnum
fast-http.http:+state-first-line+
structure-object
.
fixnum
0
Maximum number of header lines allowed.
This restriction is for protecting users’ application against denial-of-service attacks where the attacker feeds us a never-ending header that the application keeps buffering.
body
.
url
.
Jump to: | %
(
A B C D F H L M N P R T U |
---|
Jump to: | %
(
A B C D F H L M N P R T U |
---|
Jump to: | *
+
B C D E F H M R S U |
---|
Jump to: | *
+
B C D E F H M R S U |
---|
Jump to: | B C E F H I L M P S T U |
---|
Jump to: | B C E F H I L M P S T U |
---|