complicated because other parts of the server can add and remove themselves from the select (2) read and write mask, as needed.
Once the NNTP channel has been created for a
Processing the article is the largest single rou- First headers... Path: |LOCAL_PATH_PREFIX|rest of path... Second headers... |XREF_HEADER| |Article body. | This is a very fast way of writing the article to disk; it avoids extra memory copies, and is only possible because the entire article is kept in memory until the last moment. Future workRFC 977 follows the SMTP protocol for send-ing text: line are terminated with \r\n, a period is placed before all lines starting with a period, and data is terminated with a line consisting of a single period [Postel82]. Innd must scan the text of all articles it receives and convert them to standard UNIX format. On the transmission side, innxmit must read the articles a line at a time in order to add the extra data. If all newsreading is done via NNTP, then articles could be stored directly in NNTP for- mat, and innxmit could read and write the article in two system calls. The innd gains would not be as dramatic, but tests show it would still be somewhat measurable.
There is no NNTP ``TURN'' command, so that |
int RemoteReader(cp ) CHANNEL *cp; { int newfd; struct sockadr_in remote; int remsize; newfd = accept(cp ->fd, &remote, &remsize); if (InAccessFile(r emsocket)) CHANcreate(new fd, TYPEnntp, STATEgetcmd, NCreader, NCwritedone); else { ForkAndExec("n nrpd", newfd); close(newfd); } } int RemoteSetup() { int fd; fd = GetSocketBoundToNNTPPort(); CHANcreate(fd, TYPEremote, STATElisten, RemoteReader, NULL); }Figure 3 : Listening on an NNTP port