From c9402a5a42c804a2a4574e61c4b275094c789411 Mon Sep 17 00:00:00 2001 From: "tg(x)" <*@tg-x.net> 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;