Date: Tue, 3 Aug 1999 23:47:16 -0700 (PDT) From: Richard.Kiss@kalamalka.gizzywump.com To: FreeBSD-gnats-submit@freebsd.org Subject: ports/12949: rtsp_proxy port fixes Message-ID: <199908040647.XAA48502@kalamalka.gizzywump.com>
next in thread | raw e-mail | index | archive | help
>Number: 12949 >Category: ports >Synopsis: Fix for rtsp_proxy port. Patches from Jonathan Hogg (jonathan@onegoodidea.com). >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 3 23:50:01 PDT 1999 >Closed-Date: >Last-Modified: >Originator: Richard Kiss >Release: FreeBSD 3.2-STABLE i386 >Organization: >Environment: >Description: Fix for rtsp_proxy port; improves reliability on various systems. >How-To-Repeat: >Fix: Here's the patch: diff -ruN rtsp_proxy/Makefile rtsp_proxy-kiss/Makefile --- rtsp_proxy/Makefile Tue Aug 3 22:24:14 1999 +++ rtsp_proxy-kiss/Makefile Tue Aug 3 23:38:49 1999 @@ -3,7 +3,7 @@ # Date created: 8 June 1999 # Whom: Richard Kiss <richard@homemail.com> # -# $Id: Makefile,v 1.2 1999/08/01 02:35:05 steve Exp $ +# $Id: Makefile,v 1.1.1.1 1999/06/16 16:47:36 billf Exp $ # DISTNAME= SS1.0.1 diff -ruN rtsp_proxy/patches/patch-ac rtsp_proxy-kiss/patches/patch-ac --- rtsp_proxy/patches/patch-ac Wed Dec 31 16:00:00 1969 +++ rtsp_proxy-kiss/patches/patch-ac Tue Aug 3 23:26:47 1999 @@ -0,0 +1,22 @@ +--- ../proxy.c Tue Jul 6 17:42:19 1999 ++++ ../proxy.c Tue Jul 20 22:26:39 1999 +@@ -1142,7 +1142,18 @@ + } + // + // did we get a complete response yet? +- if (! has_two_crlfs(s->sinbuf)) ++ // ++ ++// this used to look for a blank line, which is a dumb way to check if we ++// have a complete response since that only means we have a complete header. ++// the correct method would be to check the 'Content-Length:' header, but ++// that's too much trouble without a lot of re-writing. so this is a cheap ++// hack to look and see if the buffer ends on a 'CRLF' pair - this might get ++// broken if we happen to break on an end-of-line, but it's better than ++// nothing. ++ ++ pBuf = s->sinbuf + s->amtInServerInBuffer - 2; ++ if ((pBuf[0] != '\r') || (pBuf[1] != '\n')) + break; + + // diff -ruN rtsp_proxy/patches/patch-ad rtsp_proxy-kiss/patches/patch-ad --- rtsp_proxy/patches/patch-ad Wed Dec 31 16:00:00 1969 +++ rtsp_proxy-kiss/patches/patch-ad Tue Aug 3 23:26:34 1999 @@ -0,0 +1,29 @@ +--- ../shared_udp.c Tue Jul 6 17:42:26 1999 ++++ ../shared_udp.c Tue Jul 20 23:54:38 1999 +@@ -259,7 +259,16 @@ + gNextPort++; + if (gNextPort > gUDPPortMax) + gNextPort = gUDPPortMin; +- } while (bind_socket_to_address(skt1, fromIP, port1 = gNextPort++, false) != 0); ++ } while (bind_socket_to_address(skt1, INADDR_ANY, port1 = gNextPort++, false) != 0); ++ ++// i've changed the previous bind and the next one below to bind to any ++// IP number rather than using 'fromIP'. 'fromIP' is obtained from gProxyIP ++// which is in turn obtained from 'get_local_ip_address'. this function ++// gets the current hostname and then resolves that into an address. however, ++// since a proxy server runs on a bridging system with multiple IP addresses, ++// this is as likely as not to return the wrong IP address, which results in ++// the proxy missing all of the traffic from the server. not binding to a ++// specific address is cheap but gets a result. + + if (withSib) { + retry_rtcp: +@@ -271,7 +280,7 @@ + else + goto bail_error; + } +- if (bind_socket_to_address(skt2, fromIP, port2 = gNextPort++, false) != 0) { ++ if (bind_socket_to_address(skt2, INADDR_ANY, port2 = gNextPort++, false) != 0) { + close_socket(skt1); + close_socket(skt2); + skt1 = INVALID_SOCKET; diff -ruN rtsp_proxy/patches/patch-ae rtsp_proxy-kiss/patches/patch-ae --- rtsp_proxy/patches/patch-ae Wed Dec 31 16:00:00 1969 +++ rtsp_proxy-kiss/patches/patch-ae Tue Aug 3 23:26:13 1999 @@ -0,0 +1,16 @@ +--- ../proxy.h Tue Jul 6 17:42:19 1999 ++++ ../proxy.h Tue Jul 20 22:26:39 1999 +@@ -80,7 +80,12 @@ + trans_pb RTCP_C2S_tpb; + } track_info; + +-#define RTSP_SESSION_BUF_SIZE 1024 ++// 1024 is too small for some server messages, so i've up'd this to 2048 ++// instead as the proxy will otherwise truncate the message before sending ++// it on to the client, this will confuse the client no end. ++ ++#define RTSP_SESSION_BUF_SIZE 2048 ++ + typedef struct rtsp_session { + struct rtsp_session *next; + int die; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199908040647.XAA48502>