View | Details | Raw Unified | Return to bug 40966
Collapse All | Expand All

(-)jk_ajp_common.c (-4 / +23 lines)
Lines 680-690 Link Here
680
680
681
static void ajp_reset_endpoint(ajp_endpoint_t * ae, jk_logger_t *l)
681
static void ajp_reset_endpoint(ajp_endpoint_t * ae, jk_logger_t *l)
682
{
682
{
683
    if (ae->sd > 0 && !ae->reuse) {
683
    if (IS_VALID_SOCKET(ae->sd) && !ae->reuse) {
684
        jk_close_socket(ae->sd);
684
        jk_close_socket(ae->sd);
685
        if (JK_IS_DEBUG_LEVEL(l))
685
        if (JK_IS_DEBUG_LEVEL(l))
686
            jk_log(l, JK_LOG_DEBUG,
686
            jk_log(l, JK_LOG_DEBUG,
687
                   "reset socket with sd = %d", ae->sd);
687
            "reset socket with sd = %u", ae->sd );
688
        ae->sd = -1;
688
        ae->sd = -1;
689
    }
689
    }
690
    jk_reset_pool(&(ae->pool));
690
    jk_reset_pool(&(ae->pool));
Lines 1468-1477 Link Here
1468
            jk_log(l, JK_LOG_WARNING, "AJP13 protocol: Reuse is set to false");
1468
            jk_log(l, JK_LOG_WARNING, "AJP13 protocol: Reuse is set to false");
1469
        }
1469
        }
1470
        else if (r->disable_reuse) {
1470
        else if (r->disable_reuse) {
1471
            if (JK_IS_DEBUG_LEVEL(l)) {
1472
                jk_log(l, JK_LOG_DEBUG, "AJP13 protocol: Reuse is disabled");
1473
            }
1471
            ae->reuse = JK_FALSE;
1474
            ae->reuse = JK_FALSE;
1472
        }
1475
        }
1473
        else {
1476
        else {
1474
            /* Reuse in all cases */
1477
            /* Reuse in all cases */
1478
            if (JK_IS_DEBUG_LEVEL(l)) {
1479
                jk_log(l, JK_LOG_DEBUG, "AJP13 protocol: Reuse is OK");
1480
            }
1475
            ae->reuse = JK_TRUE;
1481
            ae->reuse = JK_TRUE;
1476
        }
1482
        }
1477
        /* Flush after the last write */
1483
        /* Flush after the last write */
Lines 2183-2189 Link Here
2183
            int i;
2189
            int i;
2184
            jk_sock_t sock = JK_INVALID_SOCKET;
2190
            jk_sock_t sock = JK_INVALID_SOCKET;
2185
2191
2186
            if (p->sd > 0 && !p->reuse) {
2192
            /* If we are going to close the connection, then park the socket so 
2193
               we can shut it down nicely rather than letting ajp_reset_endpoint kill it */
2194
            if (IS_VALID_SOCKET(p->sd) && !p->reuse) {
2195
                if (JK_IS_DEBUG_LEVEL(l))
2196
                    jk_log(l, JK_LOG_DEBUG,
2197
                    "will be shutting down socket %u for worker %s",
2198
                            p->sd, p->worker->name );
2187
                sock  = p->sd;
2199
                sock  = p->sd;
2188
                p->sd = JK_INVALID_SOCKET;
2200
                p->sd = JK_INVALID_SOCKET;
2189
            }
2201
            }
Lines 2199-2206 Link Here
2199
            if (w->cache_timeout > 0)
2211
            if (w->cache_timeout > 0)
2200
                p->last_access = time(NULL);
2212
                p->last_access = time(NULL);
2201
            JK_LEAVE_CS(&w->cs, rc);
2213
            JK_LEAVE_CS(&w->cs, rc);
2202
            if (IS_VALID_SOCKET(sock))
2214
2215
            /* Drain and close the socket */
2216
            if (IS_VALID_SOCKET(sock)) {
2217
                if (JK_IS_DEBUG_LEVEL(l))
2218
                    jk_log(l, JK_LOG_DEBUG,
2219
                    "Shutting down held socket %u in worker %s",
2220
                            sock, p->worker->name);
2203
                jk_shutdown_socket(sock);
2221
                jk_shutdown_socket(sock);
2222
            }
2204
            if (i >= 0) {
2223
            if (i >= 0) {
2205
                if (JK_IS_DEBUG_LEVEL(l))
2224
                if (JK_IS_DEBUG_LEVEL(l))
2206
                    jk_log(l, JK_LOG_DEBUG,
2225
                    jk_log(l, JK_LOG_DEBUG,

Return to bug 40966