summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2017-01-19 14:57:19 +0200
committerSebastian Dröge <sebastian@centricular.com>2017-01-19 14:57:19 +0200
commitcd4e675f0cd91619d3acfe85ceeb4ae103762d6d (patch)
tree6b83c12545f1d87c567993508d4513ac4faafcb9
parentac1124efb4e5e1cef2853628ba5cb46cdb30308d (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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/rtsp-server/rtsp-client.c b/gst/rtsp-server/rtsp-client.c
index 63ac61727e..cf78b17578 100644
--- a/gst/rtsp-server/rtsp-client.c
+++ b/gst/rtsp-server/rtsp-client.c
@@ -1250,8 +1250,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 */
@@ -1302,8 +1302,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 */