httpserver is a multithreaded http server that runs on localhost and serves atomic file requests from multiple clients. The server distributes work amongst threads by using a work queue and it coherently logs the order of requests. It implements two standard http methods (PUT and GET)
GEThttpserverrecieves an object name and sends back the contents of that object to the client
PUThttpserverrecieves an object name and data content. It writes the data into the specified object if it exists, otherwise it creates it
-
200 OK- this response is sent to clients over the connection when a
GET,PUT, orAPPENDrequest is completed successfully
- this response is sent to clients over the connection when a
-
201 CREATED- this response is sent to clients over the connection when a
PUTrequest is successful and it created the requested file
- this response is sent to clients over the connection when a
-
400 BAD REQUEST- this response is sent to clients over the connection when their request is ill formatted or missing necessary header fields
-
403 FORBIDDEN- this response is sent to clients over the connection when the file they requested is not accessible (access permissions)
-
404 FILE NOT FOUND- this response is sent to clients over the connection when the file they requested on a
GETorAPPENDdoes not exist
- this response is sent to clients over the connection when the file they requested on a
-
500 INTERNAL SERVER ERROR- this response is sent to clients over the connection when an error is encountered within the functionality of the server
-
501 NOT IMPLEMENTED- this response is sent to clients over the connection when the method they requested is not implemented or does not exist
$ make $ make all
$ ./httpserver <portnumber> -t <threads> -l <logfile>
* portnumber: binding port for httpserver to listen for requests and serve them
* -t <threads>: number of threads running in the httpserver
* -l <logfile>: specifies a logfile for output
$ make format
$ make clean
httpserverdoes not work across different networkshttpserverignores most header fields (ex: hostname)httpserveronly supports 2 standard http methods (PUTandGET)httpserveris not completely "coherent" or "atomic" in logging
you know who you are if you shouldn't be looking at this peeps. As Bookroo once said "The consequences of every act are included in the act itself."