gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r27777 - libmicrohttpd/src/spdy2http


From: gnunet
Subject: [GNUnet-SVN] r27777 - libmicrohttpd/src/spdy2http
Date: Sun, 7 Jul 2013 13:07:05 +0200

Author: andreyu
Date: 2013-07-07 13:07:05 +0200 (Sun, 07 Jul 2013)
New Revision: 27777

Modified:
   libmicrohttpd/src/spdy2http/proxy.c
Log:
spdy: new start options for the proxy

Modified: libmicrohttpd/src/spdy2http/proxy.c
===================================================================
--- libmicrohttpd/src/spdy2http/proxy.c 2013-07-07 00:20:58 UTC (rev 27776)
+++ libmicrohttpd/src/spdy2http/proxy.c 2013-07-07 11:07:05 UTC (rev 27777)
@@ -54,6 +54,8 @@
   bool curl_verbose;
   bool transparent;
   bool http10;
+  bool notls;
+  bool nodelay;
 } glob_opt;
 
 
@@ -656,6 +658,8 @@
   struct addrinfo hints;
   char service[NI_MAXSERV];
   struct addrinfo *gai;
+  enum SPDY_IO_SUBSYSTEM io = glob_opt.notls ? SPDY_IO_SUBSYSTEM_RAW : 
SPDY_IO_SUBSYSTEM_OPENSSL;
+  enum SPDY_DAEMON_FLAG flags = SPDY_DAEMON_FLAG_NO;
   
        signal(SIGPIPE, SIG_IGN);
        
@@ -668,6 +672,9 @@
     
        SPDY_init();
   
+  if(glob_opt.nodelay)
+    flags |= SPDY_DAEMON_FLAG_NO_DELAY;
+  
   if(NULL == glob_opt.listen_host)
        {
     daemon = SPDY_start_daemon(glob_opt.listen_port,
@@ -680,6 +687,10 @@
                                                                NULL,
                                                                
SPDY_DAEMON_OPTION_SESSION_TIMEOUT,
                                                                1800,
+                SPDY_DAEMON_OPTION_IO_SUBSYSTEM,
+                io,
+                SPDY_DAEMON_OPTION_FLAGS,
+                flags,
                                                                
SPDY_DAEMON_OPTION_END);
   }
   else
@@ -705,6 +716,10 @@
                                                                NULL,
                                                                
SPDY_DAEMON_OPTION_SESSION_TIMEOUT,
                                                                1800,
+                SPDY_DAEMON_OPTION_IO_SUBSYSTEM,
+                io,
+                SPDY_DAEMON_OPTION_FLAGS,
+                flags,
                 SPDY_DAEMON_OPTION_SOCK_ADDR,
                 addr,
                                                                
SPDY_DAEMON_OPTION_END);
@@ -846,19 +861,24 @@
 display_usage()
 {
   printf(
-    "Usage: microspdy2http -p <PORT> -c <CERTIFICATE> -k <CERT-KEY>\n"
-    "                      [-vh0t] [-b <HTTP-SERVER>] [-l <HOST>]\n\n"
+    "Usage: microspdy2http -p <PORT> [-c <CERTIFICATE>] [-k <CERT-KEY>]\n"
+    "                      [-rvh0Dt] [-b <HTTP-SERVER>] [-l <HOST>]\n\n"
     "OPTIONS:\n"
     "    -p, --port            Listening port.\n"
     "    -l, --host            Listening host. If not set, will listen on 
[::]\n"
-    "    -c, --certificate     Path to a certificate file.\n"
+    "    -c, --certificate     Path to a certificate file. Requiered if\n"
+    "                          --no-tls is not set.\n"
     "    -k, --certificate-key Path to a key file for the certificate.\n"
+    "                          Requiered if --no-tls is not set.\n"
     "    -b, --backend-server  If set, the proxy will connect always to it.\n"
     "                          Otherwise the proxy will connect to the URL\n"
     "                          which is specified in the path or 'Host:'.\n"
     "    -v, --verbose         Print debug information.\n"
+    "    -r, --no-tls          Do not use TLS. Client must use SPDY/3.\n"
     "    -h, --curl-verbose    Print debug information for curl.\n"
     "    -0, --http10          Prefer HTTP/1.0 connections to the next hop.\n"
+    "    -D, --no-delay        This makes sense only if --no-tls is used.\n"
+    "                          TCP_NODELAY will be used for all sessions' 
sockets.\n"
     "    -t, --transparent     If set, the proxy will fetch an URL which\n"
     "                          is based on 'Host:' header and requested 
path.\n"
     "                          Otherwise, full URL in the requested path is 
required.\n\n"
@@ -878,16 +898,18 @@
     {"certificate",  required_argument, 0, 'c'},
     {"certificate-key",  required_argument, 0, 'k'},
     {"backend-server",  required_argument, 0, 'b'},
+    {"no-tls",  no_argument, 0, 'r'},
     {"verbose",  no_argument, 0, 'v'},
     {"curl-verbose",  no_argument, 0, 'h'},
     {"http10",  no_argument, 0, '0'},
+    {"no-delay",  no_argument, 0, 'D'},
     {"transparent",  no_argument, 0, 't'},
     {0, 0, 0, 0}
   };
   
   while (1)
   {
-    getopt_ret = getopt_long( argc, argv, "p:l:c:k:b:v0t", long_options, 
&option_index);
+    getopt_ret = getopt_long( argc, argv, "p:l:c:k:b:rv0Dt", long_options, 
&option_index);
     if (getopt_ret == -1)
       break;
 
@@ -905,14 +927,10 @@
         
       case 'c':
         glob_opt.cert = strdup(optarg);
-        if(NULL == glob_opt.cert)
-          return 1;
         break;
         
       case 'k':
         glob_opt.cert_key = strdup(optarg);
-        if(NULL == glob_opt.cert_key)
-          return 1;
         break;
         
       case 'b':
@@ -921,6 +939,10 @@
           return 1;
         break;
         
+      case 'r':
+        glob_opt.notls = true;
+        break;
+        
       case 'v':
         glob_opt.verbose = true;
         break;
@@ -933,6 +955,10 @@
         glob_opt.http10 = true;
         break;
         
+      case 'D':
+        glob_opt.nodelay = true;
+        break;
+        
       case 't':
         glob_opt.transparent = true;
         break;
@@ -952,8 +978,7 @@
   
   if(
     0 == glob_opt.listen_port
-    || NULL == glob_opt.cert
-    || NULL == glob_opt.cert_key
+    || (!glob_opt.notls && (NULL == glob_opt.cert || NULL == 
glob_opt.cert_key))
     //|| !glob_opt.transparent && NULL != glob_opt.http_backend
     )
   {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]