summaryrefslogtreecommitdiff
path: root/lib/rtsp.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-06 13:21:45 +0000
committerYang Tse <yangsita@gmail.com>2010-02-06 13:21:45 +0000
commit0f4a91afdedc4b1f7b02f8b015fde1889d80c104 (patch)
treea3277cf4f8ee0db7523ab4e33b0221faab1a5800 /lib/rtsp.c
parent2c2464a68211fb788b21de50a51798baa57423be (diff)
downloadcurl-0f4a91afdedc4b1f7b02f8b015fde1889d80c104.tar.gz
OOM handling fix
Diffstat (limited to 'lib/rtsp.c')
-rw-r--r--lib/rtsp.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c
index a63784eaa..8f3218947 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -127,8 +127,9 @@ CURLcode Curl_rtsp_disconnect(struct connectdata *conn) {
CURLcode Curl_rtsp_done(struct connectdata *conn,
CURLcode status, bool premature)
{
- CURLcode httpStatus;
struct SessionHandle *data = conn->data;
+ struct RTSP *rtsp = data->state.proto.rtsp;
+ CURLcode httpStatus;
long CSeq_sent;
long CSeq_recv;
@@ -138,18 +139,20 @@ CURLcode Curl_rtsp_done(struct connectdata *conn,
httpStatus = Curl_http_done(conn, status, premature);
- /* Check the sequence numbers */
- CSeq_sent = data->state.proto.rtsp->CSeq_sent;
- CSeq_recv = data->state.proto.rtsp->CSeq_recv;
- if((data->set.rtspreq != RTSPREQ_RECEIVE) && (CSeq_sent != CSeq_recv)) {
- failf(data, "The CSeq of this request %ld did not match the response %ld",
- CSeq_sent, CSeq_recv);
- return CURLE_RTSP_CSEQ_ERROR;
- }
- else if (data->set.rtspreq == RTSPREQ_RECEIVE &&
- (conn->proto.rtspc.rtp_channel == -1)) {
- infof(data, "Got an RTP Receive with a CSeq of %ld\n", CSeq_recv);
- /* TODO CPC: Server -> Client logic here */
+ if(rtsp) {
+ /* Check the sequence numbers */
+ CSeq_sent = rtsp->CSeq_sent;
+ CSeq_recv = rtsp->CSeq_recv;
+ if((data->set.rtspreq != RTSPREQ_RECEIVE) && (CSeq_sent != CSeq_recv)) {
+ failf(data, "The CSeq of this request %ld did not match the response %ld",
+ CSeq_sent, CSeq_recv);
+ return CURLE_RTSP_CSEQ_ERROR;
+ }
+ else if(data->set.rtspreq == RTSPREQ_RECEIVE &&
+ (conn->proto.rtspc.rtp_channel == -1)) {
+ infof(data, "Got an RTP Receive with a CSeq of %ld\n", CSeq_recv);
+ /* TODO CPC: Server -> Client logic here */
+ }
}
return httpStatus;
@@ -418,6 +421,8 @@ CURLcode Curl_rtsp(struct connectdata *conn, bool *done)
p_range ? p_range : "",
p_referrer ? p_referrer : "",
p_uagent ? p_uagent : "");
+ if(result)
+ return result;
if((rtspreq == RTSPREQ_SETUP) || (rtspreq == RTSPREQ_DESCRIBE)) {
result = Curl_add_timecondition(data, req_buffer);