summaryrefslogtreecommitdiff
path: root/tools/web-test.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-09-21 23:33:01 +0900
committerMarcel Holtmann <marcel@holtmann.org>2010-09-21 23:33:01 +0900
commitf0f3b59bdcc51ffbdde13629d88bebfbb66b9827 (patch)
tree352c9ec748e94b8072050964153766537123843e /tools/web-test.c
parentfe571d436acf6e03284406a4793465dcc7450fcb (diff)
downloadconnman-f0f3b59bdcc51ffbdde13629d88bebfbb66b9827.tar.gz
connman-f0f3b59bdcc51ffbdde13629d88bebfbb66b9827.tar.bz2
connman-f0f3b59bdcc51ffbdde13629d88bebfbb66b9827.zip
Add basic DNS resolving for HTTP operation
Diffstat (limited to 'tools/web-test.c')
-rw-r--r--tools/web-test.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/web-test.c b/tools/web-test.c
index 1d8301fb..1e211d5d 100644
--- a/tools/web-test.c
+++ b/tools/web-test.c
@@ -58,10 +58,13 @@ static void web_result(uint16_t status, gpointer user_data)
}
static gboolean option_debug = FALSE;
+static gchar *option_nameserver = NULL;
static GOptionEntry options[] = {
{ "debug", 'd', 0, G_OPTION_ARG_NONE, &option_debug,
"Enable debug output" },
+ { "nameserver", 'n', 0, G_OPTION_ARG_STRING, &option_nameserver,
+ "Specify nameserver", "ADDRESS" },
{ NULL },
};
@@ -103,6 +106,12 @@ int main(int argc, char *argv[])
main_loop = g_main_loop_new(NULL, FALSE);
+ if (option_nameserver != NULL) {
+ g_web_add_nameserver(web, option_nameserver);
+ g_free(option_nameserver);
+ } else
+ g_web_add_nameserver(web, "127.0.0.1");
+
timer = g_timer_new();
if (g_web_request(web, G_WEB_METHOD_GET, argv[1],