Contents |
SO_REUSEADDR
option to allow the proxy to re-use an address that is already in use; look at the setsockopt
man page for more information
fputs
to send data to the client- it will work correctly for text data, but will likely fail to work correctly for binary data. Use the read/write fread/fwrite functions instead. Another possible cause for this problem could be that you have a single-threaded proxy, and it is missing subsequent HTTP requests while it is serving the request for the main page. Multi-threading is not required for this assignment- see the grading notes on the assignment page if you have questions.
GET /index.html HTTP/1.0
GET http://www.yahoo.com/index.html HTTP/1.0
realloc
man page for information on dynamically growing a buffer.