cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
2,863 Views
Registered: ‎01-24-2010

xapp1026 socket web server and simultaneous browser requests

For the xapp1026 web server demo, there seems to be a problem with browsers that request multiple files simultaneously. The web server works by reading individual files from an in-memory file system. When a browser requests a file, a new thread is spawned to transfer the requested file between the file system and the lwip socket. By default, Firefox 3.5.x will request up to 6 files simultaneously from a web server (this includes all javascript, css, and image files referenced by the main index.html file). It seems that the in-memory file system drivers provided by Xilinx (xilmfs library) are not inherently thread safe. Therefore, when a web browser requests multiple files simultaneously, the xapp1026 web server demo will crash. However, if you configure Firefox to only request one file at a time (about:config network.http.max-persistent-connections-per-server), the socket web server demo works correctly. If this is the case, the web server thread that serves files (function "do_http_get" in the code) should be modified to use a mutex to lock access to the in-memory file system.

It would be very helpful if a Xilinx engineer could verify this problem and add something to the troubleshooting section in the PDF app not.
Tags (2)
0 Kudos
1 Reply
Highlighted
Xilinx Employee
Xilinx Employee
2,853 Views
Registered: ‎01-18-2008

The scenario you explain sounds plausible. Although its been a while, if I remember correctly I did test it with Firefox, and did make sure that it handled  simultaneous requests properly. However, now that I think about it, I doubt xilmfs is thread safe, and so this sounds like a bug in the webserver code. I'll see if I can confirm it, and if it is an issue, we'll fix it in a subsequent release.
0 Kudos