diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-10-02 13:30:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-10-02 13:30:41 +0000 |
commit | 506163121bcfe92a54c33d819b38f418dd45b3cd (patch) | |
tree | f994658c79e2cc4b40d2126936275d911fc5fac9 /src/dht/dht_api_find_peer.c | |
parent | d63722b3c76cbf10ac40ea77710dd08086d259b0 (diff) | |
download | gnunet-506163121bcfe92a54c33d819b38f418dd45b3cd.tar.gz gnunet-506163121bcfe92a54c33d819b38f418dd45b3cd.zip |
new DHT API code
Diffstat (limited to 'src/dht/dht_api_find_peer.c')
-rw-r--r-- | src/dht/dht_api_find_peer.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/dht/dht_api_find_peer.c b/src/dht/dht_api_find_peer.c index 91713f988..98bec0d36 100644 --- a/src/dht/dht_api_find_peer.c +++ b/src/dht/dht_api_find_peer.c | |||
@@ -109,30 +109,19 @@ GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle, | |||
109 | struct GNUNET_DHT_FindPeerHandle *find_peer_handle; | 109 | struct GNUNET_DHT_FindPeerHandle *find_peer_handle; |
110 | struct GNUNET_DHT_FindPeerMessage find_peer_msg; | 110 | struct GNUNET_DHT_FindPeerMessage find_peer_msg; |
111 | 111 | ||
112 | /* FIXME: remove this limitation */ | ||
113 | if ((handle->current != NULL) && (handle->retransmit_stage != DHT_RETRANSMITTING)) | ||
114 | { | ||
115 | /* Can't send right now, we have a pending message... */ | ||
116 | return NULL; | ||
117 | } | ||
118 | |||
119 | find_peer_handle = | 112 | find_peer_handle = |
120 | GNUNET_malloc (sizeof (struct GNUNET_DHT_FindPeerHandle)); | 113 | GNUNET_malloc (sizeof (struct GNUNET_DHT_FindPeerHandle)); |
121 | find_peer_handle->find_peer_context.proc = proc; | 114 | find_peer_handle->proc = proc; |
122 | find_peer_handle->find_peer_context.proc_cls = proc_cls; | 115 | find_peer_handle->proc_cls = proc_cls; |
123 | |||
124 | #if DEBUG_DHT_API | ||
125 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
126 | "`%s': Inserting pending `%s' request with key %s\n", "DHT API", | ||
127 | "FIND PEER", GNUNET_h2s (key)); | ||
128 | #endif | ||
129 | |||
130 | find_peer_msg.header.size = htons(sizeof(struct GNUNET_DHT_FindPeerMessage)); | 116 | find_peer_msg.header.size = htons(sizeof(struct GNUNET_DHT_FindPeerMessage)); |
131 | find_peer_msg.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_FIND_PEER); | 117 | find_peer_msg.header.type = htons(GNUNET_MESSAGE_TYPE_DHT_FIND_PEER); |
132 | find_peer_handle->route_handle = | 118 | find_peer_handle->route_handle = |
133 | GNUNET_DHT_route_start (handle, key, 0, options, &find_peer_msg.header, | 119 | GNUNET_DHT_route_start (handle, key, |
120 | 0, options, | ||
121 | &find_peer_msg.header, | ||
134 | timeout, | 122 | timeout, |
135 | &find_peer_reply_iterator, find_peer_handle); | 123 | &find_peer_reply_iterator, find_peer_handle, |
124 | NULL, NULL); | ||
136 | GNUNET_break (find_peer_handle->route_handle != NULL); | 125 | GNUNET_break (find_peer_handle->route_handle != NULL); |
137 | return find_peer_handle; | 126 | return find_peer_handle; |
138 | } | 127 | } |