From a143133d43420ef89e4ba0d84c73998863cf9f81 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 11 Jul 2012 18:46:00 +0900 Subject: [PATCH] Use http_parser for tunneling connection transparently --- examples/http-parser/http_parser.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/http-parser/http_parser.c b/examples/http-parser/http_parser.c index 0c11eb8d..610da57c 100644 --- a/examples/http-parser/http_parser.c +++ b/examples/http-parser/http_parser.c @@ -1627,9 +1627,14 @@ size_t http_parser_execute (http_parser *parser, /* Exit, the rest of the connect is in a different protocol. */ if (parser->upgrade) { - parser->state = NEW_MESSAGE(); - CALLBACK_NOTIFY(message_complete); - return (p - data) + 1; + /* We want to use http_parser for tunneling connection + transparently */ + /* Read body until EOF */ + parser->state = s_body_identity_eof; + break; + /* parser->state = NEW_MESSAGE(); */ + /* CALLBACK_NOTIFY(message_complete); */ + /* return (p - data) + 1; */ } if (parser->flags & F_SKIPBODY) {