[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31721 - in gnunet/src: core util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31721 - in gnunet/src: core util |
Date: |
Mon, 23 Dec 2013 22:39:07 +0100 |
Author: grothoff
Date: 2013-12-23 22:39:07 +0100 (Mon, 23 Dec 2013)
New Revision: 31721
Modified:
gnunet/src/core/gnunet-service-core_kx.c
gnunet/src/util/resolver_api.c
Log:
-fix tiny leak, doxygen
Modified: gnunet/src/core/gnunet-service-core_kx.c
===================================================================
--- gnunet/src/core/gnunet-service-core_kx.c 2013-12-23 21:14:26 UTC (rev
31720)
+++ gnunet/src/core/gnunet-service-core_kx.c 2013-12-23 21:39:07 UTC (rev
31721)
@@ -1274,7 +1274,7 @@
/**
- * Closure for 'deliver_message'
+ * Closure for #deliver_message()
*/
struct DeliverMessageContext
{
@@ -1320,7 +1320,7 @@
return;
}
m = (const struct EncryptedMessage *) msg;
- if (kx->status != KX_STATE_UP)
+ if (KX_STATE_UP != kx->status)
{
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop
@@ -1365,8 +1365,10 @@
do_decrypt (kx, &iv, &m->sequence_number, &buf[ENCRYPTED_HEADER_SIZE],
size - ENCRYPTED_HEADER_SIZE))
return;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Decrypted %u bytes from %s\n",
- size - ENCRYPTED_HEADER_SIZE, GNUNET_i2s (&kx->peer));
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Decrypted %u bytes from %s\n",
+ size - ENCRYPTED_HEADER_SIZE,
+ GNUNET_i2s (&kx->peer));
pt = (struct EncryptedMessage *) buf;
/* validate sequence number */
@@ -1427,7 +1429,8 @@
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Message received far too old (%s). Content ignored.\n",
- GNUNET_STRINGS_relative_time_to_string
(GNUNET_TIME_absolute_get_duration (t), GNUNET_YES));
+ GNUNET_STRINGS_relative_time_to_string
(GNUNET_TIME_absolute_get_duration (t),
+ GNUNET_YES));
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop
("# bytes dropped (ancient message)"), size,
@@ -1439,14 +1442,16 @@
update_timeout (kx);
GNUNET_STATISTICS_update (GSC_stats,
gettext_noop ("# bytes of payload decrypted"),
- size - sizeof (struct EncryptedMessage),
GNUNET_NO);
+ size - sizeof (struct EncryptedMessage),
+ GNUNET_NO);
dmc.kx = kx;
dmc.peer = &kx->peer;
if (GNUNET_OK !=
GNUNET_SERVER_mst_receive (mst, &dmc,
&buf[sizeof (struct EncryptedMessage)],
size - sizeof (struct EncryptedMessage),
- GNUNET_YES, GNUNET_NO))
+ GNUNET_YES,
+ GNUNET_NO))
GNUNET_break_op (0);
}
@@ -1461,7 +1466,9 @@
* @param m the message
*/
static int
-deliver_message (void *cls, void *client, const struct GNUNET_MessageHeader *m)
+deliver_message (void *cls,
+ void *client,
+ const struct GNUNET_MessageHeader *m)
{
struct DeliverMessageContext *dmc = client;
@@ -1568,7 +1575,6 @@
int
GSC_KX_init (struct GNUNET_CRYPTO_EddsaPrivateKey *pk)
{
- GNUNET_assert (NULL != pk);
my_private_key = pk;
GNUNET_CRYPTO_eddsa_key_get_public (my_private_key,
&GSC_my_identity.public_key);
Modified: gnunet/src/util/resolver_api.c
===================================================================
--- gnunet/src/util/resolver_api.c 2013-12-23 21:14:26 UTC (rev 31720)
+++ gnunet/src/util/resolver_api.c 2013-12-23 21:39:07 UTC (rev 31721)
@@ -139,9 +139,9 @@
/**
* Has this request been transmitted to the service?
- * GNUNET_YES if transmitted
- * GNUNET_YES if not transmitted
- * GNUNET_SYSERR when request was canceled
+ * #GNUNET_YES if transmitted
+ * #GNUNET_YES if not transmitted
+ * #GNUNET_SYSERR when request was canceled
*/
int was_transmitted;
@@ -156,7 +156,7 @@
int direction;
/**
- * GNUNET_YES if a response was received
+ * #GNUNET_YES if a response was received
*/
int received_response;
@@ -245,7 +245,8 @@
GNUNET_assert (NULL == req_tail);
if (NULL != client)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from DNS service\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Disconnecting from DNS service\n");
GNUNET_CLIENT_disconnect (client);
client = NULL;
}
@@ -284,7 +285,8 @@
if (NULL ==
inet_ntop (AF_INET, ip, buf, sizeof (buf)))
{
- LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING,
+ "inet_ntop");
return NULL;
}
break;
@@ -294,7 +296,8 @@
if (NULL ==
inet_ntop (AF_INET6, ip, buf, sizeof (buf)))
{
- LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "inet_ntop");
+ LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING,
+ "inet_ntop");
return NULL;
}
break;
@@ -323,14 +326,16 @@
/**
* Process response with a hostname for a DNS lookup.
*
- * @param cls our "struct GNUNET_RESOLVER_RequestHandle" context
+ * @param cls our `struct GNUNET_RESOLVER_RequestHandle` context
* @param msg message with the hostname, NULL on error
*/
static void
-handle_response (void *cls, const struct GNUNET_MessageHeader *msg)
+handle_response (void *cls,
+ const struct GNUNET_MessageHeader *msg)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
uint16_t size;
+ char *nret;
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Receiving response from DNS service\n");
@@ -354,7 +359,9 @@
/* no reverse lookup was successful, return ip as string */
if (rh->received_response == GNUNET_NO)
{
- rh->name_callback (rh->cls, no_resolve (rh->af, &rh[1],
rh->data_len));
+ nret = no_resolve (rh->af, &rh[1], rh->data_len);
+ rh->name_callback (rh->cls, nret);
+ GNUNET_free (nret);
rh->name_callback (rh->cls, NULL);
}
/* at least one reverse lookup was successful */
@@ -384,7 +391,7 @@
if (size == sizeof (struct GNUNET_MessageHeader))
{
/* check if request was canceled */
- if (rh->was_transmitted != GNUNET_SYSERR)
+ if (GNUNET_SYSERR != rh->was_transmitted)
{
if (NULL != rh->name_callback)
rh->name_callback (rh->cls, NULL);
@@ -414,8 +421,11 @@
reconnect ();
return;
}
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s' for IP `%s'.\n",
- hostname, GNUNET_a2s ((const void *) &rh[1], rh->data_len));
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Resolver returns `%s' for IP `%s'.\n",
+ hostname,
+ GNUNET_a2s ((const void *) &rh[1],
+ rh->data_len));
if (rh->was_transmitted != GNUNET_SYSERR)
rh->name_callback (rh->cls, hostname);
rh->received_response = GNUNET_YES;
@@ -480,11 +490,12 @@
* given a valid numeric string. Perform the callbacks for the
* numeric addresses.
*
- * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
+ * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
* @param tc unused scheduler context
*/
static void
-numeric_resolution (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+numeric_resolution (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
struct sockaddr_in v4;
@@ -535,11 +546,12 @@
* given a variant of "loopback". Perform the callbacks for the
* respective loopback numeric addresses.
*
- * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
+ * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
* @param tc unused scheduler context
*/
static void
-loopback_resolution (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+loopback_resolution (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
struct sockaddr_in v4;
@@ -650,7 +662,8 @@
* @param tc scheduler context
*/
static void
-reconnect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+reconnect_task (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
r_task = GNUNET_SCHEDULER_NO_TASK;
if (NULL == req_head)
@@ -718,7 +731,7 @@
* @param hostname the hostname to resolve
* @param af AF_INET or AF_INET6; use AF_UNSPEC for "any"
* @param callback function to call with addresses
- * @param callback_cls closure for callback
+ * @param callback_cls closure for @a callback
* @param timeout how long to try resolving
* @return handle that can be used to cancel the request, NULL on error
*/
@@ -782,18 +795,21 @@
* We've been asked to convert an address to a string without
* a reverse lookup. Do it.
*
- * @param cls struct GNUNET_RESOLVER_RequestHandle for the request
+ * @param cls `struct GNUNET_RESOLVER_RequestHandle` for the request
* @param tc unused scheduler context
*/
static void
-numeric_reverse (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+numeric_reverse (void *cls,
+ const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct GNUNET_RESOLVER_RequestHandle *rh = cls;
char *result;
result = no_resolve (rh->af, &rh[1], rh->data_len);
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Resolver returns `%s'.\n", result);
- if (result != NULL)
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Resolver returns `%s'.\n",
+ result);
+ if (NULL != result)
{
rh->name_callback (rh->cls, result);
GNUNET_free (result);
@@ -807,16 +823,17 @@
* Get an IP address as a string.
*
* @param sa host address
- * @param salen length of host address
- * @param do_resolve use GNUNET_NO to return numeric hostname
+ * @param salen length of host address in @a sa
+ * @param do_resolve use #GNUNET_NO to return numeric hostname
* @param timeout how long to try resolving
* @param callback function to call with hostnames
* last callback is NULL when finished
- * @param cls closure for callback
+ * @param cls closure for @a callback
* @return handle that can be used to cancel the request
*/
struct GNUNET_RESOLVER_RequestHandle *
-GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen,
+GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa,
+ socklen_t salen,
int do_resolve,
struct GNUNET_TIME_Relative timeout,
GNUNET_RESOLVER_HostnameCallback callback,
@@ -901,7 +918,7 @@
*
* @param af AF_INET or AF_INET6; use AF_UNSPEC for "any"
* @param callback function to call with addresses
- * @param cls closure for callback
+ * @param cls closure for @a callback
* @param timeout how long to try resolving
* @return handle that can be used to cancel the request, NULL on error
*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31721 - in gnunet/src: core util,
gnunet <=