Bug in send_http_response_body
General
No replies yet. Be the first to reply.
Join the discussion.
General
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Bug in send_http_response_body
by Kei ·
Hi, Knut.
What exactly are you talking about?
As shown below, a smaller size than the buffer size was also transferred without any problems (WIZnet icon).
I think I am misunderstanding your intentions, so please explain the exact situation.
Thanks.
Best regard,
Kei
RE: Bug in send_http_response_body
by kschwi ·
Hi Kei,
this is the code from httpServer.c I downloaded: I just checked [url]https://github.com/Wiznet/WIZ550web/blob/master/WIZ550web_Firmware/WIZ550web_HW_Rev1.1/WIZ550web_App/src/Internet/httpServer/httpServer.c[/url] and even there it is the same. What I mean is the “///////…” part. This part copies the uri-name to the file name but only if the file is bigger than the transfer buffer. How do I get the file name for the first reading?
I got the problem while the SW reads the URL from the SD-card. I do not have a HW-flash, therefore I did not check this path.
[code]static void send_http_response_body(uint8_t s, uint8_t * uri_name, uint8_t * buf, uint32_t start_addr, uint32_t file_len)
{
…
/////////////////////////////////////////////////////////////////////////////////////////////////
// ## 20141219 Eric added, for ‘File object structure’ (fs) allocation reduced (8 → 1)
memset(HTTPSock_Status[get_seqnum].file_name, 0x00, MAX_CONTENT_NAME_LEN);
strcpy((char *)HTTPSock_Status[get_seqnum].file_name, (char *)uri_name);
#ifdef HTTPSERVER_DEBUG
printf(“> HTTPSocket[%d] : HTTP Response body - file name [ %s ]\r\n”, s, HTTPSock_Status[get_seqnum].file_name);
#endif
/////////////////////////////////////////////////////////////////////////////////////////////////
}
else
{
// Send process end
send_len = file_len;
#ifdef HTTPSERVER_DEBUG
printf(“> HTTPSocket[%d] : HTTP Response end - file len [ %ld ]byte\r\n”, s, send_len);
#endif
}
[/code]
Cheers,
Knut
RE: Bug in send_http_response_body
by Kei ·
First, there is a reason to store uri in a separate structure for data larger than the buffer size.
When a request comes from a client in the idle state, it responds immediately.
That is, for a response that does not exceed the buffer size, the response state is completed by that processing.
On the other hand, for responses that exceed the buffer size, you must send them multiple times.
For this reason, the module is to save the uri that was being sent to a special structure to remember.
(That’s why wrote the code ///// )
Best regard,
Kei.