Projects
home:jnweiger
dvswitch-git
revert_wouter.diff
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File revert_wouter.diff of Package dvswitch-git
diff --git a/src/tally_rtsp_server.cpp b/src/tally_rtsp_server.cpp index 382f6cd..b8ad598 100644 --- a/src/tally_rtsp_server.cpp +++ b/src/tally_rtsp_server.cpp @@ -50,30 +50,30 @@ tally_rtsp_server* tally_rtsp_server::createNew(int pipefd, bool verbose, UsageE return NULL; } -RTSPServer::RTSPClientConnection* -tally_rtsp_server::createNewClientConnection(int clientSocket, struct sockaddr_in clientAddr) +RTSPServer::RTSPClientSession* +tally_rtsp_server::createNewClientSession(unsigned sessionId, int clientSocket, struct sockaddr_in clientAddr) { - return new RTSPClientConnection(*this, clientSocket, clientAddr); + return new RTSPClientSession(*this, sessionId, clientSocket, clientAddr); } -tally_rtsp_server::RTSPClientConnection::RTSPClientConnection(tally_rtsp_server& ourServer, int clientSocket, struct sockaddr_in clientAddr) - : RTSPServer::RTSPClientConnection(ourServer, clientSocket, clientAddr), server_(ourServer) +tally_rtsp_server::RTSPClientSession::RTSPClientSession(tally_rtsp_server& ourServer, unsigned sessionId, int clientSocket, struct sockaddr_in clientAddr) + : RTSPServer::RTSPClientSession(ourServer, sessionId, clientSocket, clientAddr), server_(ourServer) { } -tally_rtsp_server::RTSPClientConnection::~RTSPClientConnection() +tally_rtsp_server::RTSPClientSession::~RTSPClientSession() { } void -tally_rtsp_server::RTSPClientConnection::handleCmd_SET_PARAMETER(ServerMediaSubsession* subsession __attribute__((unused)), char const* cseq, char const* fullRequestStr) +tally_rtsp_server::RTSPClientSession::handleCmd_SET_PARAMETER(ServerMediaSubsession* subsession __attribute__((unused)), char const* cseq, char const* fullRequestStr) { enum tally newstate; const char* tallyloc; tallyloc = strstr(fullRequestStr, "TALLY:"); if (!tallyloc) { - setRTSPResponse("RTSP/1.0 200 OK"); + snprintf((char*)fResponseBuffer, sizeof(fResponseBuffer), "RTSP/1.0 200 OK\r\nCSeq: %s\r\n%sSession: %08X\r\n\r\n", cseq, dateHeader(), fOurSessionId); } char* ptr; if ((ptr = (char*)strchr(tallyloc, '\r'))) @@ -101,7 +101,9 @@ tally_rtsp_server::RTSPClientConnection::handleCmd_SET_PARAMETER(ServerMediaSubs else { // invalid - setRTSPResponse("RTSP/1.0 400 Bad Request"); + snprintf((char*)fResponseBuffer, sizeof(fResponseBuffer), + "RTSP/1.0 400 Bad Request\r\nCSeq: %s\r\n%sSession: %08X\r\n\r\n", + cseq, dateHeader(), fOurSessionId); return; } if (newstate != server_.tally_state_) @@ -114,5 +116,7 @@ tally_rtsp_server::RTSPClientConnection::handleCmd_SET_PARAMETER(ServerMediaSubs perror("write to pipe"); } } - setRTSPResponse("RTSP/1.0 200 OK"); + snprintf((char*)fResponseBuffer, sizeof(fResponseBuffer), + "RTSP/1.0 200 OK\r\nCSeq: %s\r\n%sSession: %08X\r\n\r\n", + cseq, dateHeader(), fOurSessionId); } diff --git a/src/tally_rtsp_server.hpp b/src/tally_rtsp_server.hpp index 7522511..fd120a4 100644 --- a/src/tally_rtsp_server.hpp +++ b/src/tally_rtsp_server.hpp @@ -16,7 +16,7 @@ public: protected: tally_rtsp_server(int pipefd, bool verbose, UsageEnvironment& env, int ourSocket, Port ourPort, UserAuthenticationDatabase* authDatabase, unsigned reclamationTestSeconds); virtual ~tally_rtsp_server(); - virtual RTSPServer::RTSPClientConnection* createNewClientConnection(int clientSocket, struct sockaddr_in clientAddr); + virtual RTSPServer::RTSPClientSession* createNewClientSession(unsigned sessionId, int clientSocket, struct sockaddr_in clientAddr); private: int pipefd_; enum tally { @@ -25,11 +25,11 @@ private: TALLY_CUE } tally_state_; bool verbose_; - class RTSPClientConnection: public RTSPServer::RTSPClientConnection + class RTSPClientSession: public RTSPServer::RTSPClientSession { public: - RTSPClientConnection(tally_rtsp_server& ourServer, int clientSocket, struct sockaddr_in clientAddr); - virtual ~RTSPClientConnection(); + RTSPClientSession(tally_rtsp_server& ourServer, unsigned sessionId, int clientSocket, struct sockaddr_in clientAddr); + virtual ~RTSPClientSession(); protected: virtual void handleCmd_SET_PARAMETER(ServerMediaSubsession* subsession, char const* cseq, char const* fullRequestStr); private:
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.