diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-01-19 14:57:19 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-01-19 15:03:04 +0200 |
commit | 81d96d30afb7dc25c624d4d546514e25822d3d36 (patch) | |
tree | 4868bd08a135916ad93f5609766c824f6847ae93 | |
parent | c93b34d382b0ec20d6daa40f2bbcfe195a625b73 (diff) |
rtsp-client: Also handle the (S|G)ET_PARAMETER case of size==0 || !data as keep-alive
If there is no Content-Length header, no body would be allocated and the
'\0' would also not be appended to the body.
-rw-r--r-- | gst/rtsp-server/rtsp-client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c index 2f580684ee..dca5d47ce7 100644 --- a/gst/rtsp-server/rtsp-client.c +++ b/gst/rtsp-server/rtsp-client.c @@ -985,8 +985,8 @@ handle_get_param_request (GstRTSPClient * client, GstRTSPContext * ctx) if (res != GST_RTSP_OK) goto bad_request; - if (size == 1) { - /* no body (only '\0'), keep-alive request */ + if (size == 0 || !data || strlen ((char *) data) == 0) { + /* no body (or only '\0'), keep-alive request */ send_generic_response (client, GST_RTSP_STS_OK, ctx); } else { /* there is a body, handle the params */ @@ -1022,8 +1022,8 @@ handle_set_param_request (GstRTSPClient * client, GstRTSPContext * ctx) if (res != GST_RTSP_OK) goto bad_request; - if (size == 1) { - /* no body (only '\0'), keep-alive request */ + if (size == 0 || !data || strlen ((char *) data) == 0) { + /* no body (or only '\0'), keep-alive request */ send_generic_response (client, GST_RTSP_STS_OK, ctx); } else { /* there is a body, handle the params */ |