NetProg Spring 2003 HW2

Homework #2 FAQ

Question:

What languages can we use for HW2 ?

Answer:

C or C++ (not Java!).

   
Question:

Is there a maximum URI size? If not, how do we know how large a URI to expect?

Answer:

No, there is no "maximum size" for URIs. You can decide on what constitutes "too large" and refuse to process any URI that exceeds this length (check out status code "414 Request-URI too long"). I'd suggest using something like 2000 characters max (this should handle any legitimate request). In all cases you need to make sure that there is no possibility of a buffer overflow, so you do need to worry about URIs that exceed whatever length you decide to support (but you don't have to be able to process them).

   
Question:

At the top of the homework assignment it says: "the code you submit must be written by you." In the Deliverables section it says "If any of your code was written by someone else, you are required to tell us about it (this must also be documented in the code itself).

Which is it?

Answer:

Sorry for the confusion

You are not allowed to submit a proxy server that was not written by you. You are not allowed to find a proxy server and modify it and submit it as your own.

You can use code that provides some needed functions (such as wrappers, URL parsers, etc.) that come from external sources such as the textbook, class notes, class sample code, the WWW (but not from other students). You must document all uses of such code.

   
Question:

Can we assume that argv[2], argv[3], .... don't have www. and http in them ? just the name and .com ?

For example, are these invalid:?

   http://www.yahoo.com
   www.yahoo.com
   http://yahoo.com

Answer:

You should expect valid domain names. "http://" is not part of a valid domain name (it's part of a URL/URI).

You should not make any assumptions about the domain names you are given, for example if we give you "www.yahoo.com" you should block everything from "www.yahoo.com" and from "foo.www.yahoo.com" but not block things from "blah.yahoo.com". Do not think you need to find the domain of a name we give you, you are being given a domain (and you should not care whether it represents a single machine or an entire hierarchy of machines.