afs-servers-use-rx-setnojumbo-interface-20020228
[openafs.git] / src / bozo / bosserver.c
index 3fdf45f..11c2717 100644 (file)
@@ -7,7 +7,11 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
+#include <afsconfig.h>
 #include <afs/param.h>
+
+RCSID("$Header$");
+
 #include <afs/stds.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -48,6 +52,9 @@ extern int BOZO_ExecuteRequest();
 extern int RXSTATS_ExecuteRequest();
 extern int afsconf_GetKey();
 extern struct bnode_ops fsbnode_ops, ezbnode_ops, cronbnode_ops;
+
+void bozo_Log();
+
 struct afsconf_dir *bozo_confdir = 0;  /* bozo configuration dir */
 static char *bozo_pid;
 struct rx_securityClass *bozo_rxsc[3];
@@ -481,7 +488,7 @@ static BozoDaemon() {
 
        /* see if we should do a restart */
        if (now > nextRestart) {
-           BOZO_ReBozo(0);     /* doesn't come back */
+           SBOZO_ReBozo(0);    /* doesn't come back */
        }
        
        /* see if we should restart a server */
@@ -662,9 +669,10 @@ char **envp;
     int noAuth = 0;
     struct ktc_encryptionKey tkey;
     int i;
-    pid_t      newSessionID;
     char namebuf[AFSDIR_PATH_MAX];
-
+#ifndef AFS_NT40_ENV
+    int nofork = 0;
+#endif
 #ifdef AFS_AIX32_ENV
     struct sigaction nsa;
 
@@ -742,6 +750,9 @@ char **envp;
            DoSyslog = 1;
            DoSyslogFacility = atoi(argv[code]+8);
        }
+       else if (strcmp(argv[code], "-nofork")==0) {
+           nofork = 1;
+       }
 #endif
        else if (strcmp(argv[code], "-enable_peer_stats")==0) {
            rx_enablePeerRPCStats();
@@ -762,6 +773,7 @@ char **envp;
            printf("Usage: bosserver [-noauth] [-log] "
                   "[-syslog[=FACILITY]] "
                   "[-enable_peer_stats] [-enable_process_stats] "
+                  "[-nofork] "
                   "[-help]\n");
 #else
            printf("Usage: bosserver [-noauth] [-log] "
@@ -805,6 +817,7 @@ char **envp;
     /* go into the background and remove our controlling tty */
 
 #ifndef AFS_NT40_ENV
+    if (!nofork)
     background();
 #endif /* ! AFS_NT40_ENV */
 
@@ -862,7 +875,7 @@ char **envp;
            bozo_Log("try the 'hostname' command\n");
            exit(1);
        }
-       bzero(tcell.hostAddr, sizeof(tcell.hostAddr));  /* not computed */
+       memset(tcell.hostAddr, 0, sizeof(tcell.hostAddr));      /* not computed */
        code = afsconf_SetCellInfo(bozo_confdir, AFSDIR_SERVER_ETC_DIRPATH, &tcell);
        if (code) {
            bozo_Log("could not create cell database in '%s' (code %d), quitting\n", AFSDIR_SERVER_ETC_DIRPATH, code);
@@ -897,9 +910,8 @@ char **envp;
     bozo_rxsc[2] = (struct rx_securityClass *) rxkad_NewServerSecurityObject(
                                         0, tdir, afsconf_GetKey, (char *) 0);
 
-    /* These two lines disallow jumbograms */
-    rx_maxReceiveSize = OLD_MAX_PACKET_SIZE;
-    rxi_nSendFrags = rxi_nRecvFrags = 1;
+    /* Disable jumbograms */
+    rx_SetNoJumbo();
 
     tservice = rx_NewService(/* port */ 0, /* service id */ 1, 
                  /*service name */ "bozo", /* security classes */ bozo_rxsc,
@@ -915,6 +927,7 @@ char **envp;
     rx_StartServer(1);     /* donate this process */
 }
 
+void
 bozo_Log(a,b,c,d,e,f)
 char *a, *b, *c, *d, *e, *f; {
     char tdate[26];