From dbfa1efdcfd7fb325366b92c674c6ad765d84ced Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Mon, 1 Feb 2010 19:44:30 +0000 Subject: [PATCH] Allow to build the web browser without DNS support - like i.e. the email client and the IRC client. --- apps/webbrowser/webclient.c | 8 +++++++- apps/webbrowser/www.c | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/webbrowser/webclient.c b/apps/webbrowser/webclient.c index 696236e93..c017ca1f6 100644 --- a/apps/webbrowser/webclient.c +++ b/apps/webbrowser/webclient.c @@ -29,7 +29,7 @@ * * This file is part of the "contiki" web browser. * - * $Id: webclient.c,v 1.7 2008/11/10 21:57:26 oliverschmidt Exp $ + * $Id: webclient.c,v 1.8 2010/02/01 19:44:30 oliverschmidt Exp $ * */ @@ -139,6 +139,7 @@ webclient_get(char *host, u16_t port, char *file) /* First check if the host is an IP address. */ ipaddr = &addr[0]; +#if UIP_UDP if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) { ipaddr = resolv_lookup(host); @@ -146,6 +147,9 @@ webclient_get(char *host, u16_t port, char *file) return 0; } } +#else /* UIP_UDP */ + uiplib_ipaddrconv(host, (unsigned char *)addr); +#endif /* UIP_UDP */ conn = tcp_connect((uip_ipaddr_t *)ipaddr, htons(port), NULL); @@ -482,9 +486,11 @@ webclient_appcall(void *state) dispatcher_markconn(conn, NULL); init_connection(); }*/ +#if UIP_UDP if(resolv_lookup(s.host) == NULL) { resolv_query(s.host); } +#endif /* UIP_UDP */ webclient_get(s.host, s.port, s.file); } } diff --git a/apps/webbrowser/www.c b/apps/webbrowser/www.c index c79d8720f..5847ff46b 100644 --- a/apps/webbrowser/www.c +++ b/apps/webbrowser/www.c @@ -29,7 +29,7 @@ * * This file is part of the Contiki desktop environment * - * $Id: www.c,v 1.10 2009/02/25 08:52:27 adamdunkels Exp $ + * $Id: www.c,v 1.11 2010/02/01 19:44:30 oliverschmidt Exp $ * */ @@ -301,6 +301,7 @@ open_url(void) file = "/"; } +#if UIP_UDP /* Try to lookup the hostname. If it fails, we initiate a hostname lookup and print out an informative message on the statusbar. */ if(uiplib_ipaddrconv(host, (unsigned char *)addr) == 0) { @@ -310,6 +311,9 @@ open_url(void) return; } } +#else /* UIP_UDP */ + uiplib_ipaddrconv(host, (unsigned char *)addr); +#endif /* UIP_UDP */ /* The hostname we present in the hostname table, so we send out the initial GET request. */ @@ -510,6 +514,7 @@ PROCESS_THREAD(www_process, ev, data) petsciiconv_topetscii(statustexturl, sizeof(statustexturl)); show_statustext(statustexturl); } +#if UIP_UDP } else if(ev == resolv_event_found) { /* Either found a hostname, or not. */ if((char *)data != NULL && @@ -518,6 +523,7 @@ PROCESS_THREAD(www_process, ev, data) } else { show_statustext("Host not found."); } +#endif /* UIP_UDP */ } else if(ev == ctk_signal_window_close || ev == PROCESS_EVENT_EXIT) { quit();