aboutsummaryrefslogtreecommitdiff
path: root/src/peerstore/gnunet-peerstore.c
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-05-12 11:41:33 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-05-12 11:41:33 +0000
commitfbba1459de972e27660c6abd8e28b7c6229fe040 (patch)
treeb283f076285ff5ee632a32344e9f49bbe238fb06 /src/peerstore/gnunet-peerstore.c
parent3927fc12b66a15a8ce60e3feb0ba33d824848732 (diff)
downloadgnunet-fbba1459de972e27660c6abd8e28b7c6229fe040.tar.gz
gnunet-fbba1459de972e27660c6abd8e28b7c6229fe040.zip
PEERSTORE cleanup and api test
Diffstat (limited to 'src/peerstore/gnunet-peerstore.c')
-rw-r--r--src/peerstore/gnunet-peerstore.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/peerstore/gnunet-peerstore.c b/src/peerstore/gnunet-peerstore.c
index 9b26cf36c..ec2af0a4f 100644
--- a/src/peerstore/gnunet-peerstore.c
+++ b/src/peerstore/gnunet-peerstore.c
@@ -29,11 +29,6 @@
29 29
30static int ret; 30static int ret;
31 31
32/**
33 * option '-t'
34 */
35static int test;
36
37/* 32/*
38 * Handle to PEERSTORE service 33 * Handle to PEERSTORE service
39 */ 34 */
@@ -56,17 +51,6 @@ shutdown_task (void *cls,
56 } 51 }
57} 52}
58 53
59void test_cont(void *cls, const char *emsg)
60{
61 char *req = cls;
62
63 printf("Received a response to request: %s\n", req);
64 if(NULL != emsg)
65 {
66 printf("Response: %s\n", emsg);
67 }
68}
69
70/** 54/**
71 * Main function that will be run by the scheduler. 55 * Main function that will be run by the scheduler.
72 * 56 *
@@ -88,27 +72,6 @@ run (void *cls,
88 NULL); 72 NULL);
89 peerstore_handle = GNUNET_PEERSTORE_connect(cfg); 73 peerstore_handle = GNUNET_PEERSTORE_connect(cfg);
90 GNUNET_assert(NULL != peerstore_handle); 74 GNUNET_assert(NULL != peerstore_handle);
91 if(GNUNET_YES == test)
92 {
93 struct GNUNET_PeerIdentity pid;
94 memset (&pid, 32, sizeof (pid));
95 GNUNET_PEERSTORE_store(peerstore_handle,
96 &pid,
97 "subsub",
98 "value",
99 5,
100 GNUNET_TIME_UNIT_FOREVER_REL,
101 &test_cont,
102 "Req1");
103 GNUNET_PEERSTORE_store(peerstore_handle,
104 &pid,
105 "subsub",
106 "value",
107 5,
108 GNUNET_TIME_UNIT_FOREVER_REL,
109 &test_cont,
110 "Req2");
111 }
112 75
113 ret = 0; 76 ret = 0;
114} 77}
@@ -124,9 +87,6 @@ int
124main (int argc, char *const *argv) 87main (int argc, char *const *argv)
125{ 88{
126 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 89 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
127 {'t', "test", NULL,
128 gettext_noop("TESTING"),
129 0, &GNUNET_GETOPT_set_one, &test},
130 GNUNET_GETOPT_OPTION_END 90 GNUNET_GETOPT_OPTION_END
131 }; 91 };
132 return (GNUNET_OK == 92 return (GNUNET_OK ==