Hi,
I'm actually coding a HTTP SERVER with these features :
- Identification of each field inside a CLIENT HTTP REQUEST (GET/POST ; User-Agent ; Accept-Language ; etc ...)
- Supports GET and POST requests with parsing of values passed by a FORM (only on ENCTYPE : "application/x-www-form-urlencoded" // "multipart/form-data" NON SUPPORTED)
- Basic AUTHENTICATION supported (ability to select on which directory : "/" or "/public")
- Supports HTTP STATUS CODES (200 ; 301 ; 400 ; 401 ; 404 ; can do more !)
- Serves files directly from SD/microSD card
- Identifies files existence (if not exist : HTTP ERROR CODE 404 is sent)
- Identifies files extensions and send MIME Types (Example : "Content-Type: image/gif")
- Gather the length of requested file to serve and send it (Example : "Content-Length: 853")
- Supports MIME types when answer to clients (HTTP FIELD "Content-Type")
- Can update values running in RAM (byte, integer, float, string) thru a FORM send
- Supports timeout on requests (avoiding Arduino's to stop code execution if bytes from client takes too long to come)
Ok ... so well, it runs really fine as for now, it consumes only a little more than 2 kB of RAM !
But, i have a big problem with ETHERNET library where i can't pass the "Client xxxx = server.available();" to a void called inside the one i initialize the Client.
I certainly lacks some knowledge on passing variables from one void to another, but usualy i don't have problems to do it !
Here i have !
I tried to initialize the client object sooner than inside the loop() (not in the setup(), well before like ip/mac/subnet/ etc ...) and i still have the problem happening.
The reason why i'm looking at a solution for this is that when a client is loading a page, if another request is made from the same client, the data going from the arduino to the client (1st request), appear on the 2nd request (even the HTTP code !!!).
It basically means that even if the W5100 module is able to supports 4 simultaneous connections, it is problematic to isolate them !
Do someone encountered the same problem ?
Thanks !