Squid internals The FD interface (src/fd.c) A global array of fds - fd_state[SQUID_MAXFD] Each FD has a plethora of state Flags - open, close, closing, writing, eof .. Connection - local/remote port, ip address Description - type, desc IO callbacks - ready for read, write, timeout, close, defer, comm_write state Disk IO - pending write list (currently obselete) Statistics - bytes read/written, persistent connection uses Routines maintaining fd_state[] open a FD - fd_open(fd, type, desc) close a FD - fd_close(fd) update FD description - fd_note(fd, desc) update FD bytecount - fd_bytes(fd, len, type) read from FD - FD_READ_METHOD write to FD - FD_WRITE_METHOD