char *outfiles;
char *httpgetfields;
char *uploadfile;
- unsigned long infilenum; /* number of files to upload */
- unsigned long up; /* upload file counter within a single upload glob */
- unsigned long urlnum; /* how many iterations this single URL has with ranges
+ curl_off_t infilenum; /* number of files to upload */
+ curl_off_t up; /* upload file counter within a single upload glob */
+ curl_off_t urlnum; /* how many iterations this single URL has with ranges
etc */
- unsigned long li;
+ curl_off_t li;
};
struct OperationConfig {
bool test_event_based;
#endif
bool parallel;
- long parallel_max;
+ unsigned short parallel_max; /* MAX_PARALLEL is the maximum */
bool parallel_connect;
char *help_category; /* The help category, if set */
struct OperationConfig *first;
case '\0': /* --parallel */
global->parallel = toggle;
break;
- case 'b': /* --parallel-max */
- err = str2unum(&global->parallel_max, nextarg);
+ case 'b': { /* --parallel-max */
+ long val;
+ err = str2unum(&val, nextarg);
if(err)
return err;
- if(global->parallel_max > MAX_PARALLEL)
+ if(val > MAX_PARALLEL)
global->parallel_max = MAX_PARALLEL;
- else if(global->parallel_max < 1)
+ else if(val < 1)
global->parallel_max = PARALLEL_DEFAULT;
+ else
+ global->parallel_max = (unsigned short)val;
break;
+ }
case 'c': /* --parallel-connect */
global->parallel_connect = toggle;
break;
*
* Multiplies and checks for overflow.
*/
-static int multiply(unsigned long *amount, long with)
+static int multiply(curl_off_t *amount, curl_off_t with)
{
- unsigned long sum = *amount * with;
+ curl_off_t sum = *amount * with;
if(!with) {
*amount = 0;
return 0;
}
static CURLcode glob_set(struct URLGlob *glob, char **patternp,
- size_t *posp, unsigned long *amount,
+ size_t *posp, curl_off_t *amount,
int globindex)
{
/* processes a set expression with the point behind the opening '{'
*buf = '\0';
if(pat->content.Set.elements) {
char **new_arr = realloc(pat->content.Set.elements,
- (pat->content.Set.size + 1) * sizeof(char *));
+ (size_t)(pat->content.Set.size + 1) *
+ sizeof(char *));
if(!new_arr)
return GLOBERROR("out of memory", 0, CURLE_OUT_OF_MEMORY);
}
static CURLcode glob_range(struct URLGlob *glob, char **patternp,
- size_t *posp, unsigned long *amount,
+ size_t *posp, curl_off_t *amount,
int globindex)
{
/* processes a range expression with the point behind the opening '['
}
static CURLcode glob_parse(struct URLGlob *glob, char *pattern,
- size_t pos, unsigned long *amount)
+ size_t pos, curl_off_t *amount)
{
/* processes a literal string component of a URL
special characters '{' and '[' branch to set/range processing functions
return res;
}
-CURLcode glob_url(struct URLGlob **glob, char *url, unsigned long *urlnum,
+CURLcode glob_url(struct URLGlob **glob, char *url, curl_off_t *urlnum,
FILE *error)
{
/*
* as the specified URL!
*/
struct URLGlob *glob_expand;
- unsigned long amount = 0;
+ curl_off_t amount = 0;
char *glob_buffer;
CURLcode res;
void glob_cleanup(struct URLGlob *glob)
{
size_t i;
- int elem;
+ curl_off_t elem;
if(!glob)
return;
union {
struct {
char **elements;
- int size;
+ curl_off_t size;
int ptr_s;
} Set;
struct {
int step;
} CharRange;
struct {
- unsigned long min_n;
- unsigned long max_n;
+ curl_off_t min_n;
+ curl_off_t max_n;
int padlength;
- unsigned long ptr_n;
- unsigned long step;
+ curl_off_t ptr_n;
+ curl_off_t step;
} NumRange;
} content;
};
size_t pos; /* column position of error or 0 */
};
-CURLcode glob_url(struct URLGlob**, char *, unsigned long *, FILE *);
+CURLcode glob_url(struct URLGlob**, char *, curl_off_t *, FILE *);
CURLcode glob_next_url(char **, struct URLGlob *);
CURLcode glob_match_url(char **, char *, struct URLGlob *);
void glob_cleanup(struct URLGlob *glob);