summaryrefslogtreecommitdiffstats
path: root/fbench/src/geturl/geturl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fbench/src/geturl/geturl.cpp')
-rw-r--r--fbench/src/geturl/geturl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/fbench/src/geturl/geturl.cpp b/fbench/src/geturl/geturl.cpp
new file mode 100644
index 00000000000..667db264156
--- /dev/null
+++ b/fbench/src/geturl/geturl.cpp
@@ -0,0 +1,20 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <util/httpclient.h>
+#include <iostream>
+
+int
+main(int argc, char** argv)
+{
+ if (argc != 4) {
+ printf("usage: geturl <host> <port> <url>\n");
+ return -1;
+ }
+
+ HTTPClient client(argv[1], atoi(argv[2]), false, false);
+ if (!client.Fetch(argv[3], &std::cout).Ok()) {
+ fprintf(stderr, "geturl: could not fetch 'http://%s:%d%s'\n",
+ argv[1], atoi(argv[2]), argv[3]);
+ return -1;
+ }
+ return 0;
+}