tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r559197 - in /tomcat/connectors/trunk/jk/native/common: jk_ajp12_worker.c jk_ajp_common.c jk_jni_worker.c jk_lb_worker.c jk_status.c
Date Tue, 24 Jul 2007 20:39:10 GMT
Author: rjung
Date: Tue Jul 24 13:39:09 2007
New Revision: 559197

URL: http://svn.apache.org/viewvc?view=rev&rev=559197
Log:
Small changes to the service method of the various workers.
Make them a little more consistent:
- always set is_error
- don't TRACE_EXIT to early
- no longer using is_recoverable_error instead of is_error
  in jni worker

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
    tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
    tomcat/connectors/trunk/jk/native/common/jk_status.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c?view=diff&rev=559197&r1=559196&r2=559197
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp12_worker.c Tue Jul 24 13:39:09 2007
@@ -88,7 +88,7 @@
                              jk_ws_service_t *s,
                              jk_logger_t *l, int *is_error)
 {
-    ajp12_endpoint_t *p = e->endpoint_private;
+    ajp12_endpoint_t *p;
     unsigned int attempt;
     int rc = -1;
     /*
@@ -97,14 +97,19 @@
 
     JK_TRACE_ENTER(l);
 
-    if (is_error)
-        *is_error = JK_HTTP_SERVER_ERROR;
     if (!e || !e->endpoint_private || !s || !is_error) {
         JK_LOG_NULL_PARAMS(l);
+        if (is_error)
+            *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }
 
+    p = e->endpoint_private;
+
+    /* Set returned error to OK */
+    *is_error = JK_HTTP_OK;
+
     for (attempt = 0; attempt < p->worker->connect_retry_attempts;
          attempt++) {
         p->sd =
@@ -130,6 +135,7 @@
     }
     jk_log(l, JK_LOG_ERROR, "In jk_endpoint_t::service, Error sd = %d",
            p->sd);
+    *is_error = JK_HTTP_SERVER_ERROR;
 
     JK_TRACE_EXIT(l);
     return JK_FALSE;

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?view=diff&rev=559197&r1=559196&r2=559197
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Tue Jul 24 13:39:09 2007
@@ -1833,15 +1833,19 @@
 
     JK_TRACE_ENTER(l);
 
-    if (is_error)
-        *is_error = JK_HTTP_SERVER_ERROR;
     if (!e || !e->endpoint_private || !s || !is_error) {
         JK_LOG_NULL_PARAMS(l);
+        if (is_error)
+            *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }
 
     p = e->endpoint_private;
+
+    /* Set returned error to OK */
+    *is_error = JK_HTTP_OK;
+
     op->request = jk_b_new(&(p->pool));
     if (!op->request) {
         *is_error = JK_HTTP_SERVER_ERROR;
@@ -2017,11 +2021,12 @@
                            "(%s) receiving reply from tomcat failed "
                            "without recovery in send loop attempt=%d",
                            p->worker->name, i);
-                    JK_TRACE_EXIT(l);
                     if (err == JK_REPLY_TIMEOUT) {
                         *is_error = JK_HTTP_GATEWAY_TIME_OUT;
+                        JK_TRACE_EXIT(l);
                         return JK_REPLY_TIMEOUT;
                     }
+                    JK_TRACE_EXIT(l);
                     return JK_FALSE;
                 }
                 jk_log(l, JK_LOG_INFO,
@@ -2080,11 +2085,13 @@
            "or is listening on the wrong port",
            p->worker->name);
 
-    JK_TRACE_EXIT(l);
     if (err == JK_REPLY_TIMEOUT) {
         *is_error = JK_HTTP_GATEWAY_TIME_OUT;
+        JK_TRACE_EXIT(l);
         return JK_REPLY_TIMEOUT;
     }
+
+    JK_TRACE_EXIT(l);
     return JK_FALSE;
 }
 

Modified: tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c?view=diff&rev=559197&r1=559196&r2=559197
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_jni_worker.c Tue Jul 24 13:39:09 2007
@@ -250,29 +250,31 @@
 
 static int JK_METHOD service(jk_endpoint_t *e,
                              jk_ws_service_t *s,
-                             jk_logger_t *l, int *is_recoverable_error)
+                             jk_logger_t *l, int *is_error)
 {
     jni_endpoint_t *p;
     jint rc;
 
     JK_TRACE_ENTER(l);
 
-    if (is_recoverable_error)
-        *is_recoverable_error = JK_FALSE;
-    if (!e || !e->endpoint_private || !s || !is_recoverable_error) {
+    if (!e || !e->endpoint_private || !s || !is_error) {
         JK_LOG_NULL_PARAMS(l);
+        if (is_error)
+            *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }
 
     p = e->endpoint_private;
 
+    /* Set returned error to OK */
+    *is_error = JK_HTTP_OK;
+
     if (!p->attached) {
         /* Try to attach */
         if (!(p->env = attach_to_jvm(p->worker, l))) {
             jk_log(l, JK_LOG_EMERG, "Attach failed");
-            /*   Is it recoverable ?? */
-            *is_recoverable_error = JK_TRUE;
+            *is_error = JK_HTTP_SERVER_ERROR;
             JK_TRACE_EXIT(l);
             return JK_FALSE;
         }
@@ -307,6 +309,7 @@
     }
     else {
         jk_log(l, JK_LOG_ERROR, "Tomcat FAILED!");
+        *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }

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?view=diff&rev=559197&r1=559196&r2=559197
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Tue Jul 24 13:39:09 2007
@@ -891,10 +891,10 @@
 
     JK_TRACE_ENTER(l);
 
-    if (is_error)
-        *is_error = JK_HTTP_SERVER_ERROR;
     if (!e || !e->endpoint_private || !s || !is_error) {
         JK_LOG_NULL_PARAMS(l);
+        if (is_error)
+            *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }

Modified: tomcat/connectors/trunk/jk/native/common/jk_status.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_status.c?view=diff&rev=559197&r1=559196&r2=559197
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_status.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_status.c Tue Jul 24 13:39:09 2007
@@ -2985,16 +2985,19 @@
 
     JK_TRACE_ENTER(l);
 
-    if (is_error)
-        *is_error = JK_FALSE;
     if (!e || !e->endpoint_private || !s || !is_error) {
         JK_LOG_NULL_PARAMS(l);
+        if (is_error)
+            *is_error = JK_HTTP_SERVER_ERROR;
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }
 
     p = e->endpoint_private;
     w = p->worker;
+
+    /* Set returned error to OK */
+    *is_error = JK_HTTP_OK;
 
     if (w->num_of_users) {
         if (s->remote_user) {



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


Mime
View raw message