aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/psycstore_api.c
diff options
context:
space:
mode:
authorGabor X Toth <*@tg-x.net>2013-09-03 22:33:21 +0000
committerGabor X Toth <*@tg-x.net>2013-09-03 22:33:21 +0000
commiteb9556bf2983ca19a5cbcf7cf460a0b2509b290a (patch)
tree285d31e951f7ecf9308b22257adcadd5b07d80ea /src/psycstore/psycstore_api.c
parent37bafa60a6f0e447cb5b61547404f0902fa7ad41 (diff)
downloadgnunet-eb9556bf2983ca19a5cbcf7cf460a0b2509b290a.tar.gz
gnunet-eb9556bf2983ca19a5cbcf7cf460a0b2509b290a.zip
PSYCstore SQLite backend; API fixes/enhancements
Diffstat (limited to 'src/psycstore/psycstore_api.c')
-rw-r--r--src/psycstore/psycstore_api.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/src/psycstore/psycstore_api.c b/src/psycstore/psycstore_api.c
index d8d5134b6..194dcc79e 100644
--- a/src/psycstore/psycstore_api.c
+++ b/src/psycstore/psycstore_api.c
@@ -187,7 +187,7 @@ message_handler (void *cls,
187{ 187{
188 struct GNUNET_PSYCSTORE_Handle *h = cls; 188 struct GNUNET_PSYCSTORE_Handle *h = cls;
189 struct GNUNET_PSYCSTORE_OperationHandle *op; 189 struct GNUNET_PSYCSTORE_OperationHandle *op;
190 const struct GNUNET_PSYCSTORE_ResultCodeMessage *rcm; 190 const struct ResultCodeMessage *rcm;
191 const char *str; 191 const char *str;
192 uint16_t size; 192 uint16_t size;
193 193
@@ -203,22 +203,22 @@ message_handler (void *cls,
203 switch (ntohs (msg->type)) 203 switch (ntohs (msg->type))
204 { 204 {
205 case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE: 205 case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE:
206 if (size < sizeof (struct GNUNET_PSYCSTORE_ResultCodeMessage)) 206 if (size < sizeof (struct ResultCodeMessage))
207 { 207 {
208 GNUNET_break (0); 208 GNUNET_break (0);
209 reschedule_connect (h); 209 reschedule_connect (h);
210 return; 210 return;
211 } 211 }
212 rcm = (const struct GNUNET_PSYCSTORE_ResultCodeMessage *) msg; 212 rcm = (const struct ResultCodeMessage *) msg;
213 str = (const char *) &rcm[1]; 213 str = (const char *) &rcm[1];
214 if ( (size > sizeof (struct GNUNET_PSYCSTORE_ResultCodeMessage)) && 214 if ( (size > sizeof (struct ResultCodeMessage)) &&
215 ('\0' != str[size - sizeof (struct GNUNET_PSYCSTORE_ResultCodeMessage) - 1]) ) 215 ('\0' != str[size - sizeof (struct ResultCodeMessage) - 1]) )
216 { 216 {
217 GNUNET_break (0); 217 GNUNET_break (0);
218 reschedule_connect (h); 218 reschedule_connect (h);
219 return; 219 return;
220 } 220 }
221 if (size == sizeof (struct GNUNET_PSYCSTORE_ResultCodeMessage)) 221 if (size == sizeof (struct ResultCodeMessage))
222 str = NULL; 222 str = NULL;
223 223
224 op = h->op_head; 224 op = h->op_head;
@@ -341,7 +341,6 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
341 h->client = GNUNET_CLIENT_connect ("psycstore", h->cfg); 341 h->client = GNUNET_CLIENT_connect ("psycstore", h->cfg);
342 GNUNET_assert (NULL != h->client); 342 GNUNET_assert (NULL != h->client);
343 transmit_next (h); 343 transmit_next (h);
344 GNUNET_assert (NULL != h->th);
345} 344}
346 345
347 346
@@ -399,7 +398,7 @@ GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h)
399 * was already transmitted, the service may still choose to complete 398 * was already transmitted, the service may still choose to complete
400 * the operation. 399 * the operation.
401 * 400 *
402 * @param op operation to cancel 401 * @param op Operation to cancel.
403 */ 402 */
404void 403void
405GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op) 404GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op)
@@ -435,4 +434,33 @@ GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op)
435} 434}
436 435
437 436
437struct GNUNET_PSYCSTORE_OperationHandle *
438GNUNET_PSYCSTORE_membership_store (
439 struct GNUNET_PSYCSTORE_Handle *h,
440 const struct GNUNET_CRYPTO_EccPublicKey *channel_key,
441 const struct GNUNET_CRYPTO_EccPublicKey *slave_key,
442 int did_join,
443 uint64_t announced_at,
444 uint64_t effective_since,
445 uint64_t group_generation,
446 GNUNET_PSYCSTORE_ResultCallback rcb,
447 void *rcb_cls)
448{
449
450}
451
452
453struct GNUNET_PSYCSTORE_OperationHandle *
454GNUNET_PSYCSTORE_membership_test (
455 struct GNUNET_PSYCSTORE_Handle *h,
456 const struct GNUNET_CRYPTO_EccPublicKey *channel_key,
457 const struct GNUNET_CRYPTO_EccPublicKey *slave_key,
458 uint64_t message_id,
459 uint64_t group_generation,
460 GNUNET_PSYCSTORE_ResultCallback rcb,
461 void *rcb_cls)
462{
463
464}
465
438/* end of psycstore_api.c */ 466/* end of psycstore_api.c */