There was one extra byte sent in last chunk which caused
this error to be printed by curl
* Illegal or missing hexadecimal sequence in chunked-encoding
* stopped the pause stream!
* Closing connection 0
curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit creates a websocket library that can be used by
applications. The websocket library implements currently only
server role and it uses services provided by net-app API.
The library supports TLS if enabled in configuration file.
This also adds websocket calls to HTTP app server if websocket
connection is established.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
net_app_ctx maintains multiple net contexts(net_ctx). But when http
api's wants to reply or send some data, its always choose the first
net_context in the array, which is not correct always.
net_app_get_net_pkt_with_dst() api will select proper context
based on destination address. So with the help of new api in
net_app, http can select proper context and send packets. To
achieve this, desination address is provided in http_recv_cb_t
and http_connect_cb_t callbacks. Also chaged relevant API's to
provide destination address in http message preparation methods.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
In commit 9489fa54cc ("net: http: Fix http_prepare_and_send"),
the logic for when to call http_send_flush() was incorrect. This
is causing a call to http_send_flush() every time
http_prepare_and_send() is called.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
net_pkt_append() has been changed. If payload reached max value
of 'data_len' in net packet, net_pkt_append will not append.
So the caller has to create new packet and append remaining payload.
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
The global mbedtls heap is set automatically now so no need to
set it individually in the http library.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This is done so that both http_client and http_server functionality
can share the same heap.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>