Generic HTTP server for KDE March 29, 2010Posted by Vitor Boschi in vitor-planetkde.
Some time ago I decided to write a file sharing app for kde, and then began hunting for some server already implemented in the libs. To my surprise, besides the fact that I found some HTTP server implementations (KGet, KTorrent and Amarok all use this in some way), none of them were suitable for my needs. Their main problem is the way these servers gets the content to be served: all data must be sent at once, within a single function call. This is great when you only serve small data, but I bet you wouldn’t like to serve a multi gigabyte (common case for my app) file using a server like them.
With no server in hands, I began my own implementation, which supports large transfers without eating all system memory. This is somewhat like file reading: you fetch just a small chunk of data at a time, process it, and only then you request more data. This is a bit harder than reading everything at once, but also a lot more scalable. So I got a working server and a working application (kpws, in playground -> utils), and the I found another application, Kepas, which does almost the same thing I just wrote.
This made me stop my own app for a while, because I think KDE will benefit from having a single HTTP server implementation , just like it have a client one, and I’d like to write it as a GSoC project, but first I need to gather some feedback from the other developers, specially the ones from the applications I cited here. Do you think this will improve security, performance, maintainability and code reuse? Would it be a good GSoC project?