-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HTTP server] add feature to send large blocks (>150K in chunks) #12
Comments
About the device driver modification: A zero-copy implementation is needed to eliminate the memcpy(), but it exists only for the RX-side at this moment... |
the goal was not to remove memcpy (saddly) but to avoid modification of a used (by DMA) buffer
|
Etienne Cochard suggests these changes, to assosiate data with a connection
Add field to struct
struct http_client
{
uint16_t connectionID;
struct pico_socket sck;
void *buffer;
uint16_t buffer_size;
uint16_t buffer_sent;
char *resource;
uint16_t state;
uint16_t method;
char *body;
void user_data; <<<<<<<<<<<<<<<<<
};
Create two new functions
void pico_http_set_user_data(uint16_t conn, void* data)
{
struct http_client *client = find_client(conn);
if (!client)
{
dbg("Wrong connection ID\n");
return;
}
client->user_data = data;
}
void* pico_http_get_user_data(uint16_t conn)
{
struct http_client *client = find_client(conn);
if (!client)
{
dbg("Wrong connection ID\n");
return NULL;
}
}
in pico_f4x7_eth.c (https://github.com/tass-belgium/cyassl-picotcp/blob/master/src/pico_f4x7_eth.c)
int16_t f4x7_frame_push(ETH_HandleTypeDef *heth, uint8_t *buf, uint16_t len)
{
// if in use, avoid crashing the buffer
if ((heth->TxDesc->Status & ETH_DMATXDESC_OWN) != (uint32_t)RESET) <<< you should have added something like that before (this code is for discovery stm32F7 / i can give you the full source for this board)
return 0;
}
The text was updated successfully, but these errors were encountered: