curl-library
Re: RTSP unit tests, and some bugfixes
Date: Mon, 01 Feb 2010 15:00:03 -0500
On Fri, 2010-01-29 at 02:17 +0100, Yang Tse wrote:
> 2010/1/28, Chris Conroy wrote:
>
> > Minor addendum to the excess read stuff. Both the pipelined and
> > non-pipelined case need to check for excess > 0 && !k->ignorebody.
>
> Committed.
>
Quick fix to make the code match with the RTP documentation regarding
writing out the whole header. The docs say it writes the whole header,
but the code (before this patch) did not write out the leading $. I
think it's clearer (if slightly wasteful) to write the entire header as
the docs indicate. Also, adding a check to the coded message size since
the docs stipulate that each call will contain a full protocol packet.
Index: tests/libtest/lib571.c
===================================================================
RCS file: /cvsroot/curl/curl/tests/libtest/lib571.c,v
retrieving revision 1.2
diff -r1.2 lib571.c
31,32c31,33
< int channel = (int)data[0];
< int message_size = (int)(size * nmemb - 3);
--- > int channel = (int)data[1]; > int message_size = (int)(size * nmemb - 4); > unsigned short coded_size = ntohs(*((unsigned short*)(&data[2]))); 36a38,41 > if((unsigned short) message_size != coded_size) { > printf("RTP embedded size (%hu) does not match the write size % d.\n", > coded_size, message_size); > } 38c43 < data += 3; --- > data += 4; Index: lib/rtsp.c =================================================================== RCS file: /cvsroot/curl/curl/lib/rtsp.c,v retrieving revision 1.6 diff -r1.6 rtsp.c 568c568 < result = rtp_client_write(conn, &rtp[1], rtp_length + 3); --- > result = rtp_client_write(conn, &rtp[0], rtp_length + 4); ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2010-02-01