aboutsummaryrefslogtreecommitdiff
path: root/src/lockmanager/lockmanager_api.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2012-06-20 14:24:45 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2012-06-20 14:24:45 +0000
commit7a35bd8a7522bb9166430d9967382cc1082d23ac (patch)
tree8ebad6d7ad6e0ab4fb878a00df10a60e1d9a77dc /src/lockmanager/lockmanager_api.c
parentc5576791b6963e7375b25574e2fdcd2c216bc04d (diff)
downloadgnunet-7a35bd8a7522bb9166430d9967382cc1082d23ac.tar.gz
gnunet-7a35bd8a7522bb9166430d9967382cc1082d23ac.zip
-fixed reply handling
Diffstat (limited to 'src/lockmanager/lockmanager_api.c')
-rw-r--r--src/lockmanager/lockmanager_api.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/lockmanager/lockmanager_api.c b/src/lockmanager/lockmanager_api.c
index bfdb2c182..77773ed36 100644
--- a/src/lockmanager/lockmanager_api.c
+++ b/src/lockmanager/lockmanager_api.c
@@ -24,11 +24,6 @@
24 * @author Sree Harsha Totakura 24 * @author Sree Harsha Totakura
25 */ 25 */
26 26
27/**
28 * To be fixed:
29 * Should the handle be freed when the connection to service is lost?
30 * Should cancel_request have a call back (else simultaneous calls break)
31 */
32 27
33#include "platform.h" 28#include "platform.h"
34#include "gnunet_common.h" 29#include "gnunet_common.h"
@@ -244,11 +239,11 @@ transmit_notify (void *cls, size_t size, void *buf)
244 } 239 }
245 if (GNUNET_NO == handle->in_replies) 240 if (GNUNET_NO == handle->in_replies)
246 { 241 {
242 handle->in_replies = GNUNET_YES;
247 GNUNET_CLIENT_receive (handle->conn, 243 GNUNET_CLIENT_receive (handle->conn,
248 &handle_replies, 244 &handle_replies,
249 handle, 245 handle,
250 GNUNET_TIME_UNIT_FOREVER_REL); 246 GNUNET_TIME_UNIT_FOREVER_REL);
251 handle->in_replies = GNUNET_YES;
252 } 247 }
253 return msg_size; 248 return msg_size;
254} 249}
@@ -325,7 +320,7 @@ match_iterator (void *cls, const struct GNUNET_HashCode *key, void *value)
325 320
326 if ( (match->lock == lr->lock) && (0 == strcmp (match->domain, lr->domain)) ) 321 if ( (match->lock == lr->lock) && (0 == strcmp (match->domain, lr->domain)) )
327 { 322 {
328 match->matched_entry = lr; 323 match->matched_entry = lr;
329 return GNUNET_NO; 324 return GNUNET_NO;
330 } 325 }
331 return GNUNET_YES; 326 return GNUNET_YES;
@@ -478,11 +473,11 @@ handle_replies (void *cls,
478 handle); 473 handle);
479 return; 474 return;
480 } 475 }
476 handle->in_replies = GNUNET_YES;
481 GNUNET_CLIENT_receive (handle->conn, 477 GNUNET_CLIENT_receive (handle->conn,
482 &handle_replies, 478 &handle_replies,
483 handle, 479 handle,
484 GNUNET_TIME_UNIT_FOREVER_REL); 480 GNUNET_TIME_UNIT_FOREVER_REL);
485 handle->in_replies = GNUNET_YES;
486 if (GNUNET_MESSAGE_TYPE_LOCKMANAGER_SUCCESS != ntohs(msg->type)) 481 if (GNUNET_MESSAGE_TYPE_LOCKMANAGER_SUCCESS != ntohs(msg->type))
487 { 482 {
488 GNUNET_break (0); 483 GNUNET_break (0);
@@ -588,11 +583,11 @@ GNUNET_LOCKMANAGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
588 } 583 }
589 h->hashmap = GNUNET_CONTAINER_multihashmap_create (15); 584 h->hashmap = GNUNET_CONTAINER_multihashmap_create (15);
590 GNUNET_assert (NULL != h->hashmap); 585 GNUNET_assert (NULL != h->hashmap);
586 h->in_replies = GNUNET_YES;
591 GNUNET_CLIENT_receive (h->conn, 587 GNUNET_CLIENT_receive (h->conn,
592 &handle_replies, 588 &handle_replies,
593 h, 589 h,
594 GNUNET_TIME_UNIT_FOREVER_REL); 590 GNUNET_TIME_UNIT_FOREVER_REL);
595 h->in_replies = GNUNET_YES;
596 LOG (GNUNET_ERROR_TYPE_DEBUG, "%s() END\n", __func__); 591 LOG (GNUNET_ERROR_TYPE_DEBUG, "%s() END\n", __func__);
597 return h; 592 return h;
598} 593}