This project is to write a simple HTTP client in C or C++. Your program should be able to get a document from any http server and store the document in a local file. The document can be any type (including html, image, etc.). If the document is an html page, recursively downloading the hyperlinked web pages is not required. Your program should run as follows:
> httpclient URI myfile
where URI specifies the web document you want to download and myfile is the filename you want to store the document in.
You must be able to report errors to the standard output if error messages are received from the web server.
You must submit all the source code necessary for us to build and test your HTTP client. You must also include Makefile that can be used to build your server on the CS Unix workstations.
You must also include in your submission a file named README
that includes your name and a brief description of your submission, including
the name of each file submitted along with a one line description of what is in
the file. If your code is not complete, tell us what works and what doesn't. If
you are submitting code that does not compile, please tell us that as well. Finally, feel free to
include a description of any problems you had or anything else you think might
be helpful to us.
Your program will be tested to make sure it works properly - We should be able to download a web document using your client program and open the file using a web browser. We may check your program by comparing its result with the result obtained by wget. You must be able to report errors to the standard output if error messages are received from the web server.
Here is a rough breakdown of the grading:
| Get the web document correctly | 60% |
| Display error messages | 20% |
| Error handling, Style/Code structure, etc. | 20% |
NOTE: 20% of your homework grade depends on the how "well your code is written". These points include the following:
Error handling (check every system call for an error!).
Safe code (avoiding buffer overflow, etc).
How well we can understand your code. There is no required format for your code, there is no requirement like "you must have one comment for every 5 lines of code". Feel free to provide what ever level of commenting you believe is appropriate to make sure that other competent programmers could easily understand and make changes to your code.
IMPORTANT: It is not acceptable to write this project in a single function (or even just a couple of functions).
All project files must be submitted via handin command on any Unix machine in the department as follows:
> handin.360.2 5 file1 file2 file3 ...
Please make sure you submit all your source files not the object files. You can also zip the files using the following command first:
> tar cvzf hw5.tgz file1 file2 file3 ...
and submit the single zip file hw5.tgz. Before you submit this single file, please use the following command to check make sure you have everything in this zip file:
> tar tvzf hw5.tgz
Don't send compiled code! Please ask question if you don't understand any part of this project.