[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27772 - in libmicrohttpd/src: include microspdy testspdy
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27772 - in libmicrohttpd/src: include microspdy testspdy |
Date: |
Fri, 5 Jul 2013 19:30:18 +0200 |
Author: andreyu
Date: 2013-07-05 19:30:18 +0200 (Fri, 05 Jul 2013)
New Revision: 27772
Modified:
libmicrohttpd/src/include/microspdy.h
libmicrohttpd/src/microspdy/io_raw.c
libmicrohttpd/src/testspdy/test_notls.c
Log:
spdy: NO_DELAY flag added to the daemon to set TCP_NODELAY on sockets
Modified: libmicrohttpd/src/include/microspdy.h
===================================================================
--- libmicrohttpd/src/include/microspdy.h 2013-07-05 17:16:11 UTC (rev
27771)
+++ libmicrohttpd/src/include/microspdy.h 2013-07-05 17:30:18 UTC (rev
27772)
@@ -399,6 +399,12 @@
* starting daemon will fail.
*/
SPDY_DAEMON_FLAG_ONLY_IPV6 = 1,
+
+ /**
+ * All sessions' sockets will be set with TCP_NODELAY if the flag is
+ * used. Option considered only by SPDY_IO_SUBSYSTEM_RAW.
+ */
+ SPDY_DAEMON_FLAG_NO_DELAY = 2,
};
Modified: libmicrohttpd/src/microspdy/io_raw.c
===================================================================
--- libmicrohttpd/src/microspdy/io_raw.c 2013-07-05 17:16:11 UTC (rev
27771)
+++ libmicrohttpd/src/microspdy/io_raw.c 2013-07-05 17:30:18 UTC (rev
27772)
@@ -26,6 +26,8 @@
#include "internal.h"
#include "session.h"
#include "io_raw.h"
+//TODO put in in the right place
+#include <netinet/tcp.h>
void
@@ -60,15 +62,22 @@
SPDYF_raw_new_session(struct SPDY_Session *session)
{
int fd_flags;
+ int val = 1;
+ int ret;
//setting the socket to be non-blocking
fd_flags = fcntl (session->socket_fd, F_GETFL);
if ( -1 == fd_flags
|| 0 != fcntl (session->socket_fd, F_SETFL, fd_flags |
O_NONBLOCK))
- {
SPDYF_DEBUG("WARNING: Couldn't set the new connection to be
non-blocking");
- }
+ if(SPDY_DAEMON_FLAG_NO_DELAY & session->daemon->flags)
+ {
+ ret = setsockopt(session->socket_fd, IPPROTO_TCP, TCP_NODELAY, &val,
(socklen_t)sizeof(val));
+ if(-1 == ret)
+ SPDYF_DEBUG("WARNING: Couldn't set the new connection to TCP_NODELAY");
+ }
+
return SPDY_YES;
}
Modified: libmicrohttpd/src/testspdy/test_notls.c
===================================================================
--- libmicrohttpd/src/testspdy/test_notls.c 2013-07-05 17:16:11 UTC (rev
27771)
+++ libmicrohttpd/src/testspdy/test_notls.c 2013-07-05 17:30:18 UTC (rev
27772)
@@ -852,6 +852,7 @@
NULL,
NULL,&session_closed_handler,&standard_request_handler,NULL,CLS,
SPDY_DAEMON_OPTION_IO_SUBSYSTEM, SPDY_IO_SUBSYSTEM_RAW,
+ SPDY_DAEMON_OPTION_FLAGS, SPDY_DAEMON_FLAG_NO_DELAY,
SPDY_DAEMON_OPTION_END);
if(NULL==daemon){
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27772 - in libmicrohttpd/src: include microspdy testspdy,
gnunet <=