Removed MAXSTATUS which was set incorrectly - thus causing tdb traversal
authorJeremy Allison <jra@samba.org>
Mon, 14 Jan 2002 19:34:28 +0000 (19:34 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 14 Jan 2002 19:34:28 +0000 (19:34 +0000)
of the connections db on smbd startup. This should fix the Solaris large
load bug.... (fingers crossed).
Jeremy.
(This used to be commit 5b2b9c25af28543e67762805d1387524cbb6c39d)

source3/include/local.h
source3/printing/printing.c
source3/smbd/connection.c
source3/smbd/server.c
source3/smbd/service.c

index da9fee056424652707c166be1f55e4768a7be3bd..c7abe207c8938dc01cb1b05d3ded2b66896059a3 100644 (file)
@@ -68,7 +68,8 @@
 #endif
  
 /* the max number of simultanous connections to the server by all clients */
-#define MAXSTATUS 100000
+/* zero means no limit. */
+#define MAXSTATUS 0
 
 #define WORDMAX 0xFFFF
 
index 08115cdb79cdf0082fdcdf527b7c6bdada1f49cb..339ca721c648dfa6869179e058fd1527fc71e748 100644 (file)
@@ -507,15 +507,13 @@ void start_background_queue(void)
                /* Child. */
                DEBUG(5,("start_background_queue: background LPQ thread started\n"));
 
-               claim_connection(NULL,"smbd lpq backend",MAXSTATUS,False);
+               claim_connection(NULL,"smbd lpq backend",0,False);
 
-               if (!locking_init(0)) {
+               if (!locking_init(0))
                        exit(1);
-               }
 
-               if (!print_backend_init()) {
+               if (!print_backend_init())
                        exit(1);
-               }
 
                message_register(MSG_PRINTER_UPDATE, print_queue_receive);
                
index c0eaf8187dbedbac391608172b3b124e2e4afb88..da904e0a04a33c44cf0d24b96791392243147269 100644 (file)
@@ -37,7 +37,7 @@ TDB_CONTEXT *conn_tdb_ctx(void)
  Delete a connection record.
 ****************************************************************************/
 
-BOOL yield_connection(connection_struct *conn,char *name,int max_connections)
+BOOL yield_connection(connection_struct *conn,char *name)
 {
        struct connections_key key;
        TDB_DATA kbuf;
index b8e9c2beae141f0df1b531d9654eb3bff699937d..330feece916958cc73e848811fadb6db7874731b 100644 (file)
@@ -494,7 +494,7 @@ void exit_server(char *reason)
        invalidate_all_vuids();
 
        /* delete our entry in the connections database. */
-       yield_connection(NULL,"",MAXSTATUS);
+       yield_connection(NULL,"");
 
        respond_to_all_remaining_local_messages();
        decrement_smbd_process_count();
@@ -812,7 +812,7 @@ static void usage(char *pname)
        register_dmalloc_msgs();
 
        /* Setup the main smbd so that we can get messages. */
-       claim_connection(NULL,"",MAXSTATUS,True);
+       claim_connection(NULL,"",0,True);
 
        /* 
           DO NOT ENABLE THIS TILL YOU COPE WITH KILLING THESE TASKS AND INETD
@@ -828,21 +828,17 @@ static void usage(char *pname)
         * everything after this point is run after the fork()
         */ 
 
-       if (!locking_init(0)) {
+       if (!locking_init(0))
                exit(1);
-       }
 
-       if (!print_backend_init()) {
+       if (!print_backend_init())
                exit(1);
-       }
 
-       if (!share_info_db_init()) {
+       if (!share_info_db_init())
                exit(1);
-       }
 
-       if(!initialize_password_db(False)) {
+       if(!initialize_password_db(False))
                exit(1);
-       }
 
        /* possibly reload the services file. */
        reload_services(True);
@@ -868,19 +864,16 @@ static void usage(char *pname)
        }
 
        /* Setup oplocks */
-       if (!init_oplocks()) {
+       if (!init_oplocks())
                exit(1);
-       }
        
        /* Setup mangle */
-       if (!init_mangle_tdb()) {
+       if (!init_mangle_tdb())
                exit(1);
-       }
 
        /* Setup change notify */
-       if (!init_change_notify()) {
+       if (!init_change_notify())
                exit(1);
-       }
 
        smbd_process();
        
index 8218ca2dc51c82e7df693cba132e15c24b06b5a2..120868f24a423986596b9645de69c95f02c7e708 100644 (file)
@@ -588,9 +588,7 @@ connection_struct *make_connection(char *service, DATA_BLOB password,
                ret = smbrun(cmd,NULL);
                if (ret != 0 && lp_rootpreexec_close(SNUM(conn))) {
                        DEBUG(1,("root preexec gave %d - failing connection\n", ret));
-                       yield_connection(conn,
-                                        lp_servicename(SNUM(conn)),
-                                        lp_max_connections(SNUM(conn)));
+                       yield_connection(conn, lp_servicename(SNUM(conn)));
                        conn_free(conn);
                        *status = NT_STATUS_UNSUCCESSFUL;
                        return NULL;
@@ -619,7 +617,7 @@ connection_struct *make_connection(char *service, DATA_BLOB password,
                if (ret != 0 && lp_preexec_close(SNUM(conn))) {
                        DEBUG(1,("preexec gave %d - failing connection\n", ret));
                        change_to_root_user();
-                       yield_connection(conn, lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn)));
+                       yield_connection(conn, lp_servicename(SNUM(conn)));
                        conn_free(conn);
                        *status = NT_STATUS_UNSUCCESSFUL;
                        return NULL;
@@ -631,9 +629,7 @@ connection_struct *make_connection(char *service, DATA_BLOB password,
                         remote_machine, conn->client_address,
                         conn->connectpath,strerror(errno)));
                change_to_root_user();
-               yield_connection(conn,
-                                lp_servicename(SNUM(conn)),
-                                lp_max_connections(SNUM(conn)));
+               yield_connection(conn, lp_servicename(SNUM(conn)));
                conn_free(conn);
                *status = NT_STATUS_BAD_NETWORK_NAME;
                return NULL;
@@ -713,9 +709,7 @@ void close_cnum(connection_struct *conn, uint16 vuid)
            
        }
 
-       yield_connection(conn,
-                        lp_servicename(SNUM(conn)),
-                        lp_max_connections(SNUM(conn)));
+       yield_connection(conn, lp_servicename(SNUM(conn)));
 
        file_close_conn(conn);
        dptr_closecnum(conn);