Subject: ftpd's yyparse() routine
To: None <tech-userlevel@netbsd.org>
From: Aidan Cully <aidan@kublai.com>
List: tech-userlevel
Date: 08/27/2000 14:33:02
Readers of this list may remember that I'm working on reorganizing how
ftpd handles its I/O, to make it stop blocking, to better enable ABOR
to work with rfc2228 support. My code is starting to get ugly, and I'm
thinking a bit of a change in approach is needed... I'd like to change
ftpd's yyparse() routine to operate on a line at a time, and move all
socket input all out of the .y file. The end of the main() routine
would no longer look like:
for (;;)
(void) yyparse();
/* NOTREACHED */
but would instead look more like:
while ((poll_result = ftp_poll(&cmd_timeout)) >= 0)
continue;
if (poll_result == 0)
/* timeout on input. */
toolong();
exit(0);
ftp_poll would process all I/O (directly or not), and the handler
for input on the control channel would process telnet codes, and call
yyparse() for every line of data it receives.
Does this sound OK?
--aidan