summaryrefslogtreecommitdiff
path: root/lib/security.c
diff options
context:
space:
mode:
authorJulien Chaffraix <julien.chaffraix@gmail.com>2010-09-12 16:32:41 -0700
committerDaniel Stenberg <daniel@haxx.se>2010-09-22 23:34:36 +0200
commit5ea9e78bd7ddc725a8056fdcc3d830fa5ff49fb1 (patch)
tree87c10385f4f47c74ae1f620ae7f3cf65e259d13b /lib/security.c
parent69d7c48072299850d1bf3e0a134cb9970ffc1850 (diff)
downloadcurl-5ea9e78bd7ddc725a8056fdcc3d830fa5ff49fb1.tar.gz
security.c: Curl_sec_fflush_fd tweaks
- Use an early return as it makes the code more readable. - Added a FIXME about a conversion.
Diffstat (limited to 'lib/security.c')
-rw-r--r--lib/security.c12
1 files changed, 7 insertions, 5 deletions
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;
}