aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pq/pq.h')
-rw-r--r--src/pq/pq.h31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/pq/pq.h b/src/pq/pq.h
index 3c89626a9..d10931d99 100644
--- a/src/pq/pq.h
+++ b/src/pq/pq.h
@@ -28,6 +28,7 @@
28#include "gnunet_util_lib.h" 28#include "gnunet_util_lib.h"
29#include "gnunet_pq_lib.h" 29#include "gnunet_pq_lib.h"
30 30
31
31/** 32/**
32 * Handle to Postgres database. 33 * Handle to Postgres database.
33 */ 34 */
@@ -59,24 +60,32 @@ struct GNUNET_PQ_Context
59 char *load_path; 60 char *load_path;
60 61
61 /** 62 /**
62 * Function to call on Postgres FDs. 63 * Map managing event subscriptions.
63 */ 64 */
64 GNUNET_PQ_SocketCallback sc; 65 struct GNUNET_CONTAINER_MultiShortmap *channel_map;
65 66
66 /** 67 /**
67 * Closure for @e sc. 68 * Task responsible for processing events.
68 */ 69 */
69 void *sc_cls; 70 struct GNUNET_SCHEDULER_Task *event_task;
70 71
71 /** 72 /**
72 * Map managing event subscriptions. 73 * File descriptor wrapper for @e event_task.
73 */ 74 */
74 struct GNUNET_CONTAINER_MultiShortmap *channel_map; 75 struct GNUNET_NETWORK_Handle *rfd;
75
76 /**
77 * Lock to access @e channel_map.
78 */
79 pthread_mutex_t notify_lock;
80}; 76};
81 77
78
79/**
80 * Internal API. Reconnect should re-register notifications
81 * after a disconnect.
82 *
83 * @param db the DB handle
84 * @param fd socket to listen on
85 */
86void
87GNUNET_PQ_event_reconnect_ (struct GNUNET_PQ_Context *db,
88 int fd);
89
90
82#endif 91#endif