Author: mturk Date: Wed Nov 9 16:58:49 2011 New Revision: 1199846 URL: http://svn.apache.org/viewvc?rev=1199846&view=rev Log: Bail out early from the loop. No functional change
Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1199846&r1=1199845&r2=1199846&view=diff ============================================================================== --- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original) +++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Wed Nov 9 16:58:49 2011 @@ -2289,75 +2289,72 @@ DWORD WINAPI HttpExtensionProc(LPEXTENSI s.pool = &private_data.p; if (init_ws_service(&private_data, &s, &worker_name)) { + jk_endpoint_t *e = NULL; jk_worker_t *worker = wc_get_worker_for_name(worker_name, logger); + if (!worker) { + jk_log(logger, JK_LOG_ERROR, + "could not get a worker for name %s", + worker_name); + jk_close_pool(&private_data.p); + JK_TRACE_EXIT(logger); + return rc; + } if (JK_IS_DEBUG_LEVEL(logger)) jk_log(logger, JK_LOG_DEBUG, - "%s a worker for name %s", - worker ? "got" : "could not get", worker_name); - - if (worker) { - jk_endpoint_t *e = NULL; - if (worker->get_endpoint(worker, &e, logger)) { - int is_error = JK_HTTP_SERVER_ERROR; - int result; - if ((result = e->service(e, &s, logger, &is_error)) > 0) { - if (s.extension.use_server_error_pages && - s.http_response_status >= s.extension.use_server_error_pages) { - if (JK_IS_DEBUG_LEVEL(logger)) - jk_log(logger, JK_LOG_DEBUG, "Forwarding status=%d" - " for worker=%s", - s.http_response_status, worker_name); - lpEcb->dwHttpStatusCode = s.http_response_status; - write_error_message(lpEcb, s.http_response_status, - private_data.err_hdrs); - } - else { - rc = HSE_STATUS_SUCCESS; - lpEcb->dwHttpStatusCode = s.http_response_status; - if (JK_IS_DEBUG_LEVEL(logger)) - jk_log(logger, JK_LOG_DEBUG, - "service() returned OK"); - } + "got a worker for name %s", worker_name); + if (worker->get_endpoint(worker, &e, logger)) { + int is_error = JK_HTTP_SERVER_ERROR; + int result; + if ((result = e->service(e, &s, logger, &is_error)) > 0) { + if (s.extension.use_server_error_pages && + s.http_response_status >= s.extension.use_server_error_pages) { + if (JK_IS_DEBUG_LEVEL(logger)) + jk_log(logger, JK_LOG_DEBUG, "Forwarding status=%d" + " for worker=%s", + s.http_response_status, worker_name); + lpEcb->dwHttpStatusCode = s.http_response_status; + write_error_message(lpEcb, s.http_response_status, + private_data.err_hdrs); } else { - if ((result == JK_CLIENT_ERROR) && (is_error == JK_HTTP_OK)) { - jk_log(logger, JK_LOG_INFO, - "service() failed because client aborted connection"); - } - else { - jk_log(logger, JK_LOG_ERROR, - "service() failed with http error %d", is_error); - } - lpEcb->dwHttpStatusCode = is_error; - write_error_message(lpEcb, is_error, private_data.err_hdrs); + rc = HSE_STATUS_SUCCESS; + lpEcb->dwHttpStatusCode = s.http_response_status; + if (JK_IS_DEBUG_LEVEL(logger)) + jk_log(logger, JK_LOG_DEBUG, + "service() returned OK"); } - e->done(&e, logger); } else { - jk_log(logger, JK_LOG_ERROR, - "Failed to obtain an endpoint to service request - " - "your connection_pool_size is probably less than the threads in your web server!"); + if ((result == JK_CLIENT_ERROR) && (is_error == JK_HTTP_OK)) { + jk_log(logger, JK_LOG_INFO, + "service() failed because client aborted connection"); + } + else { + jk_log(logger, JK_LOG_ERROR, + "service() failed with http error %d", is_error); + } + lpEcb->dwHttpStatusCode = is_error; + write_error_message(lpEcb, is_error, private_data.err_hdrs); } + e->done(&e, logger); } else { jk_log(logger, JK_LOG_ERROR, - "could not get a worker for name %s", - worker_name); + "Failed to obtain an endpoint to service request - " + "your connection_pool_size is probably less than the threads in your web server!"); } } else { jk_log(logger, JK_LOG_ERROR, "failed to init service for request."); - } + } jk_close_pool(&private_data.p); JK_TRACE_EXIT(logger); return rc; } - - BOOL WINAPI TerminateExtension(DWORD dwFlags) { return TerminateFilter(dwFlags); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org