Updates to my web server

By Danny Arends in Website
Posted at: 16 Jul 2013, 15:52, last edited: 16 Jul 2013, 15:53

Just a small post to keep people updated with the progress I've made on implementing my own web server in the D programming language. Also this BlogPost is also a test if It is still able to handle HTTP POST requests correctly. So what were these major changes? Because the exterior of the site still looks the same...

The previous version of the DaNode server had some major issues:

1) It would use too much memory when serving big files to clients, I fixed this by having a polymorphic PayLoad structure. This structure will either contain the data to send, or a filename of the file to send... based on a boolean in the structure it determines if it needs to send a File or the msg. This allows me to tightly control the amount of memory used when serving a 500 Mb file

2) There was no unified response structure, every response was different and only error pages generated by the server were done in a standard way. Now all functions dealing with responding back to the client update the response structure in a uniform way

3) The server process was responsible to end the connection with clients which were malfunctioning, this is now done by the server and the client thread itself.

4) We would get a segfault sometimes when we tried to convert a SysTime.init object to the real HTML time representation. This was an easy fix, but an important one none the less.

I've fixed all these issues in the new version and I will open-source the DaNode HTTP server when I finish the current work on:

A) Code cleaning and documentation.

B) Working keep-alive connections to allow browsers to do more requests on a single socket (currently the server closes all the connections after sending a single response)

Last modified: 16 Jul 2013, 15:53 | Edit