Commit 34fa2db9 authored by Dafydd Harries's avatar Dafydd Harries

stun client: allow overriding server on command line

darcs-hash:20070105210221-c9803-624f95b4665afe14cab69cad864c224466ccb461.gz
parent 0e0f9d76
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <stun.h> #include <stun.h>
const gchar *server = "stun.fwdnet.net"; static gchar *server = "stun.fwdnet.net";
const guint port = 3478; const guint port = 3478;
static gboolean static gboolean
...@@ -24,7 +24,7 @@ resolve (const gchar *name, struct hostent *ret) ...@@ -24,7 +24,7 @@ resolve (const gchar *name, struct hostent *ret)
} }
int int
main (void) main (int argc, char **argv)
{ {
struct hostent he; struct hostent he;
struct sockaddr_in sin; struct sockaddr_in sin;
...@@ -35,6 +35,9 @@ main (void) ...@@ -35,6 +35,9 @@ main (void)
StunMessage *msg; StunMessage *msg;
StunAttribute **attr; StunAttribute **attr;
if (argc > 1)
server = argv[1];
if (!resolve(server, &he)) if (!resolve(server, &he))
{ {
g_debug ("failed to resolve %s\n", server); g_debug ("failed to resolve %s\n", server);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment