server: use 5 second linger period in SO_LINGER
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 19 Aug 2010 16:52:47 +0000 (18:52 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 19 Aug 2010 16:52:47 +0000 (18:52 +0200)
Wait 5 seconds before clearing the send buffers and reseting the connection with
the client when we do a close. This should be enough time to get the message to
the client.

See #622757

gst/rtsp-server/rtsp-server.c

index 7b52ffa..cc03456 100644 (file)
@@ -480,7 +480,7 @@ gst_rtsp_server_sink_init_send (GstRTSPServer * server)
   /* make sure socket is reset immediately after close. This ensure that we can
    * reuse the socket quickly. */
   linger.l_onoff = 1;
-  linger.l_linger = 0;
+  linger.l_linger = 5;
   if (setsockopt (server->server_sock.fd, SOL_SOCKET, SO_LINGER,
           (void *) &linger, sizeof (linger)) < 0)
     goto linger_failed;