From c6aedf680f6923ffbe4dd4fd4e68e7dadcd5fb19 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Oct 2015 20:39:10 +0200 Subject: fread_func: move callback pointer from set to state struct ... and assign it from the set.fread_func_set pointer in the Curl_init_CONNECT function. This A) avoids that we have code that assigns fields in the 'set' struct (which we always knew was bad) and more importantly B) it makes it impossibly to accidentally leave the wrong value for when the handle is re-used etc. Introducing a state-init functionality in multi.c, so that we can set a specific function to get called when we enter a state. The Curl_init_CONNECT is thus called when switching to the CONNECT state. Bug: https://github.com/bagder/curl/issues/346 Closes #346 --- lib/transfer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/transfer.h') diff --git a/lib/transfer.h b/lib/transfer.h index 316aeaebc..b0676df2b 100644 --- a/lib/transfer.h +++ b/lib/transfer.h @@ -22,6 +22,8 @@ * ***************************************************************************/ +void Curl_init_CONNECT(struct SessionHandle *data); + CURLcode Curl_pretransfer(struct SessionHandle *data); CURLcode Curl_second_connect(struct connectdata *conn); CURLcode Curl_posttransfer(struct SessionHandle *data); -- cgit v1.2.3