lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] Problem with loading a website


From: Sergio R. Caprile
Subject: Re: [lwip-users] Problem with loading a website
Date: Fri, 12 Jan 2018 10:08:33 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

You need to understand that a browser "loading a website" is not actually a sequential process. A browser opens as many simultaneous connections as it can (in some cases you can limit this), so you will get many connection requests, many GETs, and you need to be able to satisfy that. The problem (I think) is that you are probably using statics and thinking of one connection, one file at a time, which is probably OK, or not, depending on the seek time of your media; and your "entire file read" operation is "not reentrant". Anyway, if "your filesystem" can't have more than one "file" open at the same time, or can't read from more than one "file" at a time, you need to be able to tell so to the using application and it must be able to cope with that. See the word '_custom' there ? That means you will develop strategies so your filesystem works with the web server, like limiting the number of simultaneous connections, delaying opening files, delaying read requests, etc. You can write a state machine there if you need to, providing state variables depend on the caller (e.g.: not static but in a structure passed as a parameter, like the file handler itself).

That opens at least two possibilities:
fs_file_extension can handle whatever you need to keep your internal state, like for example "waiting for other read to finish" enabling LWIP_HTTPD_FS_ASYNC_READ will give you the possibility to wait on a read. I didn't study this interface and can't give you further advice.




reply via email to

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