if(!rtspc->in_header) {
/* If header parsing is done, extract interleaved RTP messages */
- if((data->set.rtspreq == RTSPREQ_DESCRIBE) && (data->req.size <= -1)) {
+ if(data->req.size <= -1) {
/* Respect section 4.4 of rfc2326: If the Content-Length header is
- absent, a length 0 must be assumed. It will prevent libcurl from
- hanging on DESCRIBE request that got refused for whatever
- reason */
+ absent, a length 0 must be assumed. */
+ data->req.size = 0;
data->req.download_done = TRUE;
}
result = rtsp_filter_rtp(data, buf, blen, &consumed);
if(rtspc->state != RTP_PARSE_SKIP)
*done = FALSE;
- /* we MUST have consumed all bytes */
- DEBUGF(infof(data, "rtsp_rtp_write_resp(len=%zu, in_header=%d, done=%d)",
- blen, rtspc->in_header, *done));
- DEBUGASSERT(blen == 0);
- if(!result && is_eos) {
- result = Curl_client_write(data, CLIENTWRITE_BODY|CLIENTWRITE_EOS,
- (char *)buf, 0);
+ /* we SHOULD have consumed all bytes, unless the response is borked.
+ * In which case we write out the left over bytes, letting the client
+ * writer deal with it (it will report EXCESS and fail the transfer). */
+ DEBUGF(infof(data, "rtsp_rtp_write_resp(len=%zu, in_header=%d, done=%d "
+ " rtspc->state=%d, req.size=%" CURL_FORMAT_CURL_OFF_T ")",
+ blen, rtspc->in_header, *done, rtspc->state, data->req.size));
+ if(!result && (is_eos || blen)) {
+ result = Curl_client_write(data, CLIENTWRITE_BODY|
+ (is_eos? CLIENTWRITE_EOS:0),
+ (char *)buf, blen);
}
out:
test653 test654 test655 test656 test658 test659 test660 test661 test662 \
test663 test664 test665 test666 test667 test668 test669 test670 test671 \
test672 test673 test674 test675 test676 test677 test678 test679 test680 \
-test681 test682 test683 test684 test685 test686 test687 test688 \
+test681 test682 test683 test684 test685 test686 test687 test688 test689 \
\
test700 test701 test702 test703 test704 test705 test706 test707 test708 \
test709 test710 test711 test712 test713 test714 test715 test716 test717 \
/* Dump data to stdout for protocol verification */
test_setopt(curl, CURLOPT_HEADERDATA, stdout);
test_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
test_setopt(curl, CURLOPT_URL, URL);
test_setopt(curl, CURLOPT_RTSP_STREAM_URI, URL);