* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
{"$v", "ssl-reqd", FALSE},
/* 'ssl-reqd' new in 7.20.0, previously this was ftp-ssl-reqd */
{"$w", "sessionid", FALSE},
- /* ยกsessionid' listed as --no-sessionid in the help */
+ /* 'sessionid' listed as --no-sessionid in the help */
{"$x", "ftp-ssl-control", FALSE},
{"$y", "ftp-ssl-ccc", FALSE},
{"$j", "ftp-ssl-ccc-mode", TRUE},
{"$3", "keepalive-time", TRUE},
{"$4", "post302", FALSE},
{"$5", "noproxy", TRUE},
-#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
{"$6", "socks5-gssapi-service", TRUE},
{"$7", "socks5-gssapi-nec", FALSE},
-#endif
+ {"$O", "proxy-service-name", TRUE},
+ {"$P", "service-name", TRUE},
{"$8", "proxy1.0", TRUE},
{"$9", "tftp-blksize", TRUE},
{"$A", "mail-from", TRUE},
{"$K", "sasl-ir", FALSE},
{"$L", "test-event", FALSE},
{"$M", "unix-socket", TRUE},
+ {"$N", "path-as-is", FALSE},
{"0", "http1.0", FALSE},
{"01", "http1.1", FALSE},
{"02", "http2", FALSE},
{"c", "cookie-jar", TRUE},
{"C", "continue-at", TRUE},
{"d", "data", TRUE},
+ {"dr", "data-raw", TRUE},
{"da", "data-ascii", TRUE},
{"db", "data-binary", TRUE},
{"de", "data-urlencode", TRUE},
{"En", "ssl-allow-beast", FALSE},
{"Eo", "login-options", TRUE},
{"Ep", "pinnedpubkey", TRUE},
+ {"Eq", "cert-status", FALSE},
+ {"Er", "false-start", FALSE},
+ {"Es", "ssl-no-revoke", FALSE},
{"f", "fail", FALSE},
{"F", "form", TRUE},
{"Fs", "form-string", TRUE},
case 'g': /* --trace */
GetStr(&global->trace_dump, nextarg);
if(global->tracetype && (global->tracetype != TRACE_BIN))
- warnf(config, "--trace overrides an earlier trace/verbose option\n");
+ warnf(global, "--trace overrides an earlier trace/verbose option\n");
global->tracetype = TRACE_BIN;
break;
case 'G': /* --npn */
case 'h': /* --trace-ascii */
GetStr(&global->trace_dump, nextarg);
if(global->tracetype && (global->tracetype != TRACE_ASCII))
- warnf(config,
+ warnf(global,
"--trace-ascii overrides an earlier trace/verbose option\n");
global->tracetype = TRACE_ASCII;
break;
/* for plain bytes, leave as-is */
break;
default:
- warnf(config, "unsupported rate unit. Use G, M, K or B!\n");
+ warnf(global, "unsupported rate unit. Use G, M, K or B!\n");
return PARAM_BAD_USE;
}
config->recvpersecond = value;
case 'v': /* --stderr */
if(strcmp(nextarg, "-")) {
- FILE *newfile = fopen(nextarg, "wt");
+ FILE *newfile = fopen(nextarg, FOPEN_WRITETEXT);
if(!newfile)
- warnf(config, "Failed to open %s!\n", nextarg);
+ warnf(global, "Failed to open %s!\n", nextarg);
else {
if(global->errors_fopened)
fclose(global->errors);
else {
config->localportrange -= config->localport;
if(config->localportrange < 1) {
- warnf(config, "bad range input\n");
+ warnf(global, "bad range input\n");
return PARAM_BAD_USE;
}
}
break;
case 'z': /* --libcurl */
#ifdef CURL_DISABLE_LIBCURL_OPTION
- warnf(config,
+ warnf(global,
"--libcurl option was disabled at build-time!\n");
return PARAM_OPTION_UNKNOWN;
#else
/* This specifies the noproxy list */
GetStr(&config->noproxy, nextarg);
break;
-#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
case '6': /* --socks5-gssapi-service */
GetStr(&config->socks5_gssapi_service, nextarg);
break;
case '7': /* --socks5-gssapi-nec*/
config->socks5_gssapi_nec = toggle;
break;
-#endif
+ case 'O': /* --proxy-service-name */
+ GetStr(&config->proxy_service_name, nextarg);
+ break;
+ case 'P': /* --service-name */
+ GetStr(&config->service_name, nextarg);
+ break;
case '8': /* --proxy1.0 */
/* http 1.0 proxy */
GetStr(&config->proxy, nextarg);
int mlmaj, mlmin, mlpatch;
metalink_get_version(&mlmaj, &mlmin, &mlpatch);
if((mlmaj*10000)+(mlmin*100)+mlpatch < CURL_REQ_LIBMETALINK_VERS) {
- warnf(config,
+ warnf(global,
"--metalink option cannot be used because the version of "
"the linked libmetalink library is too old. "
"Required: %d.%d.%d, found %d.%d.%d\n",
else
config->use_metalink = toggle;
#else
- warnf(config, "--metalink option is ignored because the binary is "
+ warnf(global, "--metalink option is ignored because the binary is "
"built without the Metalink support.\n");
#endif
break;
#ifdef CURLDEBUG
config->test_event_based = toggle;
#else
- warnf(config, "--test-event is ignored unless a debug build!\n");
+ warnf(global, "--test-event is ignored unless a debug build!\n");
#endif
break;
case 'M': /* --unix-socket */
GetStr(&config->unix_socket_path, nextarg);
break;
+ case 'N': /* --path-as-is */
+ config->path_as_is = toggle;
+ break;
}
break;
case '#': /* --progress-bar */
char *postdata = NULL;
FILE *file;
size_t size = 0;
+ bool raw_mode = (subletter == 'r');
if(subletter == 'e') { /* --data-urlencode*/
/* [name]=[content], we encode the content part only
}
if('@' == is_file) {
/* a '@' letter, it means that a file name or - (stdin) follows */
-
if(curlx_strequal("-", p)) {
file = stdin;
set_binmode(stdin);
else {
file = fopen(p, "rb");
if(!file)
- warnf(config,
+ warnf(global,
"Couldn't read data from file \"%s\", this makes "
"an empty POST.\n", nextarg);
}
return PARAM_NO_MEM;
}
}
- else if('@' == *nextarg) {
+ else if('@' == *nextarg && !raw_mode) {
/* the data begins with a '@' letter, it means that a file name
or - (stdin) follows */
nextarg++; /* pass the @ */
else {
file = fopen(nextarg, "rb");
if(!file)
- warnf(config, "Couldn't read data from file \"%s\", this makes "
+ warnf(global, "Couldn't read data from file \"%s\", this makes "
"an empty POST.\n", nextarg);
}
break;
case 'f': /* crypto engine */
GetStr(&config->engine, nextarg);
- if(config->engine && curlx_raw_equal(config->engine,"list"))
+ if(config->engine && curlx_raw_equal(config->engine, "list"))
return PARAM_ENGINES_REQUESTED;
break;
case 'g': /* CA info PEM file */
GetStr(&config->pinnedpubkey, nextarg);
break;
+ case 'q': /* --cert-status */
+ config->verifystatus = TRUE;
+ break;
+
+ case 'r': /* --false-start */
+ config->falsestart = TRUE;
+ break;
+
+ case 's': /* --ssl-no-revoke */
+ if(curlinfo->features & CURL_VERSION_SSL)
+ config->ssl_no_revoke = TRUE;
+ break;
+
default: /* certificate file */
{
char *certname, *passphrase;
break;
case 'J': /* --remote-header-name */
if(config->include_headers) {
- warnf(config,
+ warnf(global,
"--include and --remote-header-name cannot be combined.\n");
return PARAM_BAD_USE;
}
break;
case 'K': /* parse config file */
if(parseconfig(nextarg, global))
- warnf(config, "error trying read config from the '%s' file\n",
+ warnf(global, "error trying read config from the '%s' file\n",
nextarg);
break;
case 'l':
#ifdef USE_MANUAL
return PARAM_MANUAL_REQUESTED;
#else
- warnf(config,
+ warnf(global,
"built-in manual was disabled at build-time!\n");
return PARAM_OPTION_UNKNOWN;
#endif
if(ISDIGIT(*nextarg) && !strchr(nextarg, '-')) {
char buffer[32];
curl_off_t off;
- warnf(config,
+ warnf(global,
"A specified range MUST include at least one dash (-). "
"Appending one for you!\n");
off = curlx_strtoofft(nextarg, NULL, 10);
tmp_range = nextarg;
while(*tmp_range != '\0') {
if(!ISDIGIT(*tmp_range) && *tmp_range != '-' && *tmp_range != ',') {
- warnf(config,"Invalid character is found in given range. "
+ warnf(global, "Invalid character is found in given range. "
"A specified range MUST have only digits in "
"\'start\'-\'stop\'. The server's response to this "
"request is uncertain.\n");
if(!global->trace_dump)
return PARAM_NO_MEM;
if(global->tracetype && (global->tracetype != TRACE_PLAIN))
- warnf(config,
+ warnf(global,
"-v, --verbose overrides an earlier trace/verbose option\n");
global->tracetype = TRACE_PLAIN;
}
}
else {
fname = nextarg;
- file = fopen(nextarg, "r");
+ file = fopen(nextarg, FOPEN_READTEXT);
}
err = file2string(&config->writeout, file);
if(file && (file != stdin))
if(err)
return err;
if(!config->writeout)
- warnf(config, "Failed to read %s", fname);
+ warnf(global, "Failed to read %s", fname);
}
else
GetStr(&config->writeout, nextarg);
if(-1 == stat(nextarg, &statbuf)) {
/* failed, remove time condition */
config->timecond = CURL_TIMECOND_NONE;
- warnf(config,
+ warnf(global,
"Illegal date format for -z, --timecond (and not "
"a file name). Disabling time condition. "
"See curl_getdate(3) for valid date syntax.\n");