Return-Path: cudep@csv.warwick.ac.uk
Received: from mutton.csv.warwick.ac.uk (cudep@mutton.csv.warwick.ac.uk [137.205.148.2]) by bosnia.pop.psu.edu (8.6.9/8.6.9) with ESMTP id FAA14768 for <barr@pop.psu.edu>; Thu, 2 Feb 1995 05:43:51 -0500
Date: Thu, 2 Feb 1995 10:43:16 GMT
From: Ian Dickinson <cudep@csv.warwick.ac.uk>
Message-Id: <10975.199502021043@mutton.csv.warwick.ac.uk>
Received: by mutton.csv.warwick.ac.uk
	id KAA10975; Thu, 2 Feb 1995 10:43:16 GMT
Newsgroups: news.software.nntp
Subject: INN1.4sec nntpin nolimit
References: <3g38p1$pqh@mutton.csv.warwick.ac.uk> <3g65hl$fom@rodan.uu.net> <3gj2if$627@mutton.csv.warwick.ac.uk>
Distribution: inet
Organization: Team Limpid - Computing Services, University of Warwick, UK
Apparently-To: barr@pop.psu.edu

In article <3gj2if$627@mutton.csv.warwick.ac.uk>,
	cudep@csv.warwick.ac.uk (Ian Dickinson) writes:
>In article <3g65hl$fom@rodan.uu.net>,
>	rsalz@uunet.uu.net (Rich Salz) writes:
>>In <3g38p1$pqh@mutton.csv.warwick.ac.uk> cudep@csv.warwick.ac.uk (Ian Dickinson) writes:
>>>I was trying to add the 'nntpin' UNIX-Domain socket to this list,
>>>and it looks like the code in RCreadlist() assumes AF_INET addresses,
>>>so this won't work.  Any ideas on how to make this work?
>>
>>Change NCreate so it takes an additional parameter indicating whether
>>this is a local connection or not; change the two calls in rc.c to
>>pass in FALSE, change lc.c to pass in TRUE, and change NCcreate like
>>this:
>>CHANNEL *
>>NCcreate(fd, MustAuthorize, IsLocal)
>>    int                 fd;
>>    BOOL                MustAuthorize;
>>    BOOL                IsLocal;
>>{
>>    ...
>>    /* See if we have too many channels. */
>>    if (!IsLocal && MaxIncoming && NCcount >= MaxIncoming && !RCnolimit(cp)) {
>
>I'll have a play with that - it seems straight forward enough.
>Will this make it into 1.5?  Is more likely if I send a patch? :-)

Works a treat!
Here's a patch for anyone who doesn't like doing their own editing:

*** lc.c.ORIG	Fri Jan 29 16:51:29 1993
--- lc.c	Thu Feb  2 09:39:46 1995
***************
*** 33,39 ****
  	syslog(L_ERROR, "%s cant accept CCreader %m", LogName);
  	return;
      }
!     new = NCcreate(fd, FALSE);
      new->Address.s_addr = MyAddress.s_addr;
      syslog(L_NOTICE, "%s connected %d", "localhost", new->fd);
  }
--- 33,39 ----
  	syslog(L_ERROR, "%s cant accept CCreader %m", LogName);
  	return;
      }
!     new = NCcreate(fd, FALSE, TRUE);
      new->Address.s_addr = MyAddress.s_addr;
      syslog(L_NOTICE, "%s connected %d", "localhost", new->fd);
  }
*** nc.c.ORIG	Thu Mar 18 21:04:28 1993
--- nc.c	Thu Feb  2 09:54:03 1995
***************
*** 1011,1019 ****
  **  Create an NNTP channel and print the greeting message.
  */
  CHANNEL *
! NCcreate(fd, MustAuthorize)
      int			fd;
      BOOL		MustAuthorize;
  {
      register CHANNEL	*cp;
      int			i;
--- 1011,1020 ----
  **  Create an NNTP channel and print the greeting message.
  */
  CHANNEL *
! NCcreate(fd, MustAuthorize, IsLocal)
      int			fd;
      BOOL		MustAuthorize;
+     BOOL		IsLocal;
  {
      register CHANNEL	*cp;
      int			i;
***************
*** 1042,1048 ****
      }
  
      /* See if we have too many channels. */
!     if (MaxIncoming && NCcount >= MaxIncoming && !RCnolimit(cp)) {
  	/* Recount, just in case we got out of sync. */
  	for (NCcount = 0, i = 0; CHANiter(&i, CTnntp) != NULL; )
  	    NCcount++;
--- 1043,1049 ----
      }
  
      /* See if we have too many channels. */
!     if (!IsLocal && MaxIncoming && NCcount >= MaxIncoming && !RCnolimit(cp)) {
  	/* Recount, just in case we got out of sync. */
  	for (NCcount = 0, i = 0; CHANiter(&i, CTnntp) != NULL; )
  	    NCcount++;
*** rc.c.ORIG	Thu Mar 18 21:04:31 1993
--- rc.c	Thu Feb  2 09:40:06 1995
***************
*** 188,196 ****
  
      /* If not a server, and not allowing anyone, hand him off. */
      if (i >= 0)
! 	new = NCcreate(fd, rp->Password[0] != '\0');
      else if (AnyIncoming)
! 	new = NCcreate(fd, FALSE);
      else {
  	RChandoff(fd, HOnntpd);
  	if (close(fd) < 0)
--- 188,196 ----
  
      /* If not a server, and not allowing anyone, hand him off. */
      if (i >= 0)
! 	new = NCcreate(fd, rp->Password[0] != '\0', FALSE);
      else if (AnyIncoming)
! 	new = NCcreate(fd, FALSE, FALSE);
      else {
  	RChandoff(fd, HOnntpd);
  	if (close(fd) < 0)

Cheers,
-- 
Ian 'Vato' Dickinson [ID17]                                   Kibo bait :-)
cudep@csv.warwick.ac.uk  ...!uknet!warwick!cudep           vato@spuddy.uucp
           MIME mail welcome - don't send me no steenkin' X.400
      Click <A HREF="http://www.csv.warwick.ac.uk/~cudep/">here</A>.
