1438fb82056f2d3626472057bef4502438b3f985 galt Thu Jun 24 04:06:38 2010 -0700 initial paraFetch work - the fast multiple connection parallel downloader diff --git src/lib/tests/paraFetch.c src/lib/tests/paraFetch.c new file mode 100644 index 0000000..de518df --- /dev/null +++ src/lib/tests/paraFetch.c @@ -0,0 +1,40 @@ +/* paraFetch - fetch URL with multiple parallel connections. */ +#include "common.h" +#include "options.h" +#include "dystring.h" +#include "obscure.h" +#include "net.h" + +void usage() +/* Explain usage and exit */ +{ +errAbort( + "paraFetch - try to fetch url with multiple connections\n" + "usage:\n" + " paraFetch N URL outPath\n" + " where N is the number of connections to use\n" + ); +} + +static struct optionSpec options[] = { + {NULL, 0}, +}; + +void paraFetch(int numConnections, char *url, char *outPath) +/* Fetch given URL, send to stdout. */ +{ +parallelFetch(url, numConnections, outPath); +} + + + +int main(int argc, char *argv[]) +/* Process command line. */ +{ +optionInit(&argc, argv, options); +if (argc != 4) + usage(); +paraFetch(atoi(argv[1]), argv[2], argv[3]); +return 0; +} +