From a11c632e3d6db17fb9bd14815f816f690358c348 Mon Sep 17 00:00:00 2001 From: Gabor Adam Toth Date: Wed, 4 May 2011 15:40:05 +0200 Subject: [PATCH] parser: fix for binary body length --- src/parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parser.c b/src/parser.c index 6778090..7fd694f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -381,9 +381,12 @@ psycParseRC psyc_parse (psycParseState* state, char* oper, { if (state->contentParsed < state->contentLength && psyc_parseBinaryValue(state, value, &(state->contentLength), - &(state->contentParsed)) == PSYC_PARSE_INCOMPLETE) + &(state->contentParsed)) == PSYC_PARSE_INCOMPLETE) return PSYC_PARSE_BODY_INCOMPLETE; + if (value->length) + value->length--; // \n at the end is not part of the body + if (state->cursor >= state->buffer.length) return PSYC_PARSE_BODY;