From 69cf8d8da9ba0907192f26239eb41223871dd46c Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 13 Mar 2010 20:53:47 -0800 Subject: [PATCH] Add documentation about callback return valeus --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 959117e..3b1d422 100644 --- a/README.md +++ b/README.md @@ -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