From cc9ab98c4479acefd0d889fa6dca0661871eb237 Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Sat, 13 Jul 2013 01:25:07 +0300 Subject: [PATCH] sipmsg: incorrect check for missing Content-Length Content-Length is only mandatory when Content-Type is present. This isn't a problem for the purple backend, but the telepathy backend aborts on fatal error messages. Noticed with a 302 HTTP response during Office 365 EWS autodiscover. (cherry picked from commit e627a0cadd672c5e9948dabf903545929c89cae6) --- src/core/sipmsg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/sipmsg.c b/src/core/sipmsg.c index 5e6cdff9..778f61a0 100644 --- a/src/core/sipmsg.c +++ b/src/core/sipmsg.c @@ -90,7 +90,11 @@ struct sipmsg *sipmsg_parse_header(const gchar *header) { if (tmp && sipe_strcase_equal(tmp, "chunked")) { msg->bodylen = SIPMSG_BODYLEN_CHUNKED; } else { - SIPE_DEBUG_FATAL_NOFORMAT("sipmsg_parse_header(): Content-Length header not found"); + tmp = sipmsg_find_header(msg, "Content-Type"); + if (tmp) + SIPE_DEBUG_FATAL_NOFORMAT("sipmsg_parse_header(): Content-Length header not found"); + else + msg->bodylen = 0; } } if(msg->response) { -- 2.11.4.GIT