| Question:   | Can you point me to a good testing client? | |
| Answer:   | Check out the apache benchmark program, installed as
man -M /usr/apache/man ab | |
|   | ||
| Question:   | I handle the zombie processes just like the book does. But on SUN workstation, the program only terminates the first child (the message is printed). New children after the first one seem to become zombies and the program does nothing about them. I tried the exactly same code on monica (FreeBSD). Everything on monica was perfect. Is there anything specific to SUN I can do? | |
| Answer:   | You have to be careful when using the old style signal handling
function signal. On some operating systems (Solaris is
one example), you need to re-assert the signal handler every time the
signal is received. So on a Sun, if you are using signal
(instead of the POSIX signal handling functions) you need to call
signal at the end of the signal handler you install for
SIGCHLD. On Solaris you can actually handle zombies by simply doing
this:
signal(SIGCHLD,SIG_IGN); This tells the OS to ignore SIGCHLD and to take care of zombies (it handles everything for you). The book does sortof mention this issue, although it's not real clear, and easy to miss since the book's wrapper for signal (the Signal function) is actually using the POSIX signal handling functions (and avoids the re-assert issue). | |
|   | ||
| Question:   | Is our server supposed to connect to a "real server" to get documents, or just send back local files? | |
| Answer:   | Just local files - you do not need to contact any web servers. You should
expect a request-line that looks like GET /foo.gif HTTP/1.0, not
GET /www.rpi.edu/foo.gif HTTP/1.0 | |
|   | ||
| Question:   | Help - text works fine (HTML) but images don't work! | |
| Answer:   | Here are a few common problems:
| |
|   | ||
| Question:   | The sample threaded server code (chat server) doesn't call pthread_detach() or set the thread state to detached when creating new threads - isn't this suppose to happen (since your threads are never "joined")? | |
| Answer:   | Yes - this should happen. The code now includes a call to pthread_detach(pthread_self()) inside the function each thread runs. | |
|   | ||
| Question:   | How do I find out how big a file is (so I can send a content-length header)? | |
| Answer:   |
Use the stat() system call. Here is an example:
| |
|   | ||
| Question:   | What is a zombie process, and how do I avoid generating them? | |
| Answer:   | Check out chapter 5 of the text. | |