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).
This commit is contained in:
Peter Kjellerstedt 2009-08-19 09:31:51 +02:00
parent 3b888cfe2a
commit 3c4fa9274f

View file

@ -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 */