upload: allocate upload buffer on-demand

Saves 16KB on the easy handle for operations that don't need that
buffer.

Part 1 of #2888
This commit is contained in:
Daniel Stenberg 2018-08-17 00:49:37 +02:00
parent 4939f36524
commit e6e9b006f7
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 59 additions and 24 deletions

View file

@ -592,6 +592,7 @@ static CURLcode multi_done(struct connectdata **connp,
conn->dns_entry = NULL;
}
Curl_hostcache_prune(data);
Curl_safefree(data->state.ulbuf);
/* if the transfer was completed in a paused state there can be buffered
data left to free */
@ -1575,6 +1576,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
multistate(data, CURLM_STATE_SENDPROTOCONNECT);
}
}
else if(result)
stream_error = TRUE;
break;
#endif