Date: Wed, 2 Apr 1997 16:16:46 +0200 From: Hinrich Eilts <eilts@tor.muc.de> To: freebsd-hackers@freebsd.org Subject: Server-site patch for nn-current Message-ID: <199704021416.QAA00255@odin.muc.de>
next in thread | raw e-mail | index | archive | help
Hello, if I tried to use nn (6.5.0) from ports on the same 2.2-FreeBSD PC as the NNTP server (INN-1.4sec) is located, it doesn't work (-> bug report in freebsd-bugs). The nn-current from ports will not use NNTP if running on the server what is unwanted in some cases (e.g. statistics). A small patch which is to be applied after the ports-patches "patch-a[abc]' add the ability to switch this behavior off, i.e. NNTP will be used regardless from nn running on NNTP server or remote. The nn-current will run on FreeBSD-2.2. Hinrich *** config.h.orig Wed Apr 2 15:43:55 1997 --- config.h Wed Apr 2 15:47:40 1997 *************** *** 56,61 **** --- 56,68 ---- #define NNTP_SERVER "/usr/local/lib/news/nntp_server" /* + * Define USE_NNTP_ON_SERVER if NNTP shall be used if nn is running on the + * nntp server itself. Else it will use direct access to files. + */ + + #define USE_NNTP_ON_SERVER + + /* * * Defining NO_NNTP_SERVER_READ causes NNTP to ignore the NNTP_SERVER * file for reading news but still allows the -R command to specify *** nntp.c.orig Wed Apr 2 15:43:40 1997 --- nntp.c Wed Apr 2 15:40:01 1997 *************** *** 175,180 **** --- 175,181 ---- * the rope. If he wants to hang himself, then let him! :-) * Let the user worry about keeping his .newsrc straight. */ + fprintf(stderr,"NNTP Server\n"); if ((cp = getenv("NNTPSERVER")) != NULL) { strncpy(nntp_server, cp, sizeof nntp_server); return 1; *************** *** 706,712 **** || find_server() #endif ) { ! nn_gethostname(host, sizeof host); tmp = gethostbyname(host); if (tmp) { strncpy(host, tmp->h_name, sizeof host); --- 707,716 ---- || find_server() #endif ) { ! #ifdef USE_NNTP_ON_SERVER ! use_nntp = 1; ! #else ! nn_gethostname(host, sizeof host); tmp = gethostbyname(host); if (tmp) { strncpy(host, tmp->h_name, sizeof host); *************** *** 718,724 **** } else { server_real_name = nntp_server; } ! use_nntp = (strcmp(host, server_real_name) != 0); } else { use_nntp = 0; } --- 722,729 ---- } else { server_real_name = nntp_server; } ! use_nntp = (strcmp(host, server_real_name) != 0); ! #endif } else { use_nntp = 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704021416.QAA00255>