gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r33389 - in gnunet/src: scalarproduct set


From: gnunet
Subject: [GNUnet-SVN] r33389 - in gnunet/src: scalarproduct set
Date: Mon, 26 May 2014 11:32:55 +0200

Author: cfuchs
Date: 2014-05-26 11:32:54 +0200 (Mon, 26 May 2014)
New Revision: 33389

Modified:
   gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
   gnunet/src/set/gnunet-service-set_intersection.c
Log:
- fixed bug in set which allows a peer to generate a malformed session setup
- fixed double-cancel of a set-handle

Modified: gnunet/src/scalarproduct/gnunet-service-scalarproduct.c
===================================================================
--- gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2014-05-26 
09:09:58 UTC (rev 33388)
+++ gnunet/src/scalarproduct/gnunet-service-scalarproduct.c     2014-05-26 
09:32:54 UTC (rev 33389)
@@ -1279,8 +1279,10 @@
       GNUNET_SET_listen_cancel (s->intersection_listen);
       s->intersection_listen = NULL;
     }
+    
     // the op failed and has already been invalidated by the set service
     s->intersection_op = NULL;
+    s->intersection_set = NULL;
     break;
   }
 
@@ -1893,7 +1895,7 @@
   // as we have only one peer connected in each session, just remove the 
session
   s->channel = NULL;
 
-  if ((ALICE == s->role) && (GNUNET_NO != s->active) && (!do_shutdown))
+  if ((ALICE == s->role) && (GNUNET_YES == s->active) && (!do_shutdown))
   {
     // if this happened before we received the answer, we must terminate the 
session
     s->role = GNUNET_SYSERR;
@@ -1901,7 +1903,7 @@
             GNUNET_SCHEDULER_add_now (&prepare_client_end_notification,
                                       s);
   }
-  else
+  else if ((BOB == s->role) && (GNUNET_SYSERR != s->active))
   {
     if ((s == from_service_head) || ((NULL != from_service_head) && ((NULL != 
s->next) || (NULL != s->a_tail))))
       GNUNET_CONTAINER_DLL_remove (from_service_head, from_service_tail, s);

Modified: gnunet/src/set/gnunet-service-set_intersection.c
===================================================================
--- gnunet/src/set/gnunet-service-set_intersection.c    2014-05-26 09:09:58 UTC 
(rev 33388)
+++ gnunet/src/set/gnunet-service-set_intersection.c    2014-05-26 09:32:54 UTC 
(rev 33389)
@@ -748,6 +748,11 @@
     GNUNET_break_op (0);
     fail_intersection_operation(op);
   }
+  
+  if (0 == op->state->my_element_count) {
+    send_peer_done (op);
+    return;
+  }
 
   op->state->phase = PHASE_BF_EXCHANGE;
   op->state->my_elements = GNUNET_CONTAINER_multihashmap_create (1, 
GNUNET_YES);
@@ -758,7 +763,7 @@
 
   GNUNET_CONTAINER_bloomfilter_free (op->state->remote_bf);
   op->state->remote_bf = NULL;
-
+  
   if (op->state->my_element_count == ntohl (msg->sender_element_count))
     op->state->phase = PHASE_MAYBE_FINISHED;
 




reply via email to

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