can we have an example of one of your long functions as to what it does?Sure. main() in http://www.freebsd.org/cgi/cvsweb.cgi/src/usr.sbin/portsnap/... is over 400 lines long, and it
* Looks up a server's DNS entries,
* Connects to the server (trying multiple addresses if necessary),
* Constructs HTTP requests and sends them to the server,
* If less than one HTTP request is pending, blocks until it can finish writing a request,
* Reads HTTP response headers,
* Reads an HTTP response body and writes the data to disk,
* Prints a status line,
* if the server sent an HTTP/1.1 response, loops back to the top to continue sending more requests and reading more responses using the same TCP connection,
* and if the connection broke, closes it and loops back to the top to open a new connection and continue downloading.
I separated out the bits which could usefully be put into their own functions (e.g., constructing an HTTP request, or reading a \r\n terminated line from a socket), but there was no point dividing up the rest.