diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2007-08-30 18:26:19 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2007-08-30 18:26:19 +0000 |
commit | 5d4c981e130adac09fc13bc04494f5f56294cc79 (patch) | |
tree | 0bb9378a804e7b0c249da8f677842c15809a4ead | |
parent | da4a7767583a7805aabedb2adea4f47cfbc724e7 (diff) |
Fixed a few compiler warnings. Try to do a slightly better job of
cleaning up after an OOM condition in curl_multi_add_handle
-rw-r--r-- | lib/multi.c | 10 | ||||
-rw-r--r-- | tests/server/sockfilt.c | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/multi.c b/lib/multi.c index 42294eeb6..b2e513043 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -511,7 +511,7 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle, /* We want the connection cache to have plenty room. Before we supported the shared cache every single easy handle had 5 entries in their cache by default. */ - int newmax = multi->num_easy * 4; + long newmax = multi->num_easy * 4; if(multi->maxconnects && (multi->maxconnects < newmax)) /* don't grow beyond the allowed size */ @@ -520,9 +520,11 @@ CURLMcode curl_multi_add_handle(CURLM *multi_handle, if(newmax > multi->connc->num) { /* we only do this is we can in fact grow the cache */ CURLcode res = Curl_ch_connc(easy_handle, multi->connc, newmax); - if(res != CURLE_OK) - /* TODO: we need to do some cleaning up here! */ - return CURLM_OUT_OF_MEMORY; + if(res != CURLE_OK) { + /* FIXME: may need to do more cleanup here */ + curl_multi_remove_handle(multi_handle, easy_handle); + return res; + } } } diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c index bd54f8812..b4e1c07f0 100644 --- a/tests/server/sockfilt.c +++ b/tests/server/sockfilt.c @@ -320,8 +320,8 @@ static int juggle(curl_socket_t *sockfdp, nread_stdin = 0; do { /* get data in the buffer at the correct position */ - ssize_t rc = read(fileno(stdin), &buffer[nread_stdin], - buffer_len - nread_stdin); + rc = read(fileno(stdin), &buffer[nread_stdin], + buffer_len - nread_stdin); logmsg("read %d bytes", rc); if(rc <= 0) return FALSE; |