diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2007-10-30 23:00:40 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2007-10-30 23:00:40 +0000 |
commit | 59b05ac383f45ac3fe2e9fba899b440def9da2bd (patch) | |
tree | fcfb95fbe79dbfee28382f65147e6108350773c2 /lib/url.c | |
parent | 9b15f1be2649da787d9ebdf4a65a973523acbbbe (diff) |
Fixed an OOM problem with file: URLs
Moved Curl_file_connect into the protocol handler struct.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3638,10 +3638,12 @@ static CURLcode CreateConnection(struct SessionHandle *data, * file: is a special case in that it doesn't need a network connection ***********************************************************************/ #ifndef CURL_DISABLE_FILE - if (strequal(conn->protostr, "FILE")) { + if(conn->protocol & PROT_FILE) { + bool done; /* this is supposed to be the connect function so we better at least check that the file is present here! */ - result = Curl_file_connect(conn); + DEBUGASSERT(conn->handler->connect_it); + result = conn->handler->connect_it(conn, &done); /* Setup a "faked" transfer that'll do nothing */ if(CURLE_OK == result) { @@ -3652,8 +3654,8 @@ static CURLcode CreateConnection(struct SessionHandle *data, result = setup_range(data); if(result) { - if(conn->handler->done) - result = conn->handler->done(conn, result, FALSE); + DEBUGASSERT(conn->handler->done); + conn->handler->done(conn, result, FALSE); return result; } |