Open phalox opened 8 years ago
@robbinvandamme Can you have a look at this?
Haven't been working on the server, so I won't be able to take a "quick look" at this.
@WimLeflere I believe you're the right person to talk to. Could you have a look at this suggestion to see if it makes sense?
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->buffersize) { / send chunk trail _/ if (pico_socketwrite(client->sck, "\r\n", 2) > 0) { / free the buffer / if (client->state == HTTP_SENDING_DATA) { PICO_FREE(client->buffer); }
}