]> granicus.if.org Git - curl/commitdiff
curl: add --false-start option
authorAlessandro Ghedini <alessandro@ghedini.me>
Sat, 14 Feb 2015 17:17:04 +0000 (18:17 +0100)
committerKamil Dudka <kdudka@redhat.com>
Fri, 20 Mar 2015 19:14:35 +0000 (20:14 +0100)
docs/curl.1
src/tool_cfgable.h
src/tool_getparam.c
src/tool_help.c
src/tool_operate.c

index ff1ff5748eece1566870120ad12c924f0fc8dbae..2846b693817f038cd3741c582cc54c6adc4563fe 100644 (file)
@@ -562,6 +562,15 @@ or no response at all is received, the verification fails.
 
 This is currently only implemented in the OpenSSL, GnuTLS and NSS backends.\r
 (Added in 7.41.0)
+.IP "--false-start"
+
+(SSL) Tells curl to use false start during the TLS handshake. False start is a
+mode where a TLS client will start sending application data before verifying
+the server's Finished message, thus saving a round trip when performing a full
+handshake.
+
+This is currently only implemented in the NSS backend.
+(Added in 7.42.0)
 .IP "-f, --fail"
 (HTTP) Fail silently (no output at all) on server errors. This is mostly done
 to better enable scripts etc to better deal with failed attempts. In normal
index 4008cd0c24effa193a5ccec441c791d52ab59ca8..e851130f413efd3b7366f371a14d8eb27fffec1f 100644 (file)
@@ -207,6 +207,8 @@ struct OperationConfig {
   bool noalpn;                    /* enable/disable TLS ALPN extension */
   char *unix_socket_path;         /* path to Unix domain socket */
 
+  bool falsestart;
+
   struct GlobalConfig *global;
   struct OperationConfig *prev;
   struct OperationConfig *next;   /* Always last in the struct */
index 30ad5873e02b40f0ffe593005dd55aba817dc95d..56aa03050515eb754d64217b96d109d23f33132f 100644 (file)
@@ -218,6 +218,7 @@ static const struct LongShort aliases[]= {
   {"Eo", "login-options",            TRUE},
   {"Ep", "pinnedpubkey",             TRUE},
   {"Eq", "cert-status",              FALSE},
+  {"Er", "false-start",              FALSE},
   {"f",  "fail",                     FALSE},
   {"F",  "form",                     TRUE},
   {"Fs", "form-string",              TRUE},
@@ -1368,6 +1369,10 @@ ParameterError getparameter(char *flag,    /* f or -long-flag */
         config->verifystatus = TRUE;
         break;
 
+      case 'r': /* --false-start */
+        config->falsestart = TRUE;
+        break;
+
       default: /* certificate file */
       {
         char *certname, *passphrase;
index 4616211f9dd8390c05689fd799dd669e3095e22b..69778b91a7dd3a45dc28731cdffa58b9805048ec 100644 (file)
@@ -83,6 +83,7 @@ static const char *const helptext[] = {
   "     --environment   Write results to environment variables (RISC OS)",
 #endif
   " -f, --fail          Fail silently (no output at all) on HTTP errors (H)",
+  "     --false-start   Enable TLS False Start.",
   " -F, --form CONTENT  Specify HTTP multipart POST data (H)",
   "     --form-string STRING  Specify HTTP multipart POST data (H)",
   "     --ftp-account DATA  Account data string (F)",
index a875f8d4cecaa47c149b91b60f533cdb0c22b95a..e2ae22e54addfe5c87193f2d4f68b3d4459f79f2 100644 (file)
@@ -1041,6 +1041,9 @@ static CURLcode operate_do(struct GlobalConfig *global,
 
           if(config->verifystatus)
             my_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
+
+          if(config->falsestart)
+            my_setopt(curl, CURLOPT_SSL_FALSESTART, 1L);
         }
 
         if(built_in_protos & (CURLPROTO_SCP|CURLPROTO_SFTP)) {