From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 24-JAN-1991 15:43:20.73
To:	MRGATE::"ARISIA::EVERHART"
CC:	
Subj:	VNEWS patch

Received:  by crdgw1.ge.com (5.57/GE 1.80)
	 id AA10759; Thu, 24 Jan 91 15:31:28 EST
Received: From UCBVAX.BERKELEY.EDU by CRVAX.SRI.COM with TCP; Thu, 24 JAN 91 09:07:45 PST
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA14284; Thu, 24 Jan 91 08:57:30 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 24 Jan 91 15:11:49 GMT
From: sunquest!alpha.sunquest.com!gavron@uunet.uu.net  (Ehud Gavron)
Organization: Sunquest VMS Internals, Tucson AZ
Subject: VNEWS patch
Message-Id: <24JAN91081149@alpha.sunquest.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com


           I use the VNEWS nntp-client for VMS with an ANU-news server
        at another site.  Recently, that site's manager upgraded his
        server and VNEWS broke.  Included below is the relevant info
        for those who may run into this problem.  Note that in any case
        the patch is not harmful.

        Ehud

---begin included text---
Date sent:  22-JAN-1991 22:36:44 

This mail message includes:
        - A Bug report on the new ANU-news NNTP server
        - A complementary failure on the part of the VNEWS CLIENT
        - A problem description
        - Relevant RFC quote
        - My personal opinion        <--- always a must in anything ;-)
        - Code fixes to VNEWS


Abstract:

        o There is a bug in the current ANU-News NNTP server
        o This bug causes VNEWS to hang when closing connection.

Symptoms: 
          - Last line says    Done:   and user has hit <return> or q <return>
          - I/O count is rapidly climbing
          - No xx.newsrc/xx.oldnewsrc update occurs

Analysis:
        Turns out that when VNEWS send a 'quit', ANU used to say 
        '205 Closing connection - goodbye!'.  It currently just 
        closes the connection.  Since VNEWS uses the RECV() function 
        and doesn't check for this possibility, it loops forever
        waiting for input.

RFC:
        RFC977 says that the "...server process acknowledges the QUIT
        command and then closes the connection to the client." (3.11.1)
        RFC977 suggests the text could be "205 closing connection - goodbye!"
        (3.11.2)  ANU is therefore in violation of the RFC by closing
        connection without sending the text first.

Comment:
        That response is superfluous to the VNEWS user.  There is no reason
        that he should see it.  Additionally, there is no response that 
        matters once a quit has been sent.  Therefore for all practical 
        purposes, we can close connection and do file update after sending 
        a quit.


Code Changes:(2)

(NEWS.FOR)OLD:

     $    ('Closing News server connection...', '|')
           Call SMG_All_Print (Buf(1:Lg), '|')

(NEWS.FOR)NEW:

     $    ('Closing News server connection...', '|')


(SRV.FOR)OLD:

C Begin Srv_Cmd

        Srv_Cmd = Srv_Send (Cmd)
        If (.not. Srv_Cmd) Then
          Return
        EndIf

        Srv_Cmd = Srv_Recv (Rsp, Lg)

(SRV.FOR)NEW:

C Begin Srv_Cmd

        Srv_Cmd = Srv_Send (Cmd)
        If (.not. Srv_Cmd) Then
          Return
        EndIf

        If (Cmd(1:4) .eq. 'quit') Return
        Srv_Cmd = Srv_Recv (Rsp, Lg)


---end included text---
Ehud

\----------------------------------------------------------------------------/
| Ehud Gavron, Systems analyst  | gavron@vesta.sunquest.com      (Internet)  |
| Sunquest Information Systems  | uunet!sunquest!gavron          (UUCP)      |
| 930 N. Finance Center Drive   | gavron@arizona                 (BITNET)    |
| Tucson, Arizona, 85710        | (602)722-7546/885-7700 x.2546  (AT&Tnet)   |
|----------------------------------------------------------------------------|
|  If the ISO people are emailing each other, it's probably over TCP/IP ;-)  |
|                                                             - Gary Malkin  |
/----------------------------------------------------------------------------\
        *** Ray Kaplan's office is always crowded ***

