Lines Matching defs:length

73       size_t length;
83 if (coap_get_data(pdu, &length, &data)) {
84 if (block->m && (length % 1024) != 0) {
86 length - (length % 1024), length);
87 length -= length % 1024;
89 block->chunk_size = (uint32_t)length;
277 size_t length,
293 if (block2.num != 0 && length <= (block2.num << (block2.szx + 4))) {
296 length >> (block2.szx + 4));
306 coap_hash(data, length, etag);
323 res = coap_write_block_opt(&block2, COAP_OPTION_BLOCK2, response, length);
341 coap_encode_var_safe8(buf, sizeof(buf), length),
344 coap_add_block(response, length, data,
352 if (!coap_add_data(response, length, data)) {
360 coap_write_block_opt(&block2, COAP_OPTION_BLOCK2, response, length);
364 coap_encode_var_safe8(buf, sizeof(buf), length),
367 coap_add_block(response, length, data,
421 if ((!token && !lg_crcv->app_token->length) || (token &&
439 otoken->length,
500 pdu->actual_token.length));
599 size_t length,
648 if (length > MAX_BLK_LEN) {
650 length = MAX_BLK_LEN;
730 /* May need token of length 8, so account for this */
731 avail -= (pdu->actual_token.length < 8) ? 8 - pdu->actual_token.length : 0;
759 if (avail < 16 && ((ssize_t)length > avail || have_block_defined)) {
771 if (length >= block.num * chunk) {
773 if (chunk > length - block.num * chunk)
774 rem = length - block.num * chunk;
780 } else if ((have_block_defined && length > chunk) || (ssize_t)length > avail) {
790 pdu->body_length = length;
803 lg_xmit->length = length;
815 lg_xmit->b.b1.app_token = coap_new_binary(pdu->actual_token.length);
819 pdu->actual_token.length);
834 (unsigned int)length),
849 lg_xmit->b.b2.query = coap_new_string(query->length);
851 memcpy(lg_xmit->b.b2.query->s, query->s, query->length);
878 (unsigned int)length),
892 blk_size, lg_xmit->length))
915 pdu->actual_token.length;
916 lg_xmit->pdu.actual_token.length = pdu->actual_token.length;
923 /* May need token of length 8, so account for this */
924 avail -= (pdu->actual_token.length < 8) ? 8 - pdu->actual_token.length : 0;
948 if (rem > lg_xmit->length - block.num * chunk)
949 rem = lg_xmit->length - block.num * chunk;
975 if (!coap_add_data(pdu, length, data))
996 size_t length,
1010 length, data, release_func, app_ptr, 0, 0);
1024 size_t length,
1048 if (block.num != 0 && length <= (block.num << (block.szx + 4))) {
1051 length >> (block.szx + 4));
1059 if (block.num != 0 && length <= (block.num << (block.szx + 4))) {
1062 length >> (block.szx + 4));
1091 length);
1111 query, maxage, etag, length, data,
1336 coap_update_token(&p->pdu, p->app_token->length, p->app_token->s);
1388 coap_add_token(pdu, p->last_token->length, p->last_token->s);
1647 pdu->actual_token.length);
1681 ltoken_length = pdu->actual_token.length;
1712 block.m = lg_xmit->offset + chunk < lg_xmit->length;
1727 ltoken_length = block_pdu->actual_token.length;
1750 lg_xmit->length,
1801 block.m = lg_xmit->offset + chunk < lg_xmit->length;
1851 block.m = lg_xmit->offset + chunk < lg_xmit->length;
1912 token->length);
1937 request->actual_token.length));
1944 lg_xmit->b.b1.app_token->length))))
2035 size_t data_len = lg_xmit ? lg_xmit->length :
2069 lg_crcv->app_token = coap_new_binary(pdu->actual_token.length);
2074 memcpy(lg_crcv->app_token->s, pdu->actual_token.s, pdu->actual_token.length);
2086 coap_update_token(pdu, new_token->length, new_token->s);
2329 max_block = (p->length + chunk - 1)/chunk;
2400 out_pdu = coap_pdu_duplicate(&p->pdu, session, p->pdu.actual_token.length,
2403 out_pdu = coap_pdu_duplicate(&p->pdu, session, pdu->actual_token.length,
2411 coap_update_token(response, p->pdu.actual_token.length,
2434 block.m = (p->length - p->offset) >
2437 block.m = (p->offset + chunk) < p->length;
2448 if (!(p->offset + chunk < p->length)) {
2456 if (!(p->offset + chunk < p->length)) {
2479 p->length,
2585 size_t length = 0;
2595 coap_get_data_large(pdu, &length, &data, &offset, &total);
2597 pdu->body_total = length;
2634 if (length > block.chunk_size) {
2636 block.chunk_size, length);
2637 length = block.chunk_size;
2662 pdu->body_length = length;
2664 pdu->body_total = length + offset + (block.m ? 1 : 0);
2682 p->uri_path = coap_new_str_const(uri_path->s, uri_path->length);
2685 p->amount_so_far = length;
2723 pdu->actual_token.length);
2737 while (offset < saved_offset + length) {
2759 if (p->total_len < saved_offset + length) {
2760 p->total_len = saved_offset + length;
2762 p->body_data = coap_block_build_body(p->body_data, length, data,
2837 if (total > offset + length + block.m)
2840 pdu->body_total = offset + length + block.m;
2851 pdu->body_total = offset + length + block.m;
2936 if (lg_xmit->length) {
2941 data_len = (lg_xmit->length - offset) > blk_size ? blk_size :
2942 lg_xmit->length - offset;
3028 rcvd->actual_token.length));
3036 p->b.b1.app_token->length)))) {
3096 if (p->offset < p->length) {
3115 len = new_token->length;
3130 block.m = (p->length - p->offset) >
3133 block.m = (p->offset + chunk) < p->length;
3143 p->length,
3175 size_t length;
3195 if (coap_get_data(rcvd, &length, &data)) {
3202 rcvd->actual_token.length);
3206 for (i = 0; (bp < data + length) &&
3210 block.num = derive_cbor_value(&bp, data + length - bp);
3214 block.m = (block.num + 1) * chunk < p->length;
3233 p->length,
3269 coap_update_token(rcvd, p->b.b1.app_token->length,
3285 coap_block_build_body(coap_binary_t *body_data, size_t length,
3296 if (offset + length <= total && body_data->length >= total) {
3297 memcpy(&body_data->s[offset], data, length);
3309 coap_binary_t *new = coap_resize_binary(body_data, offset + length);
3313 memcpy(&body_data->s[offset], data, length);
3351 rcvd->actual_token.length));
3371 size_t length;
3379 /* length and data are cleared on error */
3380 (void)coap_get_data(rcvd, &length, &data);
3382 rcvd->body_total = length;
3402 if (have_block && (block.m || length)) {
3416 if (length > block.chunk_size) {
3418 block.chunk_size, length);
3419 length = block.chunk_size;
3424 if (size2 < (offset + length)) {
3426 size2 = offset + length + 1;
3428 size2 = offset + length;
3531 while (offset < saved_offset + length) {
3563 if (size2 < saved_offset + length) {
3564 size2 = saved_offset + length;
3566 p->body_data = coap_block_build_body(p->body_data, length, data,
3638 coap_update_token(rcvd, p->app_token->length, p->app_token->s);
3663 p->total_len : saved_offset + length;
3665 rcvd->body_length = saved_offset + length;
3681 coap_update_token(rcvd, p->app_token->length, p->app_token->s);
3721 coap_update_token(rcvd, p->app_token->length, p->app_token->s);
3753 coap_update_token(rcvd, p->app_token->length, p->app_token->s);
3785 size_t length;
3789 coap_get_data(rcvd, &length, &data);
3791 rcvd->body_total = block.num*chunk + length + (block.m ? 1 : 0);
3830 coap_update_token(rcvd, p->app_token->length, p->app_token->s);
3872 pdu->actual_token.length));
3881 coap_update_token(pdu, lg_crcv->app_token->length,
3894 coap_update_token(pdu, lg_xmit->b.b1.app_token->length,