From: sloane@kuhub.cc.ukans.edu (Bob Sloane)
Newsgroups: news.software.anu-news
Subject: Re: Help setting up outgoing NNTP feed
Date: 15 Dec 92 08:29:19 CST
Organization: University of Kansas Academic Computing Services

In article <17540@umd5.umd.edu>, easmwei@ube.ub.umd.edu writes:
> I am having trouble getting an outgoing NNTP feed working using NNTP_XMIT
> with UCX.

You probably need the following patch.
-- 
USmail: Bob Sloane, University of Kansas Computer Center, Lawrence, KS, 66045
E-mail: sloane@kuhub.cc.ukans.edu, sloane@ukanvax.bitnet, AT&T: (913)864-0444 

Recently we commenced using Steve Bour's NNTP server for UCX (thanks Steve).
This has however revealed a bug in the UCX versions of NNTP_XMIT and
NNTP_XFER.  In both of these the open_net module incorrectly assigns port
119 to the _local_ device as well as the remote device.  The programs will
fail with Error: Connection lost, transfer aborted since port 119 is
already (correctly) in use by the NNTP server.

The correct code is to assign 0 (zero) as the port number and allow UCX to
find a free port.

The following diffs correct the error and modify the comments in the code
to correctly indicate what is happening.  These diffs are for 6.0-3 but
the nntp_xmit.c patch (at least) should be OK with some earlier releases.

Cheers.

- David


....................... cut here .....................
*** nntp_xmit.c;-1
--- nntp_xmit.c
**************
*** 17,22
  **    16th August 1990
  **    Numerous bug fixes & improvements: Bill Glass glass@vixvax.mgi.com
  **    Report on xfer rates: Earle Ake ake@dayton.saic.com
  **--
  */










--- 17,23 -----
  **    16th August 1990
  **    Numerous bug fixes & improvements: Bill Glass glass@vixvax.mgi.com
  **    Report on xfer rates: Earle Ake ake@dayton.saic.com
+ **    Fixed UCX local port bug: David Bellamy bellamy@commerce.uq.oz.au
  **--
  */










**************
*** 608,614
        sck_parm[0] = INET$C_TCP;
        sck_parm[1] = INET_PROTYP$C_STREAM;
        local_host.inet_family = INET$C_AF_INET;
!       local_host.inet_port = htons(NNTP_PORT);  /* dynamic port assignment */
        local_host.inet_adrs = get_local_adrs();
        lhst_adrs.lgth = sizeof local_host;
        lhst_adrs.hst = &local_host;
--- 609,615 -----
        sck_parm[0] = INET$C_TCP;
        sck_parm[1] = INET_PROTYP$C_STREAM;
        local_host.inet_family = INET$C_AF_INET;
!       local_host.inet_port = 0;  /* dynamic port assignment */
        local_host.inet_adrs = get_local_adrs();
        lhst_adrs.lgth = sizeof local_host;
        lhst_adrs.hst = &local_host;
**************
*** 615,621
        if (   (sys$qiow(0,net_chan,IO$_SETMODE,&read_iosb,0,0,&sck_parm,0,&lhst
_adrs,0,0,0) & 1)
            && (read_iosb.iostatus & 1)) {
          remote_host.inet_family = INET$C_AF_INET;
!         remote_host.inet_port = htons(NNTP_PORT);  /* dynamic port assignment
*/
          if (!(remote_host.inet_adrs = get_host_adrs(netobj))) {
            char *c, *cd, resnum[4];
            unsigned int indx = 0, *i;
--- 616,622 -----
        if (   (sys$qiow(0,net_chan,IO$_SETMODE,&read_iosb,0,0,&sck_parm,0,&lhst
_adrs,0,0,0) & 1)
            && (read_iosb.iostatus & 1)) {
          remote_host.inet_family = INET$C_AF_INET;
!         remote_host.inet_port = htons(NNTP_PORT);
          if (!(remote_host.inet_adrs = get_host_adrs(netobj))) {
            char *c, *cd, resnum[4];
            unsigned int indx = 0, *i;
*** nntp_xfer.c;-1
--- nntp_xfer.c
**************
*** 24,29
  **        2. Lower cases group names
  **        3. Uses the filename NNTP_nodename_SELECTIVE.BATCH instead of
  **           NNTP_nodename_grouplist.BATCH.
  **--
  **/










--- 24,30 -----
  **        2. Lower cases group names
  **        3. Uses the filename NNTP_nodename_SELECTIVE.BATCH instead of
  **           NNTP_nodename_grouplist.BATCH.
+ **      Fixed UCX local port bug: David Bellamy bellamy@commerce.uq.oz.au
  **--
  **/










**************
*** 420,426
        sck_parm[0] = INET$C_TCP;
        sck_parm[1] = INET_PROTYP$C_STREAM;
        local_host.inet_family = INET$C_AF_INET;
!       local_host.inet_port = htons(NNTP_PORT);  /* dynamic port assignment */
        local_host.inet_adrs = get_local_adrs();
        lhst_adrs.lgth = sizeof local_host;
        lhst_adrs.hst = &local_host;
--- 421,427 -----
        sck_parm[0] = INET$C_TCP;
        sck_parm[1] = INET_PROTYP$C_STREAM;
        local_host.inet_family = INET$C_AF_INET;
!       local_host.inet_port = 0;  /* dynamic port assignment */
        local_host.inet_adrs = get_local_adrs();
        lhst_adrs.lgth = sizeof local_host;
        lhst_adrs.hst = &local_host;
**************
*** 427,433
        if (   (sys$qiow(0,net_chan,IO$_SETMODE,&read_iosb,0,0,&sck_parm,0,&lhst
_adrs,0,0,0) & 1)
            && (read_iosb.iostatus & 1)) {
          remote_host.inet_family = INET$C_AF_INET;
!         remote_host.inet_port = htons(NNTP_PORT);  /* dynamic port assignment
*/
          if (!(remote_host.inet_adrs = get_host_adrs(netobj))) {
            char *c, *cd, resnum[4];
            unsigned int indx = 0, *i;
--- 428,434 -----
        if (   (sys$qiow(0,net_chan,IO$_SETMODE,&read_iosb,0,0,&sck_parm,0,&lhst
_adrs,0,0,0) & 1)
            && (read_iosb.iostatus & 1)) {
          remote_host.inet_family = INET$C_AF_INET;
!         remote_host.inet_port = htons(NNTP_PORT);
          if (!(remote_host.inet_adrs = get_host_adrs(netobj))) {
            char *c, *cd, resnum[4];
            unsigned int indx = 0, *i;
..................   end of diffs..............
--
David E. Bellamy              Email: bellamy@commerce.uq.oz.au
Dept. Commerce, University of Queensland, St. Lucia, AUSTRALIA
Newsgroups: news.software.anu-news