Add documentation about callback return valeus

event_stream
Ryan Dahl 15 years ago
parent e09651c6bb
commit 69cf8d8da9

@ -101,6 +101,9 @@ There are two types of callbacks:
Callbacks: (requests only) on_path, on_query_string, on_uri, on_fragment,
(common) on_header_field, on_header_value, on_body;
Callbacks must return 0 on success. Returning a non-zero value indicates
error to the parser, making it exit immediately.
In case you parse HTTP message in chunks (i.e. `read()` request line
from socket, parse, read half headers, parse, etc) your data callbacks
may be called more than once. Http-parser guarantees that data pointer is only

Loading…
Cancel
Save