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

Ross Finlayson finlayson at live555.com
Mon Feb 23 18:27:47 PST 2009


>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.

Yes.  In fact, the code should really be looking for (and handing, if 
present) a "Content-Length:" header for *any* command (not just 
?ET_PARAMETER), in case people want to subclass the server code to 
handle non-standard custom data of some sort (ugh).


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

No, not really.


>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.

Yes.  We already handle messages that get split before the \r\n\r\n, 
or even those that get split in the midst of the \r\n\r\n.  The code 
would also need to handle the possibility of getting the 
"Content-Length:" bytes of data in multiple chunks.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list