You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by NormW <no...@bocnet.com.au> on 2004/02/28 06:49:19 UTC

Recent Patches - Tab 'Fix'

Good afternoon All.
Attached are three patches requested by an under-cover tab policeman.
No offence intended, but I'm obliged to assist the police in this matter.
Norm
----------------------------------------------------------------------------
--- changes.txt.orig Fri Feb 27 20:09:16 2004
+++ changes.txt Sat Feb 28 15:02:28 2004
@@ -7,12 +7,12 @@
     * Added the load balancer stickySession property. If set to 0
       requests with servlet SESSION ID's can be routed to any Tomcat
       worker. Default is 1, sessions are sticky.
- * Port from jk of connect_timeout, reply_timeout, prepost_timeout (AJP13
PING/PONG).
-   You could set connectTimeout, replyTimeout and prepostTimeout for such
purpose in ajp properties.
-   [Henri Gomez]
- * Add hasinput method for channel, which will check if datas are
-   available on input channel (TC->WEBSERVER).
-   [Henri Gomez]
+    * Port from jk of connect_timeout, reply_timeout, prepost_timeout
(AJP13 PING/PONG).
+      You could set connectTimeout, replyTimeout and prepostTimeout for
such purpose in ajp properties.
+      [Henri Gomez]
+    * Add hasinput method for channel, which will check if datas are
+      available on input channel (TC->WEBSERVER).
+      [Henri Gomez]
     * Make use apr_port_t instead of short to fix problem to have port
higher than 32K.
     * Make default port configurable (9009 on Netware, 8009 elsewhere)
     * Fix problem when in Load-Balancing and POST
----------------------------------------------------------------------------
-
--- jk_worker_ajp13.c.orig Fri Feb 27 20:49:20 2004
+++ jk_worker_ajp13.c Sat Feb 28 16:29:49 2004
@@ -416,55 +416,55 @@
             /* If we have the service recovery buffer FILLED and we're in
first attempt */
             /* recopy the recovery buffer in post instead of reading it
from client */
             if ( s->reco_status == RECO_FILLED && (attempt==0) ) {
-       /* Get in post buf the previously saved POST */
-
-       if (s->reco_buf->copy(env, s->reco_buf, e->post) < 0) {
-                  s->is_recoverable_error = JK_FALSE;
-                  env->l->jkLog(env, env->l, JK_LOG_ERROR,
-                                "ajp13.service() can't use the LB recovery
buffer, aborting\n");
-                 return JK_ERR;
-       }
+                /* Get in post buf the previously saved POST */
+
+                if (s->reco_buf->copy(env, s->reco_buf, e->post) < 0) {
+                    s->is_recoverable_error = JK_FALSE;
+                    env->l->jkLog(env, env->l, JK_LOG_ERROR,
+                                       "ajp13.service() can't use the LB
recovery buffer, aborting\n");
+                    return JK_ERR;
+                }

                 env->l->jkLog(env, env->l, JK_LOG_DEBUG,
                               "ajp13.service() using the LB recovery
buffer\n");
             }
             else
             {
-             if( attempt==0 )
-                 err=jk2_serialize_postHead( env, e->post, s, e );
-             else
-                 err=JK_OK; /* We already have the initial body chunk */
-
-             if( e->worker->mbean->debug > 10 )
-                 e->request->dump( env, e->request, "Post head" );
-
-             if (err != JK_OK ) {
-                 /* the browser stop sending data, no need to recover */
-                 /* e->recoverable = JK_FALSE; */
-                 s->is_recoverable_error = JK_FALSE;
-                 env->l->jkLog(env, env->l, JK_LOG_ERROR,
-                               "ajp13.service() Error receiving initial
post %d %d %d\n", err, errno, attempt);
+                if( attempt==0 )
+                    err=jk2_serialize_postHead( env, e->post, s, e );
+                else
+                    err=JK_OK; /* We already have the initial body chunk */
+
+                if( e->worker->mbean->debug > 10 )
+                    e->request->dump( env, e->request, "Post head" );
+
+                if (err != JK_OK ) {
+                    /* the browser stop sending data, no need to recover */
+                    /* e->recoverable = JK_FALSE; */
+                    s->is_recoverable_error = JK_FALSE;
+                    env->l->jkLog(env, env->l, JK_LOG_ERROR,
+                                  "ajp13.service() Error receiving initial
post %d %d %d\n", err, errno, attempt);

                     /* BR #27281 : Should we return HTTP 500 since its the
user who stop the sending ? */
                     /* may be not, so return another HTTP code -> use
PARTIAL CONTENT, 206 instead */
                     s->status = 206;
-                 return JK_ERR;
-             }
+                    return JK_ERR;
+                }
+
+                /* If a recovery buffer exist (LB mode), save here the post
buf */
+                if (s->reco_status == RECO_INITED) {
+                    /* Save the post for recovery if needed */
+                    if (e->post->copy(env, e->post, s->reco_buf) < 0) {
+                        s->is_recoverable_error = JK_FALSE;
+                        env->l->jkLog(env, env->l, JK_LOG_ERROR,
+                                           "ajp13.service() can't save the
LB recovery buffer, aborting\n");
+                        return JK_ERR;
+                    }
+                    else
+                        s->reco_status = RECO_FILLED;
+                }
+            }

-    /* If a recovery buffer exist (LB mode), save here the post buf */
-    if (s->reco_status == RECO_INITED) {
-        /* Save the post for recovery if needed */
-        if (e->post->copy(env, e->post, s->reco_buf) < 0) {
-                  s->is_recoverable_error = JK_FALSE;
-                  env->l->jkLog(env, env->l, JK_LOG_ERROR,
-                                "ajp13.service() can't save the LB recovery
buffer, aborting\n");
-                  return JK_ERR;
-        }
-        else
-         s->reco_status = RECO_FILLED;
-    }
-   }
-
             has_post_body=JK_TRUE;
             err= e->worker->channel->send( env, e->worker->channel, e,
                                            e->post );
@@ -501,7 +501,7 @@
                           "ajp13.service() ajpGetReply recoverable error
%d\n",
                           err);
             jk2_close_endpoint(env, e );
-       }
+        }

         if( err==JK_OK )
             return err;
----------------------------------------------------------------------------
--------
--- jk_worker_status.c.orig Fri Feb 27 20:49:26 2004
+++ jk_worker_status.c Sat Feb 28 16:32:28 2004
@@ -175,7 +175,7 @@
     int needHeader=JK_TRUE;

     if( wenv->shm==NULL || wenv->shm->head==NULL) {
-  s->jkprintf(env, s, "<h3>No Scoreboard available</h3>\n");
+        s->jkprintf(env, s, "<h3>No Scoreboard available</h3>\n");
         return;
     }

@@ -946,7 +946,7 @@
     }
     s->head(env, s );

- s->jkprintf(env, s, "<style>%s</style>\n", DEFAULT_CSS );
+    s->jkprintf(env, s, "<style>%s</style>\n", DEFAULT_CSS );

     /** Process the query string.
      */
----------------------------------------------------------------------------
------