[cs631apue] More questions for hw4

Jan Schaumann jschauma at stevens.edu
Sat Nov 12 19:39:27 EST 2011

afonsec1 <afonsec1 at stevens.edu> wrote:

> 	1. If IPv6 is enabled, should sws only accept IPv6 addresses and reject 
> IPv4 ones ? or can the user enters a IPv4 address (ie  and sws 
> should handle it even with IPv6b enabled?

You may choose how to handle this.  It is not uncommon for an
application to have IPv6 support enabled on an add-on basis rather than
making it the only accepted mode, but either way is fine.

You may also choose how to handle the case if the user does not pass
'-6' but gives an IPv6 address as an argument to '-i'.  You can either
have passing of an IPv6 address to '-i' imply '-6' or be an error if
'-6' was not specified.

> 	2. http://hoohoo.ncsa.uiuc.edu/cgi/  doesn't work.

Yes, that apparently was taken down "recently".  Look at
and http://www.citycat.ru/doc/CGI/overview/overview.html instead.

> For the CGI  functionality, you mention that any output is generated,
> but can you be  more specific on this? For the cgi scripts, what
> language do you want us  to use?

You are not writing a CGI script.  You are adding support to your
webserver to execute CGI scripts.

> 	3. Besides all requests, I do extra informational logging on debugging  
> mode, If the user uses option -l [file], do you want only requests in  
> the file?

'-l' will enable logging as described in the manual page.  No additional
information should be logged.

If you are in debugging mode, you may choose to print out additional

> 	4. For port numbers 0 to 65535, are there a valid range (like outside  
> of the well-known port numbers) that you want us to be? For example if  
> the user enters port 80, do you want us to reject the giving port?

Your program should not reject any valid port number.  80 is a perfectly
valid port number, as are 1, 8080, 1234, 65535.

> 	5. For the encryption mechanism, What is the behavior is the users  
> enable secure mode but fail to give the key?

That is an error.

> 	6. For hw4, do we need to support the GET and HEAD requests?

No, as in HW#4 you are not handling any requests whatsoever.  See below.

> 	7. In term of work, what is the difference between the final  project  
> and hw4? If we support all the command options functionalities, what do  
> we have left for the final project?

The requirements for HW#4 are described at:

That page notes that you do not implement any of the actual HTTP
handling in HW#4; all you do is fill in the framework.  That includes
initializing the program for all command-line options, but does not
include writing the actual connection handling.  All you do is accept
connections and invoke the 'sws_request' function, passing it the
connected socket.


More information about the cs631apue mailing list