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

(-)java/org/apache/tomcat/util/net/AprEndpoint.java (-5 / +12 lines)
Lines 1691-1700 Link Here
1691
         * @param data the sendfile data which should be removed
1691
         * @param data the sendfile data which should be removed
1692
         */
1692
         */
1693
        protected void remove(SendfileData data) {
1693
        protected void remove(SendfileData data) {
1694
            int rv = Poll.remove(sendfilePollset, data.socket);
1694
            sendfileCount--;
1695
            if (rv == Status.APR_SUCCESS) {
1696
                sendfileCount--;
1697
            }
1698
            sendfileData.remove(new Long(data.socket));
1695
            sendfileData.remove(new Long(data.socket));
1699
        }
1696
        }
1700
1697
Lines 1751-1757 Link Here
1751
1748
1752
                    maintainTime += pollTime;
1749
                    maintainTime += pollTime;
1753
                    // Pool for the specified interval
1750
                    // Pool for the specified interval
1754
                    int rv = Poll.poll(sendfilePollset, pollTime, desc, false);
1751
                    int rv = Poll.poll(sendfilePollset, pollTime, desc, true);
1755
                    if (rv > 0) {
1752
                    if (rv > 0) {
1756
                        for (int n = 0; n < rv; n++) {
1753
                        for (int n = 0; n < rv; n++) {
1757
                            // Get the sendfile state
1754
                            // Get the sendfile state
Lines 1797-1802 Link Here
1797
                                    // the end of not keep-alive request.
1794
                                    // the end of not keep-alive request.
1798
                                    Socket.destroy(state.socket);
1795
                                    Socket.destroy(state.socket);
1799
                                }
1796
                                }
1797
                            } else {
1798
                                // Add this descriptor back to the poller - we do this taking out and
1799
                                // putting back to ensure that the socket ttl gets reset each time
1800
                                int r = Poll.add(sendfilePollset, state.socket, Poll.APR_POLLOUT);
1801
                                if (r != Status.APR_SUCCESS) {
1802
                                    // Game over for this transfer
1803
                                    remove(state);
1804
                                    Socket.destroy(state.socket);
1805
                                    continue;
1806
                                }
1800
                            }
1807
                            }
1801
                        }
1808
                        }
1802
                    } else if (rv < 0) {
1809
                    } else if (rv < 0) {

Return to bug 45071