diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-03-25 11:02:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-03-25 11:02:34 +0000 |
commit | d0b14419851f070e0e6d2ab646e6fc0f4baa08c8 (patch) | |
tree | 08b04da9685e21d78c0fac672fb682729ea3f4b4 /src/fs/gnunet-service-fs_lc.c | |
parent | 8d9a9ab3714c070341acc2956c55bd039fcf9eaa (diff) | |
download | gnunet-d0b14419851f070e0e6d2ab646e6fc0f4baa08c8.tar.gz gnunet-d0b14419851f070e0e6d2ab646e6fc0f4baa08c8.zip |
fix
Diffstat (limited to 'src/fs/gnunet-service-fs_lc.c')
-rw-r--r-- | src/fs/gnunet-service-fs_lc.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_lc.c b/src/fs/gnunet-service-fs_lc.c index 5ceb7c2a5..3908b8a55 100644 --- a/src/fs/gnunet-service-fs_lc.c +++ b/src/fs/gnunet-service-fs_lc.c | |||
@@ -189,7 +189,8 @@ GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client) | |||
189 | * | 189 | * |
190 | * @param cls user-specified closure | 190 | * @param cls user-specified closure |
191 | * @param pr handle to the original pending request | 191 | * @param pr handle to the original pending request |
192 | * @param expiration when does 'data' expire? | 192 | * @param expiration when does 'data' expire? |
193 | * @param type type of the block | ||
193 | * @param data response data, NULL on request expiration | 194 | * @param data response data, NULL on request expiration |
194 | * @param data_len number of bytes in data | 195 | * @param data_len number of bytes in data |
195 | */ | 196 | */ |
@@ -197,6 +198,7 @@ static void | |||
197 | client_response_handler (void *cls, | 198 | client_response_handler (void *cls, |
198 | struct GSF_PendingRequest *pr, | 199 | struct GSF_PendingRequest *pr, |
199 | struct GNUNET_TIME_Absolute expiration, | 200 | struct GNUNET_TIME_Absolute expiration, |
201 | enum GNUNET_BLOCK_Type type, | ||
200 | const void *data, | 202 | const void *data, |
201 | size_t data_len) | 203 | size_t data_len) |
202 | { | 204 | { |
@@ -212,18 +214,25 @@ client_response_handler (void *cls, | |||
212 | GNUNET_break (0); | 214 | GNUNET_break (0); |
213 | return; | 215 | return; |
214 | } | 216 | } |
217 | prd = GSF_pending_request_get_data_ (pr); | ||
218 | GNUNET_break (type != GNUNET_BLOCK_TYPE_ANY); | ||
219 | if ( (prd->type != type) && | ||
220 | (prd->type != GNUNET_BLOCK_TYPE_ANY) ) | ||
221 | { | ||
222 | GNUNET_break (0); | ||
223 | return; | ||
224 | } | ||
215 | GNUNET_STATISTICS_update (GSF_stats, | 225 | GNUNET_STATISTICS_update (GSF_stats, |
216 | gettext_noop ("# replies received for local clients"), | 226 | gettext_noop ("# replies received for local clients"), |
217 | 1, | 227 | 1, |
218 | GNUNET_NO); | 228 | GNUNET_NO); |
219 | prd = GSF_pending_request_get_data_ (pr); | ||
220 | GNUNET_assert (pr == cr->pr); | 229 | GNUNET_assert (pr == cr->pr); |
221 | lc = cr->lc; | 230 | lc = cr->lc; |
222 | msize = sizeof (struct PutMessage) + data_len; | 231 | msize = sizeof (struct PutMessage) + data_len; |
223 | pm = GNUNET_malloc (msize); | 232 | pm = GNUNET_malloc (msize); |
224 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); | 233 | pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT); |
225 | pm->header.size = htons (msize); | 234 | pm->header.size = htons (msize); |
226 | pm->type = htonl (prd->type); | 235 | pm->type = htonl (type); |
227 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); | 236 | pm->expiration = GNUNET_TIME_absolute_hton (expiration); |
228 | memcpy (&pm[1], data, data_len); | 237 | memcpy (&pm[1], data, data_len); |
229 | GSF_local_client_transmit_ (lc, &pm->header); | 238 | GSF_local_client_transmit_ (lc, &pm->header); |