Tour of a Session
The aim here is to provide a walkthrough of an FTP session, from start to
finish, in detail. This will help to know what the server is doing at a
given point during a session, and at what points modules are called upon to
do their magic during the handling of that session.
First, the server must be started. On startup, the server parses and handles
any command line options, initializes some subsystems, calls all registered
modules' initialization functions (if they registered one), parses the
configuration file(s), then readies itself to receive FTP client connection
requests.
server_loop()
fork_server()
- block SIGTERM, SIGCHLD, SIGUSR1, SIGUSR2 while it's forking
- parent closes the socket fd, adds the child to its maintained list of
children, then unblocks the signals
- child unblocks signals, registers handlers for SIGUSR1, SIGUSR2. Returns
default handler to SIGCHLD, ignores SIGHUP (good!)
- do reverse DNS lookups (twice?), set socket options
- find the server for this connection (IP vs DNS names,
FTP protocol limitations, DefaultServer), deallocate all other servers
(interesting...no cross-server communication allowed...cool!)
- assigns permanent_pool to session.pool (what the hell?)
- check for /etc/shutmsg
- check for
Author: $Author: castaglia $
Last Updated: $Date: 2003/01/02 17:39:36 $
© Copyright 2000-2003 TJ Saunders
All Rights Reserved