http_client_send_req doen't perform the callback function, using https support


christian tavares
 

Hello! 


I'm developing a library http_client. That library needs to download a flash image on the server and install the image on board.
However, I included https support on my library and now I can't download the flash image.  The function http_client_send_req doesn't call  the callback's function.
Below is how to call the start of http_client_init, http_client_set_tls and http_client_send_req:

RESULT_BUF_SIZEMBEDTLS_SSL_MAX_CONTENT_LEN (1500) 
#define HTTPS_STACK_SIZE (4096)
NET_STACK_DEFINE(HTTPS, https_stack, HTTPS_STACK_SIZE, HTTPS_STACK_SIZE);
NET_APP_TLS_POOL_DEFINE(ssl_pool, 10);
#define TCP_RECV_BUFFER_SIZE 1024 
#define APP_TIMEOUT K_SECONDS(10)

static u8_t https_result_buf[RESULT_BUF_SIZE];

ret = http_client_init(&ctx->http_client.http_ctx,
UPDATEHUB_SERVER,
UPDATEHUB_PORT, NULL,
APP_TIMEOUT);

ret = http_client_set_tls(&ctx->http_client.http_ctx,
https_result_buf,
RESULT_BUF_SIZE,
NULL,
NULL,
setup_cert,
NULL,
NULL,
&ssl_pool,
https_stack,
HTTPS_STACK_SIZE);

ret = http_client_send_req(&ctx->http_client.http_ctx,
   &ctx->http_client.req,
   install_update_cb ,
   ctx->http_client.tcp_buffer,
   TCP_RECV_BUFFER_SIZE, ctx,
   APP_TIMEOUT);

A timeout error occurs and the http_client_send_req function does not initialize my install_update_cb callback function.
I performed tests I realized that it can only get things from the size of https_result_buf (1500), but previously using HTTP, the install_update_cb function call occurred and the flash image in the size of (39000) was downloaded and stored on the card. Could someone help me how to solve my problem, and with https support hold the callback function call for items larger than https_result_buf?

For a better view I am sending the link from the library. The call occurs in function "updatehub_install_update"
https://github.com/OSSystems/zephyr/blob/master/subsys/updatehub/updatehub.c
github.com
zephyr - Primary GIT Repository for the Zephyr Project



Join devel@lists.zephyrproject.org to automatically receive all group messages.