[cs631apue] HW#3 graded

Jan Schaumann jschauma at stevens.edu
Sun Nov 10 22:57:08 EST 2013


Hello,

I've just sent out grade for HW#3.  If you have not received a grade for
HW#3, please contact me asap.

A few common things you missed out on:

- support for IPv6

  By default, your server is supposed to listen on _all_ addresses on
  the host, including IPv6 (even if that may be limited to ::1 on Stevens
  systems).  Please make sure to research how to implement this.  If you
  have problems, post your code and questions to this list.

- many of you copy and pasted the usage statement from the PDF.  That
  adds non-ascii characters in your code like this:
      "usage: %s [â~H~Rdh] [â~H~Rc dir] [â~H~Ri address] [â~H~Rl file] [â~H~Rp port] di\n",

  Don't do that.  Keep your output (and code/comments) ascii. (More
  generally, copy and paste is a terrible idea when dealing with code.)

- input validation

  Anything the user provides must be assumed to be possibly dangerous,
  simply bogus at best.  The user will pass you "bacon" or "avocado" as
  arguments to "-p" or "-i" or come up with more nefarious ways of
  making your program misbehave.  Always check user provided data for
  validity!

- simultaneous client connections

  Make sure that your program can handle multiple simultaneous
  connections.  A webserver that can only handle one client at a time is
  not very useful.

- check your return values

  Seriously, why won't you believe me?  A function that _can_ fail,
  _will_ fail.  Don't call malloc(3) and use the result without checking
  it.  The same holds for pretty much any other function.

- review the example Makefiles from the last lecture

  For the final project, I expect a reasonably useful Makefile.

- consistent formatting

  Don't mix spaces and tabs; don't change brace placement etc.  Learn to
  use a code editor that can handle these things for you automatically
  so you don't have to waste time on it.

-Jan


More information about the cs631apue mailing list