From 7be45c77b13622e7a9eae5c25e953fe76e137dec Mon Sep 17 00:00:00 2001 From: "roberto@debian32" Date: Fri, 30 Sep 2011 09:42:19 +0200 Subject: [PATCH] added a check for http (2) --- proto/http.c | 2 ++ protocol.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/proto/http.c b/proto/http.c index 2ac6b2c1..6aaec90d 100644 --- a/proto/http.c +++ b/proto/http.c @@ -263,6 +263,8 @@ int uwsgi_proto_http_parser(struct wsgi_request *wsgi_req) { free(wsgi_req->proto_parser_buf); if (len < 0) uwsgi_error("recv()"); + // this is simple ping packet + else return -2; return -1; } diff --git a/protocol.c b/protocol.c index f224dd3e..845ea19e 100644 --- a/protocol.c +++ b/protocol.c @@ -366,7 +366,10 @@ int uwsgi_parse_packet(struct wsgi_request *wsgi_req, int timeout) { status = uwsgi_proto_uwsgi_parser(wsgi_req); } if (status < 0) { - uwsgi_log("error parsing request\n"); + if (status == -1) + uwsgi_log("error parsing request\n"); + else if (status == -2) + uwsgi_log("open-close packet (ping/check) received\n"); //close(upoll->fd); return 0; }