diff options
Diffstat (limited to 'src/messenger/gnunet-service-messenger_service.c')
-rw-r--r-- | src/messenger/gnunet-service-messenger_service.c | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/src/messenger/gnunet-service-messenger_service.c b/src/messenger/gnunet-service-messenger_service.c index 8c63e9bf4..91165cf63 100644 --- a/src/messenger/gnunet-service-messenger_service.c +++ b/src/messenger/gnunet-service-messenger_service.c | |||
@@ -41,7 +41,8 @@ callback_shutdown_service (void *cls) | |||
41 | } | 41 | } |
42 | 42 | ||
43 | struct GNUNET_MESSENGER_Service* | 43 | struct GNUNET_MESSENGER_Service* |
44 | create_service (const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_SERVICE_Handle *service_handle) | 44 | create_service (const struct GNUNET_CONFIGURATION_Handle *config, |
45 | struct GNUNET_SERVICE_Handle *service_handle) | ||
45 | { | 46 | { |
46 | GNUNET_assert((config) && (service_handle)); | 47 | GNUNET_assert((config) && (service_handle)); |
47 | 48 | ||
@@ -88,7 +89,9 @@ create_service (const struct GNUNET_CONFIGURATION_Handle *config, struct GNUNET_ | |||
88 | } | 89 | } |
89 | 90 | ||
90 | static int | 91 | static int |
91 | iterate_destroy_rooms (void *cls, const struct GNUNET_HashCode *key, void *value) | 92 | iterate_destroy_rooms (void *cls, |
93 | const struct GNUNET_HashCode *key, | ||
94 | void *value) | ||
92 | { | 95 | { |
93 | struct GNUNET_MESSENGER_SrvRoom *room = value; | 96 | struct GNUNET_MESSENGER_SrvRoom *room = value; |
94 | destroy_room (room); | 97 | destroy_room (room); |
@@ -151,7 +154,8 @@ get_service_contact_store (struct GNUNET_MESSENGER_Service *service) | |||
151 | } | 154 | } |
152 | 155 | ||
153 | struct GNUNET_MESSENGER_SrvHandle* | 156 | struct GNUNET_MESSENGER_SrvHandle* |
154 | add_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_Handle *mq) | 157 | add_service_handle (struct GNUNET_MESSENGER_Service *service, |
158 | struct GNUNET_MQ_Handle *mq) | ||
155 | { | 159 | { |
156 | GNUNET_assert((service) && (mq)); | 160 | GNUNET_assert((service) && (mq)); |
157 | 161 | ||
@@ -166,7 +170,8 @@ add_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MQ_H | |||
166 | } | 170 | } |
167 | 171 | ||
168 | void | 172 | void |
169 | remove_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle) | 173 | remove_service_handle (struct GNUNET_MESSENGER_Service *service, |
174 | struct GNUNET_MESSENGER_SrvHandle *handle) | ||
170 | { | 175 | { |
171 | GNUNET_assert((service) && (handle)); | 176 | GNUNET_assert((service) && (handle)); |
172 | 177 | ||
@@ -178,7 +183,8 @@ remove_service_handle (struct GNUNET_MESSENGER_Service *service, struct GNUNET_M | |||
178 | } | 183 | } |
179 | 184 | ||
180 | int | 185 | int |
181 | get_service_peer_identity (const struct GNUNET_MESSENGER_Service *service, struct GNUNET_PeerIdentity *peer) | 186 | get_service_peer_identity (const struct GNUNET_MESSENGER_Service *service, |
187 | struct GNUNET_PeerIdentity *peer) | ||
182 | { | 188 | { |
183 | GNUNET_assert((service) && (peer)); | 189 | GNUNET_assert((service) && (peer)); |
184 | 190 | ||
@@ -186,7 +192,8 @@ get_service_peer_identity (const struct GNUNET_MESSENGER_Service *service, struc | |||
186 | } | 192 | } |
187 | 193 | ||
188 | struct GNUNET_MESSENGER_SrvRoom* | 194 | struct GNUNET_MESSENGER_SrvRoom* |
189 | get_service_room (const struct GNUNET_MESSENGER_Service *service, const struct GNUNET_HashCode *key) | 195 | get_service_room (const struct GNUNET_MESSENGER_Service *service, |
196 | const struct GNUNET_HashCode *key) | ||
190 | { | 197 | { |
191 | GNUNET_assert((service) && (key)); | 198 | GNUNET_assert((service) && (key)); |
192 | 199 | ||
@@ -194,7 +201,8 @@ get_service_room (const struct GNUNET_MESSENGER_Service *service, const struct G | |||
194 | } | 201 | } |
195 | 202 | ||
196 | int | 203 | int |
197 | open_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, | 204 | open_service_room (struct GNUNET_MESSENGER_Service *service, |
205 | struct GNUNET_MESSENGER_SrvHandle *handle, | ||
198 | const struct GNUNET_HashCode *key) | 206 | const struct GNUNET_HashCode *key) |
199 | { | 207 | { |
200 | GNUNET_assert((service) && (handle) && (key)); | 208 | GNUNET_assert((service) && (handle) && (key)); |
@@ -217,8 +225,10 @@ open_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSE | |||
217 | } | 225 | } |
218 | 226 | ||
219 | int | 227 | int |
220 | entry_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, | 228 | entry_service_room (struct GNUNET_MESSENGER_Service *service, |
221 | const struct GNUNET_PeerIdentity *door, const struct GNUNET_HashCode *key) | 229 | struct GNUNET_MESSENGER_SrvHandle *handle, |
230 | const struct GNUNET_PeerIdentity *door, | ||
231 | const struct GNUNET_HashCode *key) | ||
222 | { | 232 | { |
223 | GNUNET_assert((service) && (handle) && (door) && (key)); | 233 | GNUNET_assert((service) && (handle) && (door) && (key)); |
224 | 234 | ||
@@ -250,7 +260,8 @@ entry_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESS | |||
250 | } | 260 | } |
251 | 261 | ||
252 | int | 262 | int |
253 | close_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvHandle *handle, | 263 | close_service_room (struct GNUNET_MESSENGER_Service *service, |
264 | struct GNUNET_MESSENGER_SrvHandle *handle, | ||
254 | const struct GNUNET_HashCode *key) | 265 | const struct GNUNET_HashCode *key) |
255 | { | 266 | { |
256 | GNUNET_assert((service) && (handle) && (key)); | 267 | GNUNET_assert((service) && (handle) && (key)); |
@@ -290,9 +301,11 @@ close_service_room (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESS | |||
290 | } | 301 | } |
291 | 302 | ||
292 | void | 303 | void |
293 | handle_service_message (struct GNUNET_MESSENGER_Service *service, struct GNUNET_MESSENGER_SrvRoom *room, | 304 | handle_service_message (struct GNUNET_MESSENGER_Service *service, |
305 | struct GNUNET_MESSENGER_SrvRoom *room, | ||
294 | const struct GNUNET_MESSENGER_MemberSession *session, | 306 | const struct GNUNET_MESSENGER_MemberSession *session, |
295 | const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash) | 307 | const struct GNUNET_MESSENGER_Message *message, |
308 | const struct GNUNET_HashCode *hash) | ||
296 | { | 309 | { |
297 | GNUNET_assert((service) && (room) && (session) && (message) && (hash)); | 310 | GNUNET_assert((service) && (room) && (session) && (message) && (hash)); |
298 | 311 | ||