X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Flp_ws.c;h=21b93105183314e16960bc8df0e81090fe8793f8;hb=b59ec44bffce28192c6408fed838c4d593a17c82;hp=f57aa3b5ec9842a85f412009e1c36128dd2e5b1b;hpb=abe6822b309d92edd1cc6bcf488eb584fc30c7bb;p=ppastats.git diff --git a/src/lp_ws.c b/src/lp_ws.c index f57aa3b..21b9310 100644 --- a/src/lp_ws.c +++ b/src/lp_ws.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 jeanfi@gmail.com + * Copyright (C) 2011-2014 jeanfi@gmail.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -112,7 +112,7 @@ static char *get_last_creation_date(struct bpph **list) return NULL; } -/** +/* * 'archive_url': LP URL of the archive. * 'size': size of the reply array. Between 1-300, else default value is used. */ @@ -123,7 +123,7 @@ static char *create_query_get_bpph(const char *archive_url, static const char *default_opt = "?ws.op=getPublishedBinaries&ws.size="; static const char *status_opt = "&status="; char *url; - int n; + size_t n; if (size < 1 || size > 300) size = DEFAULT_WS_SIZE; @@ -144,7 +144,9 @@ static char *create_query_get_bpph(const char *archive_url, return url; } -struct bpph **get_bpph_list(const char *archive_url, const char *pkg_status) +struct bpph **get_bpph_list(const char *archive_url, + const char *pkg_status, + int ws_size) { char *url, *key, *tmp; struct bpph **result; @@ -152,7 +154,7 @@ struct bpph **get_bpph_list(const char *archive_url, const char *pkg_status) char *date; int ok; - url = create_query_get_bpph(archive_url, pkg_status, -1); + url = create_query_get_bpph(archive_url, pkg_status, ws_size); key = get_bpph_list_cache_key(archive_url);