mirror of
https://github.com/moparisthebest/curl
synced 2024-11-14 05:25:06 -05:00
curl: show headers in bold
The feature is only enabled if the output is believed to be a tty. -J: There's some minor differences and improvements in -J handling, as now J should work with -i and it actually creates a file first using the initial name and then *renames* that to the one found in Content-Disposition (if any). -i: only shows headers for HTTP transfers now (as documented). Previously it would also show for pieces of the transfer that were HTTP (for example when doing FTP over a HTTP proxy). -i: now shows trailers as well. Previously they were not shown at all. --libcurl: the CURLOPT_HEADER is no longer set, as the header output is now done in the header callback.
This commit is contained in:
parent
6876ccf90b
commit
c1c27625c7
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -31,11 +31,20 @@
|
|||||||
#include "tool_doswin.h"
|
#include "tool_doswin.h"
|
||||||
#include "tool_msgs.h"
|
#include "tool_msgs.h"
|
||||||
#include "tool_cb_hdr.h"
|
#include "tool_cb_hdr.h"
|
||||||
|
#include "tool_cb_wrt.h"
|
||||||
|
|
||||||
#include "memdebug.h" /* keep this as LAST include */
|
#include "memdebug.h" /* keep this as LAST include */
|
||||||
|
|
||||||
static char *parse_filename(const char *ptr, size_t len);
|
static char *parse_filename(const char *ptr, size_t len);
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#define BOLD
|
||||||
|
#define BOLDOFF
|
||||||
|
#else
|
||||||
|
#define BOLD "\x1b[1m"
|
||||||
|
#define BOLDOFF "\x1b[21m"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** callback for CURLOPT_HEADERFUNCTION
|
** callback for CURLOPT_HEADERFUNCTION
|
||||||
*/
|
*/
|
||||||
@ -48,7 +57,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||||||
const char *str = ptr;
|
const char *str = ptr;
|
||||||
const size_t cb = size * nmemb;
|
const size_t cb = size * nmemb;
|
||||||
const char *end = (char *)ptr + cb;
|
const char *end = (char *)ptr + cb;
|
||||||
char *url = NULL;
|
long protocol = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Once that libcurl has called back tool_header_cb() the returned value
|
* Once that libcurl has called back tool_header_cb() the returned value
|
||||||
@ -88,12 +97,15 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||||||
* Content-Disposition header specifying a filename property.
|
* Content-Disposition header specifying a filename property.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
curl_easy_getinfo(outs->config->easy, CURLINFO_PROTOCOL, &protocol);
|
||||||
if(hdrcbdata->honor_cd_filename &&
|
if(hdrcbdata->honor_cd_filename &&
|
||||||
(cb > 20) && checkprefix("Content-disposition:", str) &&
|
(cb > 20) && checkprefix("Content-disposition:", str) &&
|
||||||
!curl_easy_getinfo(outs->config->easy, CURLINFO_EFFECTIVE_URL, &url) &&
|
(protocol & (CURLPROTO_HTTPS|CURLPROTO_HTTP))) {
|
||||||
url && (checkprefix("http://", url) || checkprefix("https://", url))) {
|
|
||||||
const char *p = str + 20;
|
const char *p = str + 20;
|
||||||
|
|
||||||
|
if(!outs->stream && !tool_create_output_file(outs, FALSE))
|
||||||
|
return failure;
|
||||||
|
|
||||||
/* look for the 'filename=' parameter
|
/* look for the 'filename=' parameter
|
||||||
(encoded filenames (*=) are not supported) */
|
(encoded filenames (*=) are not supported) */
|
||||||
for(;;) {
|
for(;;) {
|
||||||
@ -119,19 +131,49 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata)
|
|||||||
len = (ssize_t)cb - (p - str);
|
len = (ssize_t)cb - (p - str);
|
||||||
filename = parse_filename(p, len);
|
filename = parse_filename(p, len);
|
||||||
if(filename) {
|
if(filename) {
|
||||||
outs->filename = filename;
|
if(outs->stream) {
|
||||||
outs->alloc_filename = TRUE;
|
/* already opened and possibly written to */
|
||||||
|
if(outs->fopened)
|
||||||
|
fclose(outs->stream);
|
||||||
|
outs->stream = NULL;
|
||||||
|
|
||||||
|
/* rename the initial file name to the new file name */
|
||||||
|
rename(outs->filename, filename);
|
||||||
|
if(outs->alloc_filename)
|
||||||
|
free(outs->filename);
|
||||||
|
}
|
||||||
outs->is_cd_filename = TRUE;
|
outs->is_cd_filename = TRUE;
|
||||||
outs->s_isreg = TRUE;
|
outs->s_isreg = TRUE;
|
||||||
outs->fopened = FALSE;
|
outs->fopened = FALSE;
|
||||||
outs->stream = NULL;
|
outs->filename = filename;
|
||||||
hdrcbdata->honor_cd_filename = FALSE;
|
outs->alloc_filename = TRUE;
|
||||||
break;
|
hdrcbdata->honor_cd_filename = FALSE; /* done now! */
|
||||||
|
if(!tool_create_output_file(outs, TRUE))
|
||||||
|
return failure;
|
||||||
}
|
}
|
||||||
return failure;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(hdrcbdata->config->show_headers &&
|
||||||
|
(protocol & (CURLPROTO_HTTP|CURLPROTO_HTTPS|CURLPROTO_RTSP))) {
|
||||||
|
/* bold headers only happen for HTTP(S) and RTSP */
|
||||||
|
char *value = NULL;
|
||||||
|
|
||||||
|
if(!outs->stream && !tool_create_output_file(outs, FALSE))
|
||||||
|
return failure;
|
||||||
|
|
||||||
|
if(hdrcbdata->global->isatty)
|
||||||
|
value = memchr(ptr, ':', cb);
|
||||||
|
if(value) {
|
||||||
|
size_t namelen = value - ptr;
|
||||||
|
fprintf(outs->stream, BOLD "%.*s" BOLDOFF ":", namelen, ptr);
|
||||||
|
fwrite(&value[1], cb - namelen - 1, 1, outs->stream);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* not "handled", just show it */
|
||||||
|
fwrite(ptr, cb, 1, outs->stream);
|
||||||
|
}
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,4 +275,3 @@ static char *parse_filename(const char *ptr, size_t len)
|
|||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -39,6 +39,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct HdrCbData {
|
struct HdrCbData {
|
||||||
|
struct GlobalConfig *global;
|
||||||
|
struct OperationConfig *config;
|
||||||
struct OutStruct *outs;
|
struct OutStruct *outs;
|
||||||
struct OutStruct *heads;
|
struct OutStruct *heads;
|
||||||
bool honor_cd_filename;
|
bool honor_cd_filename;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -32,7 +32,8 @@
|
|||||||
#include "memdebug.h" /* keep this as LAST include */
|
#include "memdebug.h" /* keep this as LAST include */
|
||||||
|
|
||||||
/* create a local file for writing, return TRUE on success */
|
/* create a local file for writing, return TRUE on success */
|
||||||
bool tool_create_output_file(struct OutStruct *outs)
|
bool tool_create_output_file(struct OutStruct *outs,
|
||||||
|
bool append)
|
||||||
{
|
{
|
||||||
struct GlobalConfig *global = outs->config->global;
|
struct GlobalConfig *global = outs->config->global;
|
||||||
FILE *file;
|
FILE *file;
|
||||||
@ -42,7 +43,7 @@ bool tool_create_output_file(struct OutStruct *outs)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(outs->is_cd_filename) {
|
if(outs->is_cd_filename && !append) {
|
||||||
/* don't overwrite existing files */
|
/* don't overwrite existing files */
|
||||||
file = fopen(outs->filename, "rb");
|
file = fopen(outs->filename, "rb");
|
||||||
if(file) {
|
if(file) {
|
||||||
@ -54,7 +55,7 @@ bool tool_create_output_file(struct OutStruct *outs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* open file for writing */
|
/* open file for writing */
|
||||||
file = fopen(outs->filename, "wb");
|
file = fopen(outs->filename, append?"ab":"wb");
|
||||||
if(!file) {
|
if(!file) {
|
||||||
warnf(global, "Failed to create the file %s: %s\n", outs->filename,
|
warnf(global, "Failed to create the file %s: %s\n", outs->filename,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
@ -97,7 +98,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(config->include_headers) {
|
if(config->show_headers) {
|
||||||
if(bytes > (size_t)CURL_MAX_HTTP_HEADER) {
|
if(bytes > (size_t)CURL_MAX_HTTP_HEADER) {
|
||||||
warnf(config->global, "Header data size exceeds single call write "
|
warnf(config->global, "Header data size exceeds single call write "
|
||||||
"limit!\n");
|
"limit!\n");
|
||||||
@ -141,7 +142,7 @@ size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!outs->stream && !tool_create_output_file(outs))
|
if(!outs->stream && !tool_create_output_file(outs, FALSE))
|
||||||
return failure;
|
return failure;
|
||||||
|
|
||||||
if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
|
if(is_tty && (outs->bytes < 2000) && !config->terminal_binary_ok) {
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -30,7 +30,7 @@
|
|||||||
size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
|
size_t tool_write_cb(char *buffer, size_t sz, size_t nmemb, void *userdata);
|
||||||
|
|
||||||
/* create a local file for writing, return TRUE on success */
|
/* create a local file for writing, return TRUE on success */
|
||||||
bool tool_create_output_file(struct OutStruct *outs);
|
bool tool_create_output_file(struct OutStruct *outs, bool append);
|
||||||
|
|
||||||
#endif /* HEADER_CURL_TOOL_CB_WRT_H */
|
#endif /* HEADER_CURL_TOOL_CB_WRT_H */
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ struct OperationConfig {
|
|||||||
bool use_ascii; /* select ascii or text transfer */
|
bool use_ascii; /* select ascii or text transfer */
|
||||||
bool autoreferer; /* automatically set referer */
|
bool autoreferer; /* automatically set referer */
|
||||||
bool failonerror; /* fail on (HTTP) errors */
|
bool failonerror; /* fail on (HTTP) errors */
|
||||||
bool include_headers; /* send headers to data output */
|
bool show_headers; /* show headers to data output */
|
||||||
bool no_body; /* don't get the body */
|
bool no_body; /* don't get the body */
|
||||||
bool dirlistonly; /* only get the FTP dir list */
|
bool dirlistonly; /* only get the FTP dir list */
|
||||||
bool followlocation; /* follow http redirects */
|
bool followlocation; /* follow http redirects */
|
||||||
|
@ -1722,24 +1722,22 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
config->include_headers = toggle; /* include the headers as well in the
|
config->show_headers = toggle; /* show the headers as well in the
|
||||||
general output stream */
|
general output stream */
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
config->cookiesession = toggle;
|
config->cookiesession = toggle;
|
||||||
break;
|
break;
|
||||||
case 'I':
|
case 'I': /* --head */
|
||||||
/*
|
|
||||||
* no_body will imply include_headers later on
|
|
||||||
*/
|
|
||||||
config->no_body = toggle;
|
config->no_body = toggle;
|
||||||
|
config->show_headers = toggle;
|
||||||
if(SetHTTPrequest(config,
|
if(SetHTTPrequest(config,
|
||||||
(config->no_body)?HTTPREQ_HEAD:HTTPREQ_GET,
|
(config->no_body)?HTTPREQ_HEAD:HTTPREQ_GET,
|
||||||
&config->httpreq))
|
&config->httpreq))
|
||||||
return PARAM_BAD_USE;
|
return PARAM_BAD_USE;
|
||||||
break;
|
break;
|
||||||
case 'J': /* --remote-header-name */
|
case 'J': /* --remote-header-name */
|
||||||
if(config->include_headers) {
|
if(config->show_headers) {
|
||||||
warnf(global,
|
warnf(global,
|
||||||
"--include and --remote-header-name cannot be combined.\n");
|
"--include and --remote-header-name cannot be combined.\n");
|
||||||
return PARAM_BAD_USE;
|
return PARAM_BAD_USE;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* | (__| |_| | _ <| |___
|
* | (__| |_| | _ <| |___
|
||||||
* \___|\___/|_| \_\_____|
|
* \___|\___/|_| \_\_____|
|
||||||
*
|
*
|
||||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||||
*
|
*
|
||||||
* This software is licensed as described in the file COPYING, which
|
* This software is licensed as described in the file COPYING, which
|
||||||
* you should have received as part of this distribution. The terms
|
* you should have received as part of this distribution. The terms
|
||||||
@ -851,15 +851,8 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
my_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadfilesize);
|
my_setopt(curl, CURLOPT_INFILESIZE_LARGE, uploadfilesize);
|
||||||
my_setopt_str(curl, CURLOPT_URL, this_url); /* what to fetch */
|
my_setopt_str(curl, CURLOPT_URL, this_url); /* what to fetch */
|
||||||
my_setopt(curl, CURLOPT_NOPROGRESS, global->noprogress?1L:0L);
|
my_setopt(curl, CURLOPT_NOPROGRESS, global->noprogress?1L:0L);
|
||||||
if(config->no_body) {
|
if(config->no_body)
|
||||||
my_setopt(curl, CURLOPT_NOBODY, 1L);
|
my_setopt(curl, CURLOPT_NOBODY, 1L);
|
||||||
my_setopt(curl, CURLOPT_HEADER, 1L);
|
|
||||||
}
|
|
||||||
/* If --metalink is used, we ignore --include (headers in
|
|
||||||
output) option because mixing headers to the body will
|
|
||||||
confuse XML parser and/or hash check will fail. */
|
|
||||||
else if(!config->use_metalink)
|
|
||||||
my_setopt(curl, CURLOPT_HEADER, config->include_headers?1L:0L);
|
|
||||||
|
|
||||||
if(config->oauth_bearer)
|
if(config->oauth_bearer)
|
||||||
my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer);
|
my_setopt_str(curl, CURLOPT_XOAUTH2_BEARER, config->oauth_bearer);
|
||||||
@ -1373,6 +1366,8 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
|
|
||||||
hdrcbdata.outs = &outs;
|
hdrcbdata.outs = &outs;
|
||||||
hdrcbdata.heads = &heads;
|
hdrcbdata.heads = &heads;
|
||||||
|
hdrcbdata.global = global;
|
||||||
|
hdrcbdata.config = config;
|
||||||
|
|
||||||
my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb);
|
my_setopt(curl, CURLOPT_HEADERFUNCTION, tool_header_cb);
|
||||||
my_setopt(curl, CURLOPT_HEADERDATA, &hdrcbdata);
|
my_setopt(curl, CURLOPT_HEADERDATA, &hdrcbdata);
|
||||||
@ -1523,7 +1518,7 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
/* do not create (or even overwrite) the file in case we get no
|
/* do not create (or even overwrite) the file in case we get no
|
||||||
data because of unmet condition */
|
data because of unmet condition */
|
||||||
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet);
|
curl_easy_getinfo(curl, CURLINFO_CONDITION_UNMET, &cond_unmet);
|
||||||
if(!cond_unmet && !tool_create_output_file(&outs))
|
if(!cond_unmet && !tool_create_output_file(&outs, FALSE))
|
||||||
result = CURLE_WRITE_ERROR;
|
result = CURLE_WRITE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ Transfer-Encoding: chunked
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
|
chunky-trailer: header data
|
||||||
|
another-header: yes
|
||||||
</datacheck>
|
</datacheck>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
|
@ -31,9 +31,6 @@ body
|
|||||||
</data>
|
</data>
|
||||||
|
|
||||||
<datacheck>
|
<datacheck>
|
||||||
HTTP/1.1 200 Mighty fine indeed
|
|
||||||
pop3: sure hit me
|
|
||||||
|
|
||||||
From: me@somewhere
|
From: me@somewhere
|
||||||
To: fake@nowhere
|
To: fake@nowhere
|
||||||
|
|
||||||
|
@ -27,9 +27,6 @@ body
|
|||||||
yours sincerely
|
yours sincerely
|
||||||
</data>
|
</data>
|
||||||
<datacheck>
|
<datacheck>
|
||||||
HTTP/1.1 200 Mighty fine indeed
|
|
||||||
imap: sure hit me
|
|
||||||
|
|
||||||
From: me@somewhere
|
From: me@somewhere
|
||||||
To: fake@nowhere
|
To: fake@nowhere
|
||||||
|
|
||||||
|
@ -70,7 +70,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1400");
|
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1400");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
||||||
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||||
|
@ -82,7 +82,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1401");
|
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1401");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
|
curl_easy_setopt(hnd, CURLOPT_USERPWD, "fake:user");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
|
curl_easy_setopt(hnd, CURLOPT_HTTPAUTH, (long)CURLAUTH_BASIC);
|
||||||
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
|
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, slist1);
|
||||||
|
@ -75,7 +75,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1402");
|
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1402");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
|
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "foo=bar&baz=quux");
|
||||||
curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
|
curl_easy_setopt(hnd, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t)16);
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
||||||
|
@ -72,7 +72,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1403?foo=bar&baz=quux");
|
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1403?foo=bar&baz=quux");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
curl_easy_setopt(hnd, CURLOPT_USERAGENT, "stripped");
|
||||||
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||||
|
@ -121,7 +121,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1404");
|
curl_easy_setopt(hnd, CURLOPT_URL, "http://%HOSTIP:%HTTPPORT/we/want/1404");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
mime1 = curl_mime_init(hnd);
|
mime1 = curl_mime_init(hnd);
|
||||||
part1 = curl_mime_addpart(mime1);
|
part1 = curl_mime_addpart(mime1);
|
||||||
curl_mime_data(part1, "value", CURL_ZERO_TERMINATED);
|
curl_mime_data(part1, "value", CURL_ZERO_TERMINATED);
|
||||||
|
@ -85,7 +85,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/1405");
|
curl_easy_setopt(hnd, CURLOPT_URL, "ftp://%HOSTIP:%FTPPORT/1405");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1);
|
curl_easy_setopt(hnd, CURLOPT_QUOTE, slist1);
|
||||||
curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2);
|
curl_easy_setopt(hnd, CURLOPT_POSTQUOTE, slist2);
|
||||||
curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3);
|
curl_easy_setopt(hnd, CURLOPT_PREQUOTE, slist3);
|
||||||
|
@ -78,7 +78,6 @@ int main(int argc, char *argv[])
|
|||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
|
curl_easy_setopt(hnd, CURLOPT_INFILESIZE_LARGE, (curl_off_t)38);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/1406");
|
curl_easy_setopt(hnd, CURLOPT_URL, "smtp://%HOSTIP:%SMTPPORT/1406");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
|
curl_easy_setopt(hnd, CURLOPT_UPLOAD, 1L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||||
|
@ -59,7 +59,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/1407");
|
curl_easy_setopt(hnd, CURLOPT_URL, "pop3://%HOSTIP:%POP3PORT/1407");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
|
curl_easy_setopt(hnd, CURLOPT_DIRLISTONLY, 1L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
|
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
|
||||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||||
|
@ -35,6 +35,7 @@ Trailer: chunky-trailer
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
|
chunky-trailer: header data
|
||||||
</datacheck>
|
</datacheck>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
|
@ -65,7 +65,6 @@ int main(int argc, char *argv[])
|
|||||||
hnd = curl_easy_init();
|
hnd = curl_easy_init();
|
||||||
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;UID=1");
|
curl_easy_setopt(hnd, CURLOPT_URL, "imap://%HOSTIP:%IMAPPORT/1420/;UID=1");
|
||||||
curl_easy_setopt(hnd, CURLOPT_HEADER, 1L);
|
|
||||||
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
|
curl_easy_setopt(hnd, CURLOPT_USERPWD, "user:secret");
|
||||||
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
|
||||||
|
@ -35,10 +35,10 @@ Metalink
|
|||||||
http
|
http
|
||||||
</server>
|
</server>
|
||||||
<name>
|
<name>
|
||||||
Metalink local XML file, HTTP resource, using -o fname -i -D file
|
Metalink local XML file, HTTP resource, using -o fname -D file
|
||||||
</name>
|
</name>
|
||||||
<command option="no-output,no-include">
|
<command option="no-output,no-include">
|
||||||
--metalink file://%PWD/log/test2010.metalink -i -o log/outfile2010 -D log/heads2010
|
--metalink file://%PWD/log/test2010.metalink -o log/outfile2010 -D log/heads2010
|
||||||
</command>
|
</command>
|
||||||
# local metalink file written before test command runs
|
# local metalink file written before test command runs
|
||||||
<file name="log/test2010.metalink">
|
<file name="log/test2010.metalink">
|
||||||
|
@ -35,6 +35,7 @@ Trailer: chunky-trailer
|
|||||||
Connection: mooo
|
Connection: mooo
|
||||||
|
|
||||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccc
|
||||||
|
chunky-trailer: header data
|
||||||
</datacheck>
|
</datacheck>
|
||||||
</reply>
|
</reply>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user