[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r15950 - gnunet/src/util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r15950 - gnunet/src/util |
Date: |
Thu, 14 Jul 2011 11:16:17 +0200 |
Author: wachs
Date: 2011-07-14 11:16:17 +0200 (Thu, 14 Jul 2011)
New Revision: 15950
Modified:
gnunet/src/util/resolver_api.c
Log:
return ip address for timed out reverse lookups
Modified: gnunet/src/util/resolver_api.c
===================================================================
--- gnunet/src/util/resolver_api.c 2011-07-13 16:23:41 UTC (rev 15949)
+++ gnunet/src/util/resolver_api.c 2011-07-14 09:16:17 UTC (rev 15950)
@@ -153,6 +153,11 @@
int direction;
/**
+ * GNUNET_YES if a response was received
+ */
+ int received_response;
+
+ /**
* Length of the data that follows this struct.
*/
size_t data_len;
@@ -361,7 +366,13 @@
if (rh->was_transmitted != GNUNET_SYSERR)
{
if (NULL != rh->name_callback)
- rh->name_callback (rh->cls, NULL);
+ {
+ if (rh->received_response == GNUNET_NO)
+ rh->name_callback (rh->cls,
+ no_resolve ((const struct sockaddr *) &rh[1],
rh->data_len));
+ else
+ rh->name_callback (rh->cls, NULL);
+ }
if (NULL != rh->addr_callback)
rh->addr_callback (rh->cls, NULL, 0);
}
@@ -388,7 +399,7 @@
if (rh->was_transmitted != GNUNET_SYSERR)
{
if (NULL != rh->name_callback)
- rh->name_callback (rh->cls, NULL);
+ rh->name_callback (rh->cls, NULL);
if (NULL != rh->addr_callback)
rh->addr_callback (rh->cls, NULL, 0);
}
@@ -424,6 +435,7 @@
#endif
if (rh->was_transmitted != GNUNET_SYSERR)
rh->name_callback (rh->cls, hostname);
+ rh->received_response = GNUNET_YES;
GNUNET_CLIENT_receive (client,
&handle_response,
rh,
@@ -843,6 +855,7 @@
memcpy (&rh[1], sa, salen);
rh->data_len = salen;
rh->direction = GNUNET_YES;
+ rh->received_response = GNUNET_NO;
if (GNUNET_NO == do_resolve)
{
rh->task = GNUNET_SCHEDULER_add_now (&numeric_reverse, rh);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r15950 - gnunet/src/util,
gnunet <=