Lines Matching defs:avail
132 size_t avail = pdu->max_size - token_options;
140 if (can_use_bert && blk_size == 6 && avail >= 1024 && session != NULL &&
145 block->chunk_size = (uint32_t)((avail / 1024) * 1024);
148 if (avail < block->chunk_size && (total - start) >= avail) {
153 if (avail < 16) { /* bad luck, this is the smallest block size */
157 new_blk_size = coap_flsll((long long)avail) - 5;
158 coap_log_debug("decrease block size for %zu to %d\n", avail, new_blk_size);
605 ssize_t avail;
724 avail = pdu->max_size - token_options;
726 avail -= coap_opt_encode_size(COAP_OPTION_ECHO, 40);
728 avail -= coap_oscore_overhead(session, pdu);
731 avail -= (pdu->actual_token.length < 8) ? 8 - pdu->actual_token.length : 0;
732 blk_size = coap_flsll((long long)avail) - 4 - 1;
759 if (avail < 16 && ((ssize_t)length > avail || have_block_defined)) {
780 } else if ((have_block_defined && length > chunk) || (ssize_t)length > avail) {
920 avail = pdu->max_size - token_options;
922 avail -= coap_opt_encode_size(COAP_OPTION_ECHO, 40);
924 avail -= (pdu->actual_token.length < 8) ? 8 - pdu->actual_token.length : 0;
926 avail -= coap_oscore_overhead(session, pdu);
928 if (avail < (ssize_t)chunk) {
930 if (avail < 16) {
934 blk_size = coap_flsll((long long)avail) - 4 - 1;