projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into getopt
[oweals/gnunet.git]
/
src
/
dns
/
dnsstub.c
diff --git
a/src/dns/dnsstub.c
b/src/dns/dnsstub.c
index 2e84760994c0027a3b5744689e61e35aaae833f7..68cd55275085ed85a70f8824e7f88b4d6af79798 100644
(file)
--- a/
src/dns/dnsstub.c
+++ b/
src/dns/dnsstub.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- Copyright (C) 2012
Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012
GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 5
9 Temple Place - Suite 330
,
- Boston, MA 0211
1-1307
, USA.
+ Free Software Foundation, Inc., 5
1 Franklin Street, Fifth Floor
,
+ Boston, MA 0211
0-1301
, USA.
*/
/**
* @file dns/dnsstub.c
*/
/**
* @file dns/dnsstub.c
@@
-24,6
+24,7
@@
*/
#include "platform.h"
#include "gnunet_util_lib.h"
*/
#include "platform.h"
#include "gnunet_util_lib.h"
+#include "gnunet_tun_lib.h"
#include "gnunet_dnsstub_lib.h"
/**
#include "gnunet_dnsstub_lib.h"
/**
@@
-185,11
+186,9
@@
open_socket (int af)
* Read a DNS response from the (unhindered) UDP-Socket
*
* @param cls socket to read from
* Read a DNS response from the (unhindered) UDP-Socket
*
* @param cls socket to read from
- * @param tc scheduler context (must be shutdown or read ready)
*/
static void
*/
static void
-read_response (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+read_response (void *cls);
/**
/**
@@
-279,7
+278,7
@@
GNUNET_DNSSTUB_resolve (struct GNUNET_DNSSTUB_Context *ctx,
else
ret = rs->dnsout6;
GNUNET_assert (NULL != ret);
else
ret = rs->dnsout6;
GNUNET_assert (NULL != ret);
- memcpy (&rs->addr,
+
GNUNET_
memcpy (&rs->addr,
sa,
sa_len);
rs->addrlen = sa_len;
sa,
sa_len);
rs->addrlen = sa_len;
@@
-369,7
+368,7
@@
GNUNET_DNSSTUB_resolve2 (struct GNUNET_DNSSTUB_Context *ctx,
ctx->dns_exit);
return NULL;
}
ctx->dns_exit);
return NULL;
}
- memcpy (&rs->addr,
+
GNUNET_
memcpy (&rs->addr,
sa,
salen);
rs->addrlen = salen;
sa,
salen);
rs->addrlen = salen;
@@
-383,9
+382,7
@@
GNUNET_DNSSTUB_resolve2 (struct GNUNET_DNSSTUB_Context *ctx,
_("Failed to send DNS request to %s\n"),
GNUNET_a2s (sa, salen));
rs->timeout = GNUNET_TIME_relative_to_absolute (REQUEST_TIMEOUT);
_("Failed to send DNS request to %s\n"),
GNUNET_a2s (sa, salen));
rs->timeout = GNUNET_TIME_relative_to_absolute (REQUEST_TIMEOUT);
-
return rs;
return rs;
-
}
}
@@
-438,14
+435,15
@@
do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Received DNS response that is too small (%u bytes)"),
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
_("Received DNS response that is too small (%u bytes)"),
- r);
+
(unsigned int)
r);
return GNUNET_NO;
}
dns = (struct GNUNET_TUN_DnsHeader *) buf;
if ( (addrlen != rs->addrlen) ||
return GNUNET_NO;
}
dns = (struct GNUNET_TUN_DnsHeader *) buf;
if ( (addrlen != rs->addrlen) ||
- (0 != memcmp (&rs->addr,
- &addr,
- addrlen)) ||
+ (GNUNET_YES !=
+ GNUNET_TUN_sockaddr_cmp ((struct sockaddr *) &rs->addr,
+ (struct sockaddr *) &addr,
+ GNUNET_YES)) ||
(0 == GNUNET_TIME_absolute_get_remaining (rs->timeout).rel_value_us) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
(0 == GNUNET_TIME_absolute_get_remaining (rs->timeout).rel_value_us) )
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@
-466,19
+464,19
@@
do_dns_read (struct GNUNET_DNSSTUB_RequestSocket *rs,
* Read a DNS response from the (unhindered) UDP-Socket
*
* @param cls socket to read from
* Read a DNS response from the (unhindered) UDP-Socket
*
* @param cls socket to read from
- * @param tc scheduler context (must be shutdown or read ready)
*/
static void
*/
static void
-read_response (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+read_response (void *cls)
{
struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
struct GNUNET_NETWORK_FDSet *rset;
{
struct GNUNET_DNSSTUB_RequestSocket *rs = cls;
struct GNUNET_NETWORK_FDSet *rset;
+ const struct GNUNET_SCHEDULER_TaskContext *tc;
rs->read_task = NULL;
rs->read_task = NULL;
+ tc = GNUNET_SCHEDULER_get_task_context ();
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_READ_READY))
{
- /* timeout
or shutdown
*/
+ /* timeout */
cleanup_rs (rs);
return;
}
cleanup_rs (rs);
return;
}