Skip to content

Commit

Permalink
curl: add --false-start option
Browse files Browse the repository at this point in the history
  • Loading branch information
ghedo authored and kdudka committed Mar 20, 2015
1 parent 185914f commit 1f651d1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/curl.1
Expand Up @@ -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.
(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
Expand Down
2 changes: 2 additions & 0 deletions src/tool_cfgable.h
Expand Up @@ -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 */
Expand Down
5 changes: 5 additions & 0 deletions src/tool_getparam.c
Expand Up @@ -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},
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/tool_help.c
Expand Up @@ -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)",
Expand Down
3 changes: 3 additions & 0 deletions src/tool_operate.c
Expand Up @@ -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)) {
Expand Down

0 comments on commit 1f651d1

Please sign in to comment.