Article View: news.software.nntp
Article #15196Re: INN on nonstandard port.
From: Steinar Haug
Date: Thu, 20 Feb 1997 00:00
Date: Thu, 20 Feb 1997 00:00
84 lines
3560 bytes
3560 bytes
[Joshua Goodall]
| I've been using 433 for internal news transports. I've found that running
| nnrpd from inetd is significantly faster, especially for newsreaders
| with broken implementations of the NNTP protocol (like netscrape). I guess
| it's just because inetd forks quicker. However you'll have slightly less
| control over nnrpd's response to high load periods. I haven't (yet)
| found this to be a problem.
|
| However if you change the constant NNTP_PORT in include/configdata.h
| then be sure to fix the port number when you call nntpsend, innxmit &
| friends to sites outside your transport control, e.g. nntpsend -P 119
I did it differently: Keep NNTP_PORT at 119, and introduce a '-P' option
to inndstart. Patch included below.
Steinar Haug, Nethelp consulting, sthaug@nethelp.no
----------------------------------------------------------------------
*** inndstart.c.orig Tue Dec 17 15:40:40 1996
--- inndstart.c Thu Feb 13 12:36:45 1997
***************
*** 60,65 ****
--- 60,67 ----
struct sockaddr_in server;
register int i;
register int j;
+ int argnext = 1;
+ u_short nntp_port = NNTP_PORT;
#if defined(SO_REUSEADDR)
int on;
#endif /* defined(SO_REUSEADDR) */
***************
*** 72,77 ****
--- 74,86 ----
(void)openlog("inndstart", L_OPENLOG_FLAGS, LOG_INN_PROG);
+ /* Any other options than -P <port> are passed to innd */
+ if (ac >= 3 && strncmp(av[1], "-P", 2) == 0) {
+ nntp_port = atoi(av[2]);
+ argnext += 2;
+ ac -= 2;
+ }
+
/* Make sure INND directory exists. */
if (stat(INNDDIR, &Sb) < 0 || !S_ISDIR(Sb.st_mode)) {
syslog(L_FATAL, "inndstart cant stat %s %m", INNDDIR);
***************
*** 98,104 ****
syslog(L_ERROR, "inndstart cant setsockopt %m");
#endif /* defined(SO_REUSEADDR) */
(void)memset((POINTER)&server, 0, sizeof server);
! server.sin_port = htons(NNTP_PORT);
server.sin_family = AF_INET;
server.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(i, (struct sockaddr *)&server, sizeof server) < 0) {
--- 107,113 ----
syslog(L_ERROR, "inndstart cant setsockopt %m");
#endif /* defined(SO_REUSEADDR) */
(void)memset((POINTER)&server, 0, sizeof server);
! server.sin_port = htons(nntp_port);
server.sin_family = AF_INET;
server.sin_addr.s_addr = htonl(INADDR_ANY);
if (bind(i, (struct sockaddr *)&server, sizeof server) < 0) {
***************
*** 118,124 ****
#else
argv[j++] = _PATH_INND;
argv[j++] = pflag;
! for (i = 1; av[i]; ) {
if (strncmp(av[i], "-p", 2) != 0)
argv[j++] = av[i++];
else
--- 127,133 ----
#else
argv[j++] = _PATH_INND;
argv[j++] = pflag;
! for (i = argnext; av[i]; ) {
if (strncmp(av[i], "-p", 2) != 0)
argv[j++] = av[i++];
else
Technical Details
Message-ID:
<5ei6l7$18b@verdi.nethelp.no>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<32e9cb09.7271914@news.southwest.com.au> <5cd22c$1vbo$1@news-feed.inet.tele.dk>Show Full Headers
Complete Article Headers
Message-ID: <5ei6l7$18b@verdi.nethelp.no> Subject: Re: INN on nonstandard port. Date: Thu, 20 Feb 1997 00:00:00 +0000 From: sthaug@nethelp.no (Steinar Haug) References: <32e9cb09.7271914@news.southwest.com.au> <5cd22c$1vbo$1@news-feed.inet.tele.dk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 220222518 Cache-Post-Path: newscache.uninett.no!unknown@verdi.nethelp.no Organization: Nethelp Consulting, Trondheim, Norway Newsgroups: news.software.nntp