diff options
author | Nils Durner <durner@gnunet.org> | 2009-08-23 22:11:49 +0000 |
---|---|---|
committer | Nils Durner <durner@gnunet.org> | 2009-08-23 22:11:49 +0000 |
commit | 2518cfc0a86865ebe4d0550e0013ed52a494231b (patch) | |
tree | e9a130b782597e18bcff24a9fdab6e5c6aae1f9c /src/upnp | |
parent | 2ae973618f3b51fa9bbf5532eaa1352cafc24ecc (diff) | |
download | gnunet-2518cfc0a86865ebe4d0550e0013ed52a494231b.tar.gz gnunet-2518cfc0a86865ebe4d0550e0013ed52a494231b.zip |
low level network API
Diffstat (limited to 'src/upnp')
-rw-r--r-- | src/upnp/upnp.c | 6 | ||||
-rw-r--r-- | src/upnp/upnp_init.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/upnp/upnp.c b/src/upnp/upnp.c index 6dc4338a0..afc815b1f 100644 --- a/src/upnp/upnp.c +++ b/src/upnp/upnp.c | |||
@@ -104,7 +104,7 @@ typedef struct | |||
104 | char *full_url; | 104 | char *full_url; |
105 | char *buf; | 105 | char *buf; |
106 | unsigned int buf_len; | 106 | unsigned int buf_len; |
107 | int sock; | 107 | struct GNUNET_NETWORK_Descriptor *sock; |
108 | } UPnPDiscoveryData; | 108 | } UPnPDiscoveryData; |
109 | 109 | ||
110 | static GaimUPnPControlInfo control_info = { | 110 | static GaimUPnPControlInfo control_info = { |
@@ -543,7 +543,7 @@ gaim_upnp_parse_description (char *proxy, UPnPDiscoveryData * dd) | |||
543 | } | 543 | } |
544 | 544 | ||
545 | int | 545 | int |
546 | gaim_upnp_discover (struct GNUNET_CONFIGURATION_Handle *cfg, int sock) | 546 | gaim_upnp_discover (struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_NETWORK_Descriptor *sock) |
547 | { | 547 | { |
548 | char *proxy; | 548 | char *proxy; |
549 | socklen_t avail; | 549 | socklen_t avail; |
@@ -613,7 +613,7 @@ gaim_upnp_discover (struct GNUNET_CONFIGURATION_Handle *cfg, int sock) | |||
613 | /* try to read response */ | 613 | /* try to read response */ |
614 | do | 614 | do |
615 | { | 615 | { |
616 | buf_len = recv (dd.sock, buf, sizeof (buf) - 1, 0); | 616 | buf_len = GNUNET_IO_recv (dd.sock, buf, sizeof (buf) - 1, 0); |
617 | if (buf_len > 0) | 617 | if (buf_len > 0) |
618 | { | 618 | { |
619 | buf[buf_len] = '\0'; | 619 | buf[buf_len] = '\0'; |
diff --git a/src/upnp/upnp_init.c b/src/upnp/upnp_init.c index 3dc0d2b7c..8390494e5 100644 --- a/src/upnp/upnp_init.c +++ b/src/upnp/upnp_init.c | |||
@@ -50,7 +50,7 @@ static unsigned int maps_size; | |||
50 | 50 | ||
51 | static struct GNUNET_ThreadHandle *discovery; | 51 | static struct GNUNET_ThreadHandle *discovery; |
52 | 52 | ||
53 | static int discovery_socket; | 53 | static struct GNUNET_NETWORK_Descriptor *discovery_socket; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * Obtain the public/external IP address. | 56 | * Obtain the public/external IP address. |
@@ -84,8 +84,8 @@ kill_discovery () | |||
84 | 84 | ||
85 | if (discovery != NULL) | 85 | if (discovery != NULL) |
86 | { | 86 | { |
87 | SHUTDOWN (discovery_socket, SHUT_RDWR); | 87 | GNUNET_IO_shutdown (discovery_socket, SHUT_RDWR); |
88 | CLOSE (discovery_socket); | 88 | GNUNET_IO_close (&discovery_socket); |
89 | GNUNET_thread_join (discovery, &unused); | 89 | GNUNET_thread_join (discovery, &unused); |
90 | discovery = NULL; | 90 | discovery = NULL; |
91 | } | 91 | } |
@@ -105,8 +105,8 @@ static void | |||
105 | discover (void *unused) | 105 | discover (void *unused) |
106 | { | 106 | { |
107 | kill_discovery (); | 107 | kill_discovery (); |
108 | discovery_socket = SOCKET (PF_INET, SOCK_DGRAM, 0); | 108 | discovery_socket = GNUNET_IO_socket (PF_INET, SOCK_DGRAM, 0); |
109 | if (discovery_socket == -1) | 109 | if (NULL == discovery_socket) |
110 | return; | 110 | return; |
111 | discovery = GNUNET_thread_create (&discover_thread, NULL, 1024 * 128); | 111 | discovery = GNUNET_thread_create (&discover_thread, NULL, 1024 * 128); |
112 | } | 112 | } |