summaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-10-05 20:39:10 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-10-15 23:32:19 +0200
commitc6aedf680f6923ffbe4dd4fd4e68e7dadcd5fb19 (patch)
tree4f681e394e33c436ea94fd40db2ec126afdc0977 /lib/ssh.c
parent854976ad7b049e3a758d3d0ec33d5c998e36e5af (diff)
downloadgnurl-c6aedf680f6923ffbe4dd4fd4e68e7dadcd5fb19.tar.gz
gnurl-c6aedf680f6923ffbe4dd4fd4e68e7dadcd5fb19.tar.bz2
gnurl-c6aedf680f6923ffbe4dd4fd4e68e7dadcd5fb19.zip
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
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index 94195a7b6..f9bbdf104 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1740,8 +1740,8 @@ static CURLcode ssh_statemach_act(struct connectdata *conn, bool *block)
BUFSIZE : curlx_sotouz(data->state.resume_from - passed);
size_t actuallyread =
- data->set.fread_func(data->state.buffer, 1, readthisamountnow,
- data->set.in);
+ data->state.fread_func(data->state.buffer, 1,
+ readthisamountnow, data->state.in);
passed += actuallyread;
if((actuallyread == 0) || (actuallyread > readthisamountnow)) {