|
From: | Trampas Stern |
Subject: | Re: [lwip-users] https mbed TLS lwip |
Date: | Wed, 19 Feb 2020 13:38:40 -0500 |
Does anyone have recommended configuration for https? I have the following and still having problems:#define MEM_SIZE 42 * 1024#define MEMP_NUM_TCP_PCB 20#define MEMP_NUM_TCP_PCB_LISTEN 10#define MEMP_NUM_TCP_SEG 100#define MEMP_NUM_FRAG_PBUF 6#define MEMP_NUM_PBUF 8#define PBUF_POOL_SIZE 20#define TCP_MSS 1460#define TCP_WND (10 * TCP_MSS)#define TCP_SND_BUF (10 * TCP_MSS)Maybe someone has an example lwipopts.h and config.h (for mbedtls) which works that I can compare?ThanksTrampasOn Wed, Feb 19, 2020 at 10:45 AM Trampas Stern <address@hidden> wrote:I will increase more...I am monitoring for alloc failures, but not seeing any.
altcp_mbedtls_state_t *
altcp_mbedtls_alloc(void *conf)
{
altcp_mbedtls_state_t *ret = (altcp_mbedtls_state_t *)mem_calloc(1, sizeof(altcp_mbedtls_state_t));
if (ret != NULL) {
ret->conf = conf;
}
if (NULL == ret)
{
ERROR("Malloc failed");
}
return ret;
}
void
altcp_mbedtls_free(void *conf, altcp_mbedtls_state_t *state)
{
LWIP_UNUSED_ARG(conf);
LWIP_ASSERT("state != NULL", state != NULL);
mem_free(state);
}
void *
altcp_mbedtls_alloc_config(size_t size)
{
void *ret;
size_t checked_size = (mem_size_t)size;
if (size != checked_size) {
/* allocation too big (mem_size_t overflow) */
ERROR("Alloc failed");
return NULL;
}
ret = (altcp_mbedtls_state_t *)mem_calloc(1, (mem_size_t)size);
return ret;
}On Wed, Feb 19, 2020 at 9:46 AM Simon Goldschmidt <address@hidden> wrote:Trampas Stern wrote:
> right now I have the following settings:
> #define MEM_SIZE 12 * 1024
> [..]
> It appears that I am getting handshake failures...
During runtime mbedTLS allocates hughe amounts of memory. Depending on your
configuration, this is routed to the lwIP heap (see altcp_tls_mbedtls_mem.c).
If so, this value is *much* too low!
The other values might be too low, too. Try to increase everything to the max
(that your system allows) and see how much you actually need by monitoring
lwip_stats.
Regards,
Simon
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |