projects
/
oweals
/
gnunet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check against all pending requests with same hash, not just first; this is a true...
[oweals/gnunet.git]
/
src
/
fs
/
gnunet-service-fs_cadet_client.c
diff --git
a/src/fs/gnunet-service-fs_cadet_client.c
b/src/fs/gnunet-service-fs_cadet_client.c
index dde7aba48715993e1c6c03e08073e5c517fa8a46..8d27491302159eb10850f790a792d5b55ff1b1e8 100644
(file)
--- a/
src/fs/gnunet-service-fs_cadet_client.c
+++ b/
src/fs/gnunet-service-fs_cadet_client.c
@@
-1,6
+1,6
@@
/*
This file is part of GNUnet.
/*
This file is part of GNUnet.
- (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+
Copyright
(C) 2012, 2013 Christian Grothoff (and other contributing authors)
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.
*/
/**
*/
/**
@@
-140,14
+140,14
@@
struct CadetHandle
* a few seconds to give the application a chance to give
* us another query).
*/
* a few seconds to give the application a chance to give
* us another query).
*/
-
GNUNET_SCHEDULER_TaskIdentifier
timeout_task;
+
struct GNUNET_SCHEDULER_Task *
timeout_task;
/**
* Task to reset cadets that had errors (asynchronously,
* as we may not be able to do it immediately during a
* callback from the cadet API).
*/
/**
* Task to reset cadets that had errors (asynchronously,
* as we may not be able to do it immediately during a
* callback from the cadet API).
*/
-
GNUNET_SCHEDULER_TaskIdentifier
reset_task;
+
struct GNUNET_SCHEDULER_Task *
reset_task;
};
};
@@
-219,8
+219,17
@@
reset_cadet (struct CadetHandle *mh)
"Resetting cadet channel to %s\n",
GNUNET_i2s (&mh->target));
mh->channel = NULL;
"Resetting cadet channel to %s\n",
GNUNET_i2s (&mh->target));
mh->channel = NULL;
+
if (NULL != channel)
if (NULL != channel)
+ {
+ /* Avoid loop */
+ if (NULL != mh->wh)
+ {
+ GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
+ mh->wh = NULL;
+ }
GNUNET_CADET_channel_destroy (channel);
GNUNET_CADET_channel_destroy (channel);
+ }
GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map,
&move_to_pending,
mh);
GNUNET_CONTAINER_multihashmap_iterate (mh->waiting_map,
&move_to_pending,
mh);
@@
-249,10
+258,11
@@
cadet_timeout (void *cls,
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout on cadet channel to %s\n",
GNUNET_i2s (&mh->target));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Timeout on cadet channel to %s\n",
GNUNET_i2s (&mh->target));
- mh->timeout_task =
GNUNET_SCHEDULER_NO_TASK
;
+ mh->timeout_task =
NULL
;
tun = mh->channel;
mh->channel = NULL;
tun = mh->channel;
mh->channel = NULL;
- GNUNET_CADET_channel_destroy (tun);
+ if(NULL != tun)
+ GNUNET_CADET_channel_destroy (tun);
}
}
@@
-268,7
+278,7
@@
reset_cadet_task (void *cls,
{
struct CadetHandle *mh = cls;
{
struct CadetHandle *mh = cls;
- mh->reset_task =
GNUNET_SCHEDULER_NO_TASK
;
+ mh->reset_task =
NULL
;
reset_cadet (mh);
}
reset_cadet (mh);
}
@@
-282,7
+292,7
@@
reset_cadet_task (void *cls,
static void
reset_cadet_async (struct CadetHandle *mh)
{
static void
reset_cadet_async (struct CadetHandle *mh)
{
- if (
GNUNET_SCHEDULER_NO_TASK
!= mh->reset_task)
+ if (
NULL
!= mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task,
mh);
GNUNET_SCHEDULER_cancel (mh->reset_task);
mh->reset_task = GNUNET_SCHEDULER_add_now (&reset_cadet_task,
mh);
@@
-517,10
+527,10
@@
get_cadet (const struct GNUNET_PeerIdentity *target)
target);
if (NULL != mh)
{
target);
if (NULL != mh)
{
- if (
GNUNET_SCHEDULER_NO_TASK
!= mh->timeout_task)
+ if (
NULL
!= mh->timeout_task)
{
GNUNET_SCHEDULER_cancel (mh->timeout_task);
{
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- mh->timeout_task =
GNUNET_SCHEDULER_NO_TASK
;
+ mh->timeout_task =
NULL
;
}
return mh;
}
}
return mh;
}
@@
-688,9
+698,9
@@
cleaner_cb (void *cls,
mh);
if (NULL != mh->wh)
GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
mh);
if (NULL != mh->wh)
GNUNET_CADET_notify_transmit_ready_cancel (mh->wh);
- if (
GNUNET_SCHEDULER_NO_TASK
!= mh->timeout_task)
+ if (
NULL
!= mh->timeout_task)
GNUNET_SCHEDULER_cancel (mh->timeout_task);
GNUNET_SCHEDULER_cancel (mh->timeout_task);
- if (
GNUNET_SCHEDULER_NO_TASK
!= mh->reset_task)
+ if (
NULL
!= mh->reset_task)
GNUNET_SCHEDULER_cancel (mh->reset_task);
GNUNET_assert (0 ==
GNUNET_CONTAINER_multihashmap_size (mh->waiting_map));
GNUNET_SCHEDULER_cancel (mh->reset_task);
GNUNET_assert (0 ==
GNUNET_CONTAINER_multihashmap_size (mh->waiting_map));