summaryrefslogtreecommitdiff
path: root/lib/system.c
diff options
context:
space:
mode:
authorTim Ruehsen <tim.ruehsen@gmx.de>2016-07-25 13:00:12 +0200
committerNikos Mavrogiannopoulos <nmav@redhat.com>2016-07-26 14:23:51 +0200
commit0f67ccecddbe6533b51e74c955a4629654e79ae3 (patch)
treea5a33b5478f294f13f23f261ba4ec26c00960aa7 /lib/system.c
parente340e7a65d9a255121de2190d194af20e8e7779e (diff)
downloadgnutls-0f67ccecddbe6533b51e74c955a4629654e79ae3.tar.gz
Support TCP Fast Open
This introduces a new function gnutls_transport_set_fastopen(). Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com> Signed-off-by: Tim Ruehsen <tim.ruehsen@gmx.de>
Diffstat (limited to 'lib/system.c')
-rw-r--r--lib/system.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/lib/system.c b/lib/system.c
index 5c9bc6e68f..d1e1171da6 100644
--- a/lib/system.c
+++ b/lib/system.c
@@ -111,10 +111,9 @@ int system_errno(gnutls_transport_ptr_t ptr)
return errno;
}
-#ifdef MSG_NOSIGNAL
-ssize_t
-system_writev_nosignal(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
- int iovec_cnt)
+static ssize_t
+_system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
+ int iovec_cnt, int flags)
{
struct msghdr hdr;
@@ -122,22 +121,26 @@ system_writev_nosignal(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
hdr.msg_iov = (struct iovec *)iovec;
hdr.msg_iovlen = iovec_cnt;
- return sendmsg(GNUTLS_POINTER_TO_INT(ptr), &hdr, MSG_NOSIGNAL);
+ return sendmsg(GNUTLS_POINTER_TO_INT(ptr), &hdr, flags);
}
-#endif
+#ifdef MSG_NOSIGNAL
ssize_t
-system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
+system_writev_nosignal(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
int iovec_cnt)
{
- struct msghdr hdr;
+ return _system_writev(ptr, iovec, iovec_cnt, MSG_NOSIGNAL);
+}
- memset(&hdr, 0, sizeof(hdr));
- hdr.msg_iov = (struct iovec *)iovec;
- hdr.msg_iovlen = iovec_cnt;
+#endif
- return sendmsg(GNUTLS_POINTER_TO_INT(ptr), &hdr, 0);
+ssize_t
+system_writev(gnutls_transport_ptr_t ptr, const giovec_t * iovec,
+ int iovec_cnt)
+{
+ return _system_writev(ptr, iovec, iovec_cnt, 0);
}
+
#endif