gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19787 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r19787 - gnunet/src/transport
Date: Mon, 13 Feb 2012 16:14:10 +0100

Author: grothoff
Date: 2012-02-13 16:14:10 +0100 (Mon, 13 Feb 2012)
New Revision: 19787

Modified:
   gnunet/src/transport/plugin_transport_http.c
Log:
-use loop when looking up session...

Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2012-02-13 15:10:02 UTC 
(rev 19786)
+++ gnunet/src/transport/plugin_transport_http.c        2012-02-13 15:14:10 UTC 
(rev 19787)
@@ -434,21 +434,13 @@
 lookup_session (struct Plugin *plugin,
                 const struct GNUNET_HELLO_Address *address)
 {
-  struct Session *tmp = NULL;
+  struct Session *pos;
 
-  tmp = plugin->head;
-  if (tmp == NULL)
-    return NULL;
-  while (tmp != NULL)
-  {
-    if (0 != memcmp (&address->peer, &tmp->target, sizeof (struct 
GNUNET_PeerIdentity)))
-      continue;
-    if ((address->address_length != tmp->addrlen) &&
-        (0 != memcmp (address->address, tmp->addr, tmp->addrlen)))
-      continue;
-
-    return tmp;
-  }
+  for (pos = plugin->head; NULL != pos; pos = pos->next)
+    if ( (0 == memcmp (&address->peer, &pos->target, sizeof (struct 
GNUNET_PeerIdentity))) &&
+        (address->address_length == pos->addrlen) &&
+        (0 == memcmp (address->address, pos->addr, pos->addrlen)) )
+      return pos;
   return NULL;
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]