summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-05-30 18:33:38 +0000
committerChristian Grothoff <christian@grothoff.org>2013-05-30 18:33:38 +0000
commitddf8da52e94c520a93383edddfef3f537664a7c3 (patch)
tree9c884d67143b5d615dfd91f49fd8c2ecd65db7c0
parent2f90d42c880d86c2ebd272f7ae975401a92f2759 (diff)
-export FS handle during events, as we might generate events duing FS_start and client then doesn't know the handle yet
-rw-r--r--src/fs/fs_download.c1
-rw-r--r--src/fs/fs_publish.c1
-rw-r--r--src/fs/fs_search.c2
-rw-r--r--src/fs/fs_unindex.c2
-rw-r--r--src/include/gnunet_fs_service.h4
5 files changed, 9 insertions, 1 deletions
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index dc4d6723b..2371e6544 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -122,6 +122,7 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
pi->value.download.eta =
GNUNET_TIME_calculate_eta (dc->start_time, dc->completed, dc->length);
pi->value.download.is_active = (NULL == dc->client) ? GNUNET_NO : GNUNET_YES;
+ pi->fsh = dc->h;
if (0 == (dc->options & GNUNET_FS_DOWNLOAD_IS_PROBE))
dc->client_info = dc->h->upcb (dc->h->upcb_cls, pi);
else
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index 30ab1ee6f..041d4213c 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -64,6 +64,7 @@ GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
pi->value.publish.duration =
GNUNET_TIME_absolute_get_duration (p->start_time);
pi->value.publish.anonymity = p->bo.anonymity_level;
+ pi->fsh = pc->h;
return pc->h->upcb (pc->h->upcb_cls, pi);
}
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c
index 2fa14f68d..10627753a 100644
--- a/src/fs/fs_search.c
+++ b/src/fs/fs_search.c
@@ -61,6 +61,7 @@ GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
? GNUNET_TIME_absolute_get_duration (sc->start_time)
: GNUNET_TIME_UNIT_ZERO;
pi->value.search.anonymity = (NULL != sc) ? sc->anonymity : 0;
+ pi->fsh = h;
ret = h->upcb (h->upcb_cls, pi);
return ret;
}
@@ -457,6 +458,7 @@ GNUNET_FS_probe (struct GNUNET_FS_Handle *h,
{
struct GNUNET_FS_SearchResult *sr;
+ GNUNET_assert (NULL != h);
sr = GNUNET_new (struct GNUNET_FS_SearchResult);
sr->h = h;
sr->uri = GNUNET_FS_uri_dup (uri);
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c
index 365698c4f..132109c59 100644
--- a/src/fs/fs_unindex.c
+++ b/src/fs/fs_unindex.c
@@ -89,8 +89,8 @@ GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi,
pi->value.unindex.duration =
GNUNET_TIME_absolute_get_duration (uc->start_time);
pi->value.unindex.completed = offset;
+ pi->fsh = uc->h;
uc->client_info = uc->h->upcb (uc->h->upcb_cls, pi);
-
}
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h
index d1859fa05..a1e2dca23 100644
--- a/src/include/gnunet_fs_service.h
+++ b/src/include/gnunet_fs_service.h
@@ -1912,6 +1912,10 @@ struct GNUNET_FS_ProgressInfo
*/
enum GNUNET_FS_Status status;
+ /**
+ * File-sharing handle that generated the event.
+ */
+ struct GNUNET_FS_Handle *fsh;
};