I'm writing a program for a small server (at least it started out small, but it's been going a lot better than I expected), and I'm adding support for more than just HTTP. I'm also gonna add CGI, etc... but before I do that, I need to build some precautions into the HTTP code so that it won't be too much of an upgrade to add things like FTP. HTTP request lines are of the form
(METHOD) (Encoded URL) (HTTP/1.?), so you can't quite easily write code to split this up using " " as a delimiter and make a 3-element array, and then get the protocol name from array[2]. Now do other protocol's requests follow the same pattern? I would've looked this up on w3.org but I could find much about FTP at all. (I'm also assuming that it is even possible to have a server function in both FTP and HTTP capacities, so if it isn't, please let me know before I make an even bigger fool of myself).