added --get-bpph-size to specify the size of the requests to get the list of binary...
[ppastats.git] / src / lp_ws.c
index f57aa3b..3086e6f 100644 (file)
@@ -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);