3 Jan 2003 joshb   » (Journeyer)

I spent a couple of hours today working on a new daemon mode for prtunnel. There's one daemon process that listens for new connections; when a connection is made, it forks a child process to handle the connection and the daemon process goes back to listening.

The only trouble I had was with waiting for the daemon's children after they're done. The first working solution I had was to make the bound socket non-blocking, put the accept(2) call in a loop, and, when no connection is returned, do a waitpid(2) and usleep a bit inside the loop. That was just too bad of a hack. The current solution is to use a SIGCHLD handler to waitpid(2) and have the accept(2) call loop when it's interrupted. This seems to work OK and will probably be in the next release.

That's it for tonight as far as coding goes. Happy new year, everyone!

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!