From 4ad8e142da463ab208d5b5565e53291c8e5ef038 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 4 Aug 2013 19:34:16 +0200 Subject: 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. --- lib/tftp.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'lib/tftp.c') 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) -- cgit v1.2.3