summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2009-08-19 09:31:51 +0200
committerPeter Kjellerstedt <pkj@axis.com>2009-08-19 09:31:51 +0200
commit3c4fa9274fa490b44da71322fc1fcfe62562b87a (patch)
tree11125d206eea111075fa95cda861667ef610b141
parent3b888cfe2a8c6fda76daaba45f251e708565c194 (diff)
rtsp: Avoid duplicated headers.
Remove any existing Session and Date headers before adding new ones when sending a request. This may happen if the user of this code reuses a request (rtspsrc does this when resending after authorization fails).
-rw-r--r--gst-libs/gst/rtsp/gstrtspconnection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspconnection.c b/gst-libs/gst/rtsp/gstrtspconnection.c
index 58e5d2e7b..3db4f6749 100644
--- a/gst-libs/gst/rtsp/gstrtspconnection.c
+++ b/gst-libs/gst/rtsp/gstrtspconnection.c
@@ -1255,6 +1255,7 @@ message_to_string (GstRTSPConnection * conn, GstRTSPMessage * message)
message->type_data.request.uri, conn->cseq++);
/* add session id if we have one */
if (conn->session_id[0] != '\0') {
+ gst_rtsp_message_remove_header (message, GST_RTSP_HDR_SESSION, -1);
gst_rtsp_message_add_header (message, GST_RTSP_HDR_SESSION,
conn->session_id);
}
@@ -1296,6 +1297,7 @@ message_to_string (GstRTSPConnection * conn, GstRTSPMessage * message)
gen_date_string (date_string, sizeof (date_string));
/* add date header */
+ gst_rtsp_message_remove_header (message, GST_RTSP_HDR_DATE, -1);
gst_rtsp_message_add_header (message, GST_RTSP_HDR_DATE, date_string);
/* append headers */