Even more pbuf_header -> pbuf_add/remove_header replacements (also in strings)

This commit is contained in:
goldsimon
2017-08-08 20:51:57 +02:00
parent 07434aa73a
commit 991f751305
10 changed files with 19 additions and 21 deletions

View File

@@ -459,10 +459,8 @@ altcp_mbedtls_bio_recv(void *ctx, unsigned char *buf, size_t len)
}
return MBEDTLS_ERR_SSL_WANT_READ;
}
/* limit number of bytes to copy to fit into an s16_t for pbuf_header */
copy_len = (u16_t)LWIP_MIN(len, 0x7FFF);
/* limit number of bytes again to copy from first pbuf in a chain only */
copy_len = LWIP_MIN(copy_len, p->len);
copy_len = (u16_t)LWIP_MIN(len, p->len);
/* copy the data */
ret = pbuf_copy_partial(p, buf, copy_len, 0);
LWIP_ASSERT("ret == copy_len", ret == copy_len);

View File

@@ -472,7 +472,7 @@ lwiperf_tcp_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)
}
conn->next_num = 4; /* 24 bytes received... */
tmp = pbuf_remove_header(p, 24);
LWIP_ASSERT("pbuf_header failed", tmp == 0);
LWIP_ASSERT("pbuf_remove_header failed", tmp == 0);
}
packet_idx = 0;