tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r611672 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp_common.c jk_ajp_common.h jk_lb_worker.c
Date Sun, 13 Jan 2008 23:19:29 GMT
Author: rjung
Date: Sun Jan 13 15:19:28 2008
New Revision: 611672

URL: http://svn.apache.org/viewvc?rev=611672&view=rev
Log:
Add push/pull for new ajp shm worker.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=611672&r1=611671&r2=611672&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sun Jan 13 15:19:28 2008
@@ -942,6 +942,50 @@
     return rc;
 }
 
+/* Syncing config values from shm */
+void jk_ajp_pull(ajp_worker_t * aw, jk_logger_t *l)
+{
+    JK_TRACE_ENTER(l);
+
+    if (JK_IS_DEBUG_LEVEL(l))
+        jk_log(l, JK_LOG_DEBUG,
+               "syncing mem for ajp worker '%s' from shm",
+               aw->name);
+
+    aw->cache_timeout = aw->s->cache_timeout;
+    aw->connect_timeout = aw->s->connect_timeout;
+    aw->reply_timeout = aw->s->reply_timeout;
+    aw->prepost_timeout = aw->s->prepost_timeout;
+    aw->recovery_opts = aw->s->recovery_opts;
+    aw->retries = aw->s->retries;
+    aw->max_packet_size = aw->s->max_packet_size;
+    aw->sequence = aw->s->h.sequence;
+
+    JK_TRACE_EXIT(l);
+}
+
+/* Syncing config values to shm */
+void jk_ajp_push(ajp_worker_t * aw, jk_logger_t *l)
+{
+    JK_TRACE_ENTER(l);
+
+    if (JK_IS_DEBUG_LEVEL(l))
+        jk_log(l, JK_LOG_DEBUG,
+               "syncing shm for ajp worker '%s' from mem",
+               aw->name);
+
+    aw->s->cache_timeout = aw->cache_timeout;
+    aw->s->connect_timeout = aw->connect_timeout;
+    aw->s->reply_timeout = aw->reply_timeout;
+    aw->s->prepost_timeout = aw->prepost_timeout;
+    aw->s->recovery_opts = aw->recovery_opts;
+    aw->s->retries = aw->retries;
+    aw->s->max_packet_size = aw->max_packet_size;
+    aw->s->h.sequence = aw->sequence;
+
+    JK_TRACE_EXIT(l);
+}
+
 /** Send a message to an endpoint, using corresponding PROTO HEADER
  * @param ae       endpoint
  * @param msg      message to send
@@ -2041,6 +2085,11 @@
 
     p = e->endpoint_private;
     aw = p->worker;
+
+    jk_shm_lock();
+    if (aw->sequence != aw->s->h.sequence)
+        jk_ajp_pull(aw, l);
+    jk_shm_unlock();
 
     aw->s->used++;
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h?rev=611672&r1=611671&r2=611672&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.h Sun Jan 13 15:19:28 2008
@@ -403,6 +403,10 @@
 
 void ajp_close_endpoint(ajp_endpoint_t * ae, jk_logger_t *l);
 
+void jk_ajp_pull(ajp_worker_t * aw, jk_logger_t *l);
+
+void jk_ajp_push(ajp_worker_t * aw, jk_logger_t *l);
+
 int ajp_connection_tcp_send_message(ajp_endpoint_t * ae,
                                     jk_msg_buf_t *msg, jk_logger_t *l);
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=611672&r1=611671&r2=611672&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun Jan 13 15:19:28 2008
@@ -287,10 +287,15 @@
     for (i = 0; i < p->num_of_workers; i++) {
         lb_sub_worker_t *w = &p->lb_workers[i];
         if (w->sequence != w->s->h.sequence) {
+            jk_worker_t *jw = w->worker;
+            ajp_worker_t *aw = (ajp_worker_t *)jw->worker_private;
+
             if (JK_IS_DEBUG_LEVEL(l))
                 jk_log(l, JK_LOG_DEBUG,
                        "syncing mem for member '%s' of lb '%s' from shm",
                        w->name, p->name);
+
+            jk_ajp_pull(aw, l);
             strncpy(w->route, w->s->route, JK_SHM_STR_SIZ);
             strncpy(w->domain, w->s->domain, JK_SHM_STR_SIZ);
             strncpy(w->redirect, w->s->redirect, JK_SHM_STR_SIZ);
@@ -329,10 +334,15 @@
     for (i = 0; i < p->num_of_workers; i++) {
         lb_sub_worker_t *w = &p->lb_workers[i];
         if (w->sequence != w->s->h.sequence) {
+            jk_worker_t *jw = w->worker;
+            ajp_worker_t *aw = (ajp_worker_t *)jw->worker_private;
+
             if (JK_IS_DEBUG_LEVEL(l))
                 jk_log(l, JK_LOG_DEBUG,
                        "syncing shm for member '%s' of lb '%s' from mem",
                        w->name, p->name);
+
+            jk_ajp_push(aw, l);
             strncpy(w->s->route, w->route, JK_SHM_STR_SIZ);
             strncpy(w->s->domain, w->domain, JK_SHM_STR_SIZ);
             strncpy(w->s->redirect, w->redirect, JK_SHM_STR_SIZ);



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


Mime
View raw message