aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_api_peer_request.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/core_api_peer_request.c')
-rw-r--r--src/core/core_api_peer_request.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/core/core_api_peer_request.c b/src/core/core_api_peer_request.c
index 96640990a..0f13f15f9 100644
--- a/src/core/core_api_peer_request.c
+++ b/src/core/core_api_peer_request.c
@@ -41,10 +41,6 @@ struct GNUNET_CORE_PeerRequestHandle
41 */ 41 */
42 struct GNUNET_CLIENT_Connection *client; 42 struct GNUNET_CLIENT_Connection *client;
43 43
44 /**
45 * Scheduler.
46 */
47 struct GNUNET_SCHEDULER_Handle *sched;
48 44
49 /** 45 /**
50 * Function to call once done. 46 * Function to call once done.
@@ -92,8 +88,7 @@ send_request (void *cls,
92 if (buf == NULL) 88 if (buf == NULL)
93 { 89 {
94 if (prh->cont != NULL) 90 if (prh->cont != NULL)
95 GNUNET_SCHEDULER_add_continuation (prh->sched, 91 GNUNET_SCHEDULER_add_continuation (prh->cont,
96 prh->cont,
97 prh->cont_cls, 92 prh->cont_cls,
98 GNUNET_SCHEDULER_REASON_TIMEOUT); 93 GNUNET_SCHEDULER_REASON_TIMEOUT);
99 GNUNET_CLIENT_disconnect (prh->client, GNUNET_NO); 94 GNUNET_CLIENT_disconnect (prh->client, GNUNET_NO);
@@ -109,8 +104,7 @@ send_request (void *cls,
109 memcpy (buf, &msg, sizeof (msg)); 104 memcpy (buf, &msg, sizeof (msg));
110 if (prh->cont != NULL) 105 if (prh->cont != NULL)
111 { 106 {
112 GNUNET_SCHEDULER_add_continuation (prh->sched, 107 GNUNET_SCHEDULER_add_continuation (prh->cont,
113 prh->cont,
114 prh->cont_cls, 108 prh->cont_cls,
115 GNUNET_SCHEDULER_REASON_PREREQ_DONE); 109 GNUNET_SCHEDULER_REASON_PREREQ_DONE);
116 } 110 }
@@ -131,7 +125,6 @@ send_request (void *cls,
131 * to our connection attempt within the given time frame, 'cont' will 125 * to our connection attempt within the given time frame, 'cont' will
132 * be called with the TIMEOUT reason code. 126 * be called with the TIMEOUT reason code.
133 * 127 *
134 * @param sched scheduler to use
135 * @param cfg configuration to use 128 * @param cfg configuration to use
136 * @param timeout how long to try to talk to core 129 * @param timeout how long to try to talk to core
137 * @param peer who should we connect to 130 * @param peer who should we connect to
@@ -140,8 +133,7 @@ send_request (void *cls,
140 * @return NULL on error (cont will not be called), otherwise handle for cancellation 133 * @return NULL on error (cont will not be called), otherwise handle for cancellation
141 */ 134 */
142struct GNUNET_CORE_PeerRequestHandle * 135struct GNUNET_CORE_PeerRequestHandle *
143GNUNET_CORE_peer_request_connect (struct GNUNET_SCHEDULER_Handle *sched, 136GNUNET_CORE_peer_request_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
144 const struct GNUNET_CONFIGURATION_Handle *cfg,
145 struct GNUNET_TIME_Relative timeout, 137 struct GNUNET_TIME_Relative timeout,
146 const struct GNUNET_PeerIdentity * peer, 138 const struct GNUNET_PeerIdentity * peer,
147 GNUNET_SCHEDULER_Task cont, 139 GNUNET_SCHEDULER_Task cont,
@@ -150,12 +142,11 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_SCHEDULER_Handle *sched,
150 struct GNUNET_CORE_PeerRequestHandle *ret; 142 struct GNUNET_CORE_PeerRequestHandle *ret;
151 struct GNUNET_CLIENT_Connection *client; 143 struct GNUNET_CLIENT_Connection *client;
152 144
153 client = GNUNET_CLIENT_connect (sched, "core", cfg); 145 client = GNUNET_CLIENT_connect ("core", cfg);
154 if (client == NULL) 146 if (client == NULL)
155 return NULL; 147 return NULL;
156 ret = GNUNET_malloc (sizeof (struct GNUNET_CORE_PeerRequestHandle)); 148 ret = GNUNET_malloc (sizeof (struct GNUNET_CORE_PeerRequestHandle));
157 ret->client = client; 149 ret->client = client;
158 ret->sched = sched;
159 ret->cont = cont; 150 ret->cont = cont;
160 ret->cont_cls = cont_cls; 151 ret->cont_cls = cont_cls;
161 ret->peer = *peer; 152 ret->peer = *peer;