* have liked an answer to the request
* @param pr handle to the original pending request
* @param expiration when does 'data' expire?
+ * @param type type of the block
* @param data response data, NULL on request expiration
* @param data_len number of bytes in data
*/
handle_p2p_reply (void *cls,
struct GSF_PendingRequest *pr,
struct GNUNET_TIME_Absolute expiration,
+ enum GNUNET_BLOCK_Type type,
const void *data,
size_t data_len)
{
pr));
return;
}
+ GNUNET_break (type != GNUNET_BLOCK_TYPE_ANY);
+ if ( (prd->type != type) &&
+ (prd->type != GNUNET_BLOCK_TYPE_ANY) )
+ {
+ GNUNET_break (0);
+ return;
+ }
#if DEBUG_FS
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Transmitting result for query `%s'\n",
pm = GNUNET_malloc (sizeof (msize));
pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
pm->header.size = htons (msize);
- pm->type = htonl (prd->type);
+ pm->type = htonl (type);
pm->expiration = GNUNET_TIME_absolute_hton (expiration);
memcpy (&pm[1], data, data_len);
(void) GSF_peer_transmit_ (cp, GNUNET_NO,
*
* @param cls user-specified closure
* @param pr handle to the original pending request
- * @param expiration when does 'data' expire?
+ * @param expiration when does 'data' expire?
+ * @param type type of the block
* @param data response data, NULL on request expiration
* @param data_len number of bytes in data
*/
client_response_handler (void *cls,
struct GSF_PendingRequest *pr,
struct GNUNET_TIME_Absolute expiration,
+ enum GNUNET_BLOCK_Type type,
const void *data,
size_t data_len)
{
GNUNET_break (0);
return;
}
+ prd = GSF_pending_request_get_data_ (pr);
+ GNUNET_break (type != GNUNET_BLOCK_TYPE_ANY);
+ if ( (prd->type != type) &&
+ (prd->type != GNUNET_BLOCK_TYPE_ANY) )
+ {
+ GNUNET_break (0);
+ return;
+ }
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# replies received for local clients"),
1,
GNUNET_NO);
- prd = GSF_pending_request_get_data_ (pr);
GNUNET_assert (pr == cr->pr);
lc = cr->lc;
msize = sizeof (struct PutMessage) + data_len;
pm = GNUNET_malloc (msize);
pm->header.type = htons (GNUNET_MESSAGE_TYPE_FS_PUT);
pm->header.size = htons (msize);
- pm->type = htonl (prd->type);
+ pm->type = htonl (type);
pm->expiration = GNUNET_TIME_absolute_hton (expiration);
memcpy (&pm[1], data, data_len);
GSF_local_client_transmit_ (lc, &pm->header);
dpr->rh (dpr->rh_cls,
dpr,
GNUNET_TIME_UNIT_FOREVER_ABS,
+ GNUNET_BLOCK_TYPE_ANY,
NULL, 0);
GSF_pending_request_cancel_ (dpr);
}
pr->rh (pr->rh_cls,
pr,
prq->expiration,
+ prq->type,
prq->data, prq->size);
return GNUNET_YES;
case GNUNET_BLOCK_EVALUATION_OK_DUPLICATE:
pr->rh (pr->rh_cls,
pr,
prq->expiration,
+ prq->type,
prq->data, prq->size);
return GNUNET_YES;
}
* @param cls user-specified closure
* @param pr handle to the original pending request
* @param expiration when does 'data' expire?
+ * @param type type of the block
* @param data response data, NULL on request expiration
* @param data_len number of bytes in data
*/
typedef void (*GSF_PendingRequestReplyHandler)(void *cls,
struct GSF_PendingRequest *pr,
struct GNUNET_TIME_Absolute expiration,
+ enum GNUNET_BLOCK_Type type,
const void *data,
size_t data_len);