More serv.c cleanup

In anticipation of reworking this functionality (to support keep-alive)
the code for this section of the server has been lightly revised.