You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
client->buffer = NULL;
//client->state = HTTP_WAIT_DATA; << if you do that, for large static_data (HTTP_STATIC_RESOURCE), the memory will be allocated & copied on next line if server submit data....
client->state = (client->state == HTTP_SENDING_DATA) ? HTTP_WAIT_DATA : HTTP_WAIT_STATIC_DATA; << the code should have been like that
server.wakeup(EV_HTTP_SENT, client->connectionID);
}
}
}
The text was updated successfully, but these errors were encountered:
ref https://github.com/tass-belgium/picotcp-modules/blob/master/libhttp/pico_http_server.c#L867
void send_data(struct http_client client)
{
uint16_t length;
while (client->buffer_sent < client->buffer_size &&
(length = (uint16_t)pico_socket_write(client->sck, (uint8_t *)client->buffer + client->buffer_sent,
client->buffer_size - client->buffer_sent)) > 0 )
{
client->buffer_sent = (uint16_t)(client->buffer_sent + length);
server.wakeup(EV_HTTP_PROGRESS, client->connectionID);
}
if (client->buffer_sent == client->buffer_size && client->buffer_size)
{
/ send chunk trail /
if (pico_socket_write(client->sck, "\r\n", 2) > 0)
{
/ free the buffer */
if (client->state == HTTP_SENDING_DATA)
{
PICO_FREE(client->buffer);
}
}
The text was updated successfully, but these errors were encountered: