[Live-devel] Problem with RTSPServer::RTSPClientSession::incomingRequestHandler1() and SET_PARAMETER & GET_PARAMETER

Matt Schuckmann matt at schuckmannacres.com
Mon Feb 23 17:26:58 PST 2009


I see a problem with the while loop for detecting the end of a RTSP 
command in RTSPServer::RTSPClientSession::incomingRequestHandler1() and 
the commands SET_PARAMETER and GET_PARAMETER either of which with actual 
parameters to set.

Basically the while loop looks for <CR><LF><CR><LF> and then determines 
that it has gotten the full command.
However in both SET_PARAMETER and GET_PARAMETER this sequence appears 
between the Content-type: header and the parameters to set or get.

I guess the solution is going to have to be to make this while loop 
smarter to detect what type of command is being received and if it's a 
GET or SET look at the content-length header to determine how much data 
needs to be read.

Any on the best way to accomplish this? Is there generalized header 
parsing code anywhere in the library.

Thanks,
Matt S.

PS. The current code appears to work most of the time in that generally 
an entire message comes in at once and the server passes all the data it 
received on to the lower level handling code, even the stuff that is 
beyond what it thinks was the end of the message. However, if the socket 
receive code ever split the message up after the first <CR><LF><CR><LF> 
the server could get very confused.

PPS. Am I using the term header correctly in referring to things like 
the Content-type and Content-length lines?



More information about the live-devel mailing list