lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] httpd: how to redirect to a new address


From: Jan Menzel
Subject: Re: [lwip-users] httpd: how to redirect to a new address
Date: Tue, 20 Feb 2018 10:32:16 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 20.02.2018 9:00, address@hidden wrote:
> On 19.02.2018 23:18, Jan Menzel wrote:
[...]
>>     At present we use a very basic webserver that servers a different
>> page
>> (with HTTP status code 301) if the parameters update the ip address.
>> After sending out the last byte we change the ip address, so the server
>> is immediately listening on the new address.
> 
> That's not really correct. The tcp connection lasts at least a little
> longer as the http server knows. I think you'll get some kind of tcp
> connection errors when doing it that way. It might work, but it's better
> to wait a little longer and implement a delay in the browser, as
> Giuseppe already mentioned.
> 
I understand that closing a tcp connection takes some time. We've
decided to switch to lwip to get this correct now.
        How long is lwip depending on constant ip address settings? I'd rather
like to change the address at runtime e.g. using sys_timeout() then
reboot the entire system with all its peripheral components.
        Concerning the delay, I'd probably implement a Refresh meta tag to not
rely on js.

[...]
> 
> However, you can implement this by using custom files. When the returned
> file has FS_FILE_FLAGS_HEADER_INCLUDED set in its flags, httpd assumes
> file->data includes both the file data *and* all http headers. You are
> then free to send all headers you whish.
> 

Do you suggest to use LWIP_HTTPD_CGI_SSI in combination with
LWIP_HTTPD_CUSTOM_FILES to switch between two different files? So
without ip address change I return filea and with fileb?
        Many thanks for your help!

        Jan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]