From 5ea9e78bd7ddc725a8056fdcc3d830fa5ff49fb1 Mon Sep 17 00:00:00 2001 From: Julien Chaffraix Date: Sun, 12 Sep 2010 16:32:41 -0700 Subject: security.c: Curl_sec_fflush_fd tweaks - Use an early return as it makes the code more readable. - Added a FIXME about a conversion. --- lib/security.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/security.c') diff --git a/lib/security.c b/lib/security.c index 699be47a3..d0eccdf7f 100644 --- a/lib/security.c +++ b/lib/security.c @@ -336,12 +336,14 @@ static ssize_t sec_write(struct connectdata *conn, int fd, return tx; } -int -Curl_sec_fflush_fd(struct connectdata *conn, int fd) +/* FIXME: fd should be a curl_socket_t */ +int Curl_sec_fflush_fd(struct connectdata *conn, int fd) { - if(conn->data_prot != prot_clear) { - do_sec_send(conn, fd, NULL, 0); - } + if(conn->data_prot == prot_clear) + return 0; + + /* Force a flush by trying to send no data */ + do_sec_send(conn, fd, NULL, 0); return 0; } -- cgit v1.2.3