aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-26 19:16:38 -0700
committerJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-28 22:05:24 -0700
commitdacc44ddc2920cb1b2e3550bc803f7521c3166fa (patch)
tree9d20cede836d7b529132766a19c90bafae247c9f /lib
parentfc9f3698291d0ba59494207feed674e8d29d9c77 (diff)
security.c: We should always register the socket handler.
Following a change in the way socket handler are registered, the custom recv and send method were conditionaly registered. We need to register them everytime to handle the ftp security extensions. Re-added the clear text handling in sec_recv.
Diffstat (limited to 'lib')
-rw-r--r--lib/security.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/security.c b/lib/security.c
index 9e74eb277..5becb0c87 100644
--- a/lib/security.c
+++ b/lib/security.c
@@ -245,6 +245,10 @@ static ssize_t sec_recv(struct connectdata *conn, int sockindex,
*err = CURLE_OK;
+ /* Handle clear text response. */
+ if(conn->sec_complete == 0 || conn->data_prot == prot_clear)
+ return read(fd, buffer, len);
+
if(conn->in_buffer.eof_flag) {
conn->in_buffer.eof_flag = 0;
return 0;
@@ -550,12 +554,10 @@ static CURLcode choose_mech(struct connectdata *conn)
conn->mech = *mech;
conn->sec_complete = 1;
- if (conn->data_prot != prot_clear) {
- conn->recv[FIRSTSOCKET] = sec_recv;
- conn->send[FIRSTSOCKET] = sec_send;
- conn->recv[SECONDARYSOCKET] = sec_recv;
- conn->send[SECONDARYSOCKET] = sec_send;
- }
+ conn->recv[FIRSTSOCKET] = sec_recv;
+ conn->send[FIRSTSOCKET] = sec_send;
+ conn->recv[SECONDARYSOCKET] = sec_recv;
+ conn->send[SECONDARYSOCKET] = sec_send;
conn->command_prot = prot_safe;
/* Set the requested protection level */
/* BLOCKING */