From e1b3393d6b2e91d14a7a261ba3c74ea60896cb26 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Mon, 24 Aug 2009 10:19:35 +0200 Subject: [PATCH] rtsp: Ignore the Content-Length for POST requests. The Content-Length for POST requests with an x-sessioncookie header should be ignored as the length is bogus and only there to fool proxies. --- gst-libs/gst/rtsp/gstrtspconnection.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c index 7c8c780..29814d4 100644 --- a/gst-libs/gst/rtsp/gstrtspconnection.c +++ b/gst-libs/gst/rtsp/gstrtspconnection.c @@ -1806,9 +1806,14 @@ build_next (GstRTSPBuilder * builder, GstRTSPMessage * message, gchar *hdrval; /* empty line, end of message header */ - /* see if there is a Content-Length header */ + /* see if there is a Content-Length header, but ignore it if this + * is a POST request with an x-sessioncookie header */ if (gst_rtsp_message_get_header (message, - GST_RTSP_HDR_CONTENT_LENGTH, &hdrval, 0) == GST_RTSP_OK) { + GST_RTSP_HDR_CONTENT_LENGTH, &hdrval, 0) == GST_RTSP_OK && + (message->type != GST_RTSP_MESSAGE_HTTP_REQUEST || + message->type_data.request.method != GST_RTSP_POST || + gst_rtsp_message_get_header (message, + GST_RTSP_HDR_X_SESSIONCOOKIE, NULL, 0) != GST_RTSP_OK)) { /* there is, prepare to read the body */ builder->body_len = atol (hdrval); builder->body_data = g_malloc (builder->body_len + 1); -- 2.7.4