version 1.88, 2014/07/11 03:31:52 |
version 1.89, 2014/07/11 18:19:45 |
|
|
trace = 1; |
trace = 1; |
break; |
break; |
|
|
case 'U': |
|
#ifndef SMALL |
#ifndef SMALL |
if (httpuseragent) |
case 'U': |
errx(1, "User-Agent was already defined"); |
free (httpuseragent); |
/* Ensure that User-Agent value is in a single line. */ |
|
if (strcspn(optarg, "\r\n") != strlen(optarg)) |
if (strcspn(optarg, "\r\n") != strlen(optarg)) |
errx(1, "Invalid User-Agent: %s.", optarg); |
errx(1, "Invalid User-Agent: %s.", optarg); |
if (asprintf(&httpuseragent, "User-Agent: %s", |
if (asprintf(&httpuseragent, "User-Agent: %s", |
optarg) == -1) |
optarg) == -1) |
errx(1, "Can't allocate memory for HTTP(S) " |
errx(1, "Can't allocate memory for HTTP(S) " |
"User-Agent"); |
"User-Agent"); |
#endif /* !SMALL */ |
|
break; |
break; |
|
#endif /* !SMALL */ |
|
|
case 'v': |
case 'v': |
verbose = 1; |
verbose = 1; |
|
|
#ifndef SMALL |
#ifndef SMALL |
cookie_load(); |
cookie_load(); |
#endif /* !SMALL */ |
#endif /* !SMALL */ |
|
if (httpuseragent == NULL) |
|
httpuseragent = HTTP_USER_AGENT; |
|
|
cpend = 0; /* no pending replies */ |
cpend = 0; /* no pending replies */ |
proxy = 0; /* proxy not active */ |
proxy = 0; /* proxy not active */ |