[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r10482 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r10482 - gnunet/src/transport |
Date: |
Thu, 4 Mar 2010 10:49:27 +0100 |
Author: grothoff
Date: 2010-03-04 10:49:27 +0100 (Thu, 04 Mar 2010)
New Revision: 10482
Modified:
gnunet/src/transport/plugin_transport_udp_nat.c
Log:
clean up
Modified: gnunet/src/transport/plugin_transport_udp_nat.c
===================================================================
--- gnunet/src/transport/plugin_transport_udp_nat.c 2010-03-04 09:38:51 UTC
(rev 10481)
+++ gnunet/src/transport/plugin_transport_udp_nat.c 2010-03-04 09:49:27 UTC
(rev 10482)
@@ -512,21 +512,20 @@
* for the next transmission call; or if the
* peer disconnected...)
* @param cont_cls closure for cont
- *
* @return the number of bytes written
- *
*/
static ssize_t
udp_nat_real_send (void *cls,
- struct GNUNET_NETWORK_Handle *send_handle,
- const struct GNUNET_PeerIdentity *target,
- const char *msgbuf,
- size_t msgbuf_size,
- unsigned int priority,
- struct GNUNET_TIME_Relative timeout,
- const void *addr,
- size_t addrlen,
- GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls)
+ struct GNUNET_NETWORK_Handle *send_handle,
+ const struct GNUNET_PeerIdentity *target,
+ const char *msgbuf,
+ size_t msgbuf_size,
+ unsigned int priority,
+ struct GNUNET_TIME_Relative timeout,
+ const void *addr,
+ size_t addrlen,
+ GNUNET_TRANSPORT_TransmitContinuation cont,
+ void *cont_cls)
{
struct Plugin *plugin = cls;
struct UDPMessage *message;
@@ -834,7 +833,6 @@
struct UDP_NAT_Probes *probe = cls;
struct UDP_NAT_ProbeMessage *message;
struct Plugin *plugin = probe->plugin;
- int sent;
message = GNUNET_malloc(sizeof(struct UDP_NAT_ProbeMessage));
message->header.size = htons(sizeof(struct UDP_NAT_ProbeMessage));
@@ -858,19 +856,16 @@
else
probe->index = 0;
- sent = udp_nat_real_send(plugin, udp_nat_socks[probe->index]->desc, NULL,
(char *)message, ntohs(message->header.size), 0,
GNUNET_TIME_relative_get_unit(), &probe->sock_addr, sizeof(probe->sock_addr),
&udp_probe_continuation, probe);
+ udp_nat_real_send(plugin, udp_nat_socks[probe->index]->desc, NULL,
+ (char *)message, ntohs(message->header.size), 0,
+ GNUNET_TIME_relative_get_unit(),
+ &probe->sock_addr, sizeof(probe->sock_addr),
+ &udp_probe_continuation, probe);
GNUNET_free(message);
}
-void
-dummy_continuation (void *cls, const struct GNUNET_PeerIdentity *target, int
result)
-{
- return;
-}
-
-
/**
* Continuation for probe sends. If the last probe was sent
* "successfully", schedule sending of another one. If not,
@@ -1030,7 +1025,6 @@
struct PeerSession *peer_session;
struct MessageQueue *pending_message;
struct MessageQueue *pending_message_temp;
- int sent;
if (memcmp(sender, plugin->env->my_identity, sizeof(struct
GNUNET_PeerIdentity)) == 0)
{
@@ -1055,7 +1049,12 @@
_("Received a probe on listen port %d, sent_from port
%d\n"), sockinfo->port, ntohs(((struct sockaddr_in *)sender_addr)->sin_port));
#endif
- sent = udp_nat_real_send(plugin, sockinfo->desc, NULL, (char
*)outgoing_probe_reply, ntohs(outgoing_probe_reply->header.size), 0,
GNUNET_TIME_relative_get_unit(), sender_addr, fromlen, &dummy_continuation,
NULL);
+ udp_nat_real_send(plugin, sockinfo->desc, NULL,
+ (char *)outgoing_probe_reply,
+ ntohs(outgoing_probe_reply->header.size), 0,
+ GNUNET_TIME_relative_get_unit(),
+ sender_addr, fromlen,
+ NULL, NULL);
#if DEBUG_UDP_NAT
GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, "udp-nat",
_("Sent PROBE REPLY to port %d on outgoing port %d\n"),
ntohs(((struct sockaddr_in *)sender_addr)->sin_port), sockinfo->port);
@@ -1084,7 +1083,7 @@
outgoing_probe_confirmation = GNUNET_malloc(sizeof(struct
UDP_NAT_ProbeMessageConfirmation));
outgoing_probe_confirmation->header.size = htons(sizeof(struct
UDP_NAT_ProbeMessageConfirmation));
outgoing_probe_confirmation->header.type =
htons(GNUNET_MESSAGE_TYPE_TRANSPORT_UDP_NAT_PROBE_CONFIRM);
- sent = udp_nat_real_send(plugin, sockinfo->desc, NULL, (char
*)outgoing_probe_confirmation, ntohs(outgoing_probe_confirmation->header.size),
0, GNUNET_TIME_relative_get_unit(), sender_addr, fromlen, &dummy_continuation,
NULL);
+ udp_nat_real_send(plugin, sockinfo->desc, NULL, (char
*)outgoing_probe_confirmation, ntohs(outgoing_probe_confirmation->header.size),
0, GNUNET_TIME_relative_get_unit(), sender_addr, fromlen, NULL, NULL);
if (outgoing_probe->task != GNUNET_SCHEDULER_NO_TASK)
{
GNUNET_SCHEDULER_cancel(plugin->env->sched,
outgoing_probe->task);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r10482 - gnunet/src/transport,
gnunet <=