summaryrefslogtreecommitdiff
path: root/lib/rtsp.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-09-25 18:53:29 +0200
committerYang Tse <yangsita@gmail.com>2011-09-25 19:05:46 +0200
commit119f43360b60c903982104944145d9cd8b7ec054 (patch)
tree7cba5f3f98a946c0dca572eb22a2f48e98c5ee10 /lib/rtsp.c
parente276802ff84d58aa2484f8292651dad4c50a5407 (diff)
downloadcurl-119f43360b60c903982104944145d9cd8b7ec054.tar.gz
allow write callbacks to indicate OOM to libcurl
Allow (*curl_write_callback) write callbacks to return CURL_WRITEFUNC_OUT_OF_MEMORY to properly indicate libcurl of OOM conditions inside the callback itself.
Diffstat (limited to 'lib/rtsp.c')
-rw-r--r--lib/rtsp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rtsp.c b/lib/rtsp.c
index 198c25dc1..77c1367ff 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -725,6 +725,11 @@ CURLcode rtp_client_write(struct connectdata *conn, char *ptr, size_t len)
writeit = data->set.fwrite_rtp?data->set.fwrite_rtp:data->set.fwrite_func;
wrote = writeit(ptr, 1, len, data->set.rtp_out);
+ if(CURL_WRITEFUNC_OUT_OF_MEMORY == wrote) {
+ failf (data, "Out of memory writing RTP data");
+ return CURLE_OUT_OF_MEMORY;
+ }
+
if(CURL_WRITEFUNC_PAUSE == wrote) {
failf (data, "Cannot pause RTP");
return CURLE_WRITE_ERROR;