tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From G√ľnter Knauf <efl...@gmx.net>
Subject [PATCH] ./jk/native2/common/jk_worker_status.c - avoid printing NULL
Date Mon, 02 Feb 2004 17:04:21 GMT
Hi,
since the increment of shm->head->lbVer is protected it should also be avoided to print
a potential NULL value:

http://www.gknw.com/test/jk_worker_status.c.diff
=========================================================================
--- ./jk/native2/common/jk_worker_status.c.orig  Fri Oct 31 00:15:04 2003
+++ ./jk/native2/common/jk_worker_status.c       Mon Feb 02 17:47:48 2004
@@ -717,7 +717,7 @@
         }
     }
     /* Create a top section - not used currently */
-    s->jkprintf(env, s, "MXAgent: mod_jk\n" );
+    s->jkprintf(env, s, "MXAgent: mod_jk2\n" );
     s->jkprintf(env, s, "\n" );
     
     for( i=0; i < env->_objects->size( env, env->_objects ); i++ ) {
@@ -1004,9 +1004,12 @@
         /* Update the scoreboard's version - all other
            jk2 processes will see this and update
         */
-        if( shm!=NULL && shm->head!=NULL )
+        if( shm!=NULL && shm->head!=NULL ) {
             shm->head->lbVer++;
-        s->jkprintf(env, s, "Updated config %d", shm->head->lbVer  );
+            s->jkprintf(env, s, "Updated config version to %d\n", shm->head->lbVer
 );
+        } else {
+            s->jkprintf(env, s, "Update detected. No scoreboard.\n"  );
+        }
     }
     
 
@@ -1017,9 +1020,12 @@
         /* Update the scoreboard's version - all other
            jk2 processes will see this and update
         */
-        if( shm!=NULL && shm->head!=NULL )
+        if( shm!=NULL && shm->head!=NULL ) {
             shm->head->lbVer++;
-        s->jkprintf(env, s, "Updated config version to %d\n", shm->head->lbVer 
);
+            s->jkprintf(env, s, "Updated config version to %d\n", shm->head->lbVer
 );
+        } else {
+            s->jkprintf(env, s, "Reload requested. No scoreboard.\n"  );
+        }
         return JK_OK;
     }
 
Guenter.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message