dewar@.ucalgary.ca (Alan Dewar) (10/19/88)
We are running Bnews version 2.11 (patch level 14) at our site, and are having problems with nntp. Specifically, (1) the readnews `s' command does not work, and (2) readnews occasionally hangs for no apparent reason. I have pursued these problems, and can see why they occur (details below); has anyone else encountered these problems, and if so, what solutions have been implemented? We have a network of Suns, one of which is the main spool machine and the rest of which get their news from that machine via nntp. Everything works fine on the spool machine. All other machines exhibit the problems mentioned above. This behavior seems to be a result of what is done by getnextart, in readr.c. (1) getnextart calls getarticle (in nntp.c), creating a temporary file /tmp/nsart.?????? which contains the article to be read next. So far, so good. However, the last thing getnextart does before returning is to delete the temporary file. The article can still be printed, since this is done via the stream `fp', opened before the file was deleted. The catch is that the save routine (in rfuncs2.c) expects to open the file again. When it can't do that, it complains: "Can't get article." (2) Whenever getnextart decides to skip an article (e.g., because it was posted to multiple groups), it fails to delete the temporary file. This becomes a problem when mktemp runs out of letters of the alphabet to stick in front of the process id to create a unique name. getarticle then returns NULL, causing getnextart to think it has encountered a bad article. That article, and ALL remaining articles, get marked as read and the user never sees them, unless he's fortunate enough to kill readnews before it manages to update his .newsrc. An "obvious" fix to these problems is to have getnextart delete the old file immediately before it creates a new one, rather than just before it returns, and to have xxit (in readr.c) delete the file `article_name()'. That would make `s' work, and would prevent an accumulation of temporary files which are never again used, but it would mean that `s-' would not behave correctly. Trying to save the previous article would result in actually saving the current article, since the file name would be the same! Has anybody got a working version of this? If so, how does it differ from the above? Any and all suggestions would be greatly appreciated. Alan Dewar Computer Science Department, University of Calgary ..!alberta!calgary!dewar dewar@cpsc.ucalgary.ca