summaryrefslogtreecommitdiff
path: root/lib/tftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-04 19:34:16 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-12 13:17:57 +0200
commit4ad8e142da463ab208d5b5565e53291c8e5ef038 (patch)
treed50e9d8c79ee1a8b1b1a71894b033808a68eab59 /lib/tftp.c
parente3ee73b70ceaf2663fc2d26a4102e131a7c9618d (diff)
downloadgnurl-4ad8e142da463ab208d5b5565e53291c8e5ef038.tar.gz
gnurl-4ad8e142da463ab208d5b5565e53291c8e5ef038.tar.bz2
gnurl-4ad8e142da463ab208d5b5565e53291c8e5ef038.zip
urldata: clean up the use of the protocol specific structs
1 - always allocate the struct in protocol->setup_connection. Some protocol handlers had to get this function added. 2 - always free at the end of a request. This is also an attempt to keep less memory in the handle after it is completed.
Diffstat (limited to 'lib/tftp.c')
-rw-r--r--lib/tftp.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index ef740b856..b582ab319 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -947,10 +947,6 @@ static CURLcode tftp_connect(struct connectdata *conn, bool *done)
blksize = TFTP_BLKSIZE_DEFAULT;
- /* If there already is a protocol-specific struct allocated for this
- sessionhandle, deal with it */
- Curl_reset_reqproto(conn);
-
state = conn->proto.tftpc = calloc(1, sizeof(tftp_state_data_t));
if(!state)
return CURLE_OUT_OF_MEMORY;
@@ -1307,14 +1303,6 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
*done = FALSE;
- /*
- Since connections can be re-used between SessionHandles, this might be a
- connection already existing but on a fresh SessionHandle struct so we must
- make sure we have a good 'struct TFTP' to play with. For new connections,
- the struct TFTP is allocated and setup in the tftp_connect() function.
- */
- Curl_reset_reqproto(conn);
-
if(!conn->proto.tftpc) {
code = tftp_connect(conn, done);
if(code)