[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] branch master updated: add function to compute channel name for
From: |
gnunet |
Subject: |
[gnunet] branch master updated: add function to compute channel name for notifications |
Date: |
Wed, 23 Nov 2022 13:10:18 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 28a4f4e5d add function to compute channel name for notifications
new 21371c2e8 Merge branch 'master' of git+ssh://git.gnunet.org/gnunet
28a4f4e5d is described below
commit 28a4f4e5d78df67ccae80e1cf21a69227bf48f96
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Nov 23 13:10:07 2022 +0100
add function to compute channel name for notifications
---
src/include/gnunet_pq_lib.h | 11 +++++++++++
src/pq/pq_event.c | 15 +++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index 4ea286b9f..550ba5eee 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -1139,6 +1139,17 @@ GNUNET_PQ_event_notify (struct GNUNET_PQ_Context *db,
size_t extra_size);
+/**
+ * Compute the channel that one should notify upon
+ * for the given event specification.
+ *
+ * @param es event specification
+ * @return channel to notify upon
+ */
+char *
+GNUNET_PG_get_event_notify_channel (const struct GNUNET_DB_EventHeaderP *es);
+
+
/**
* Within the @a db context, run all the SQL files
* from the @a load_path from 0000-9999.sql (as long
diff --git a/src/pq/pq_event.c b/src/pq/pq_event.c
index 0e56c8b70..d1d34422b 100644
--- a/src/pq/pq_event.c
+++ b/src/pq/pq_event.c
@@ -512,6 +512,21 @@ GNUNET_PQ_event_listen_cancel (struct
GNUNET_DB_EventHandler *eh)
}
+char *
+GNUNET_PG_get_event_notify_channel (const struct GNUNET_DB_EventHeaderP *es)
+{
+ char sql[16 + 64 + extra_size * 8 / 5 + 8];
+ char *end;
+
+ end = stpcpy (sql,
+ "NOTIFY X");
+ end = es_to_channel (es,
+ end);
+ GNUNET_assert (NULL != end);
+ return GNUNET_strdup (sql);
+}
+
+
void
GNUNET_PQ_event_notify (struct GNUNET_PQ_Context *db,
const struct GNUNET_DB_EventHeaderP *es,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnunet] branch master updated: add function to compute channel name for notifications,
gnunet <=