MINGW-packages/mingw-w64-live-media/0002-expose-server_string.patch
2022-05-23 07:58:05 +05:30

101 lines
4.0 KiB
Diff

From fccce9d5bacbdcaf50e4caad91c7f7d2493cbff7 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Wed, 17 Feb 2021 16:36:56 +0100
Subject: [PATCH 2/7] expose server_string
---
liveMedia/RTSPClient.cpp | 11 +++++++++--
liveMedia/include/RTSPClient.hh | 5 +++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/liveMedia/RTSPClient.cpp b/liveMedia/RTSPClient.cpp
index 02909c9..9ff6249 100644
--- a/liveMedia/RTSPClient.cpp
+++ b/liveMedia/RTSPClient.cpp
@@ -397,7 +397,7 @@ RTSPClient::RTSPClient(UsageEnvironment& env, char const* rtspURL,
desiredMaxIncomingPacketSize(0), fVerbosityLevel(verbosityLevel), fCSeq(1),
fAllowBasicAuthentication(True), fTunnelOverHTTPPortNum(tunnelOverHTTPPortNum),
fUserAgentHeaderStr(NULL), fUserAgentHeaderStrLen(0),
- fInputSocketNum(-1), fOutputSocketNum(-1), fBaseURL(NULL), fTCPStreamIdCount(0),
+ fInputSocketNum(-1), fOutputSocketNum(-1), fBaseURL(NULL), fserverString(NULL), fTCPStreamIdCount(0),
fLastSessionId(NULL), fSessionTimeoutParameter(0), fRequireStr(NULL),
fSessionCookieCounter(0), fHTTPTunnelingConnectionIsPending(False),
fTLS(*this) {
@@ -450,6 +450,7 @@ void RTSPClient::reset() {
fRequestsAwaitingResponse.reset();
setBaseURL(NULL);
+ setServerString(NULL);
fCurrentAuthenticator.reset();
@@ -460,6 +461,10 @@ void RTSPClient::setBaseURL(char const* url) {
delete[] fBaseURL; fBaseURL = strDup(url);
}
+void RTSPClient::setServerString(char const* str) {
+ delete[] fserverString; fserverString = strDup(str);
+}
+
int RTSPClient::grabSocket() {
int inputSocket = fInputSocketNum;
RTPInterface::clearServerRequestAlternativeByteHandler(envir(), fInputSocketNum); // in case we were receiving RTP-over-TCP
@@ -1760,6 +1765,7 @@ void RTSPClient::handleResponseBytes(int newBytesRead) {
char const* rtpInfoParamsStr = NULL;
char const* wwwAuthenticateParamsStr = NULL;
char const* publicParamsStr = NULL;
+ char const* serverStr = NULL;
char* bodyStart = NULL;
unsigned numBodyBytes = 0;
responseSuccess = False;
@@ -1837,7 +1843,8 @@ void RTSPClient::handleResponseBytes(int newBytesRead) {
// (see http://live555.com/liveMedia/faq.html#mailing-list-address for details),
)) {
// to check whether your proposed modification is appropriate/correct,
- } else if (checkForHeader(lineStart, "Range:",
+ } else if (checkForHeader(lineStart, "Server:", 7, serverStr)) {
+ setServerString(serverStr); } else if (checkForHeader(lineStart, "Range:",
// and, if so, whether instead it could be included in
6,
// a future release of the "LIVE555 Streaming Media" software,
diff --git a/liveMedia/include/RTSPClient.hh b/liveMedia/include/RTSPClient.hh
index eda7bd3..ba142ad 100644
--- a/liveMedia/include/RTSPClient.hh
+++ b/liveMedia/include/RTSPClient.hh
@@ -39,6 +39,8 @@ along with this library; if not, write to the Free Software Foundation, Inc.,
#endif
#endif
+#define VLC_PATCH_RTSPCLIENT_SERVERSTRING
+
class RTSPClient: public Medium {
public:
static RTSPClient* createNew(UsageEnvironment& env, char const* rtspURL,
@@ -194,6 +196,7 @@ public:
unsigned sessionTimeoutParameter() const { return fSessionTimeoutParameter; }
char const* url() const { return fBaseURL; }
+ char const* serverString() const { return fserverString; }
void useTLS() { fTLS.isNeeded = True; }
@@ -248,6 +251,7 @@ protected:
void reset();
void setBaseURL(char const* url);
+ void setServerString(char const* str);
int grabSocket(); // allows a subclass to reuse our input socket, so that it won't get closed when we're deleted
virtual unsigned sendRequest(RequestRecord* request);
virtual Boolean setRequestFields(RequestRecord* request,
@@ -349,6 +353,7 @@ private:
unsigned fUserAgentHeaderStrLen;
int fInputSocketNum, fOutputSocketNum;
char* fBaseURL;
+ char *fserverString;
unsigned char fTCPStreamIdCount; // used for (optional) RTP/TCP
char* fLastSessionId;
unsigned fSessionTimeoutParameter; // optionally set in response "Session:" headers
--
2.30.1.windows.1