ASF Bugzilla – Attachment 21992 Details for
Bug 45071
Sendfile on APR connector can truncate downloads.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to alter APR sendfile thread timeout behavior
timeoutpatch1 (text/plain), 2.91 KB, created by
Alex Barclay
on 2008-05-23 13:34:29 UTC
(
hide
)
Description:
Patch to alter APR sendfile thread timeout behavior
Filename:
MIME Type:
Creator:
Alex Barclay
Created:
2008-05-23 13:34:29 UTC
Size:
2.91 KB
patch
obsolete
>--- ../tc6.0.x-melodeo/java/org/apache/tomcat/util/net/AprEndpoint.java 2008-05-22 15:21:36.000000000 -0700 >+++ ./java/org/apache/tomcat/util/net/AprEndpoint.java 2008-05-21 15:51:17.000000000 -0700 >@@ -1691,10 +1691,7 @@ > * @param data the sendfile data which should be removed > */ > protected void remove(SendfileData data) { >- int rv = Poll.remove(sendfilePollset, data.socket); >- if (rv == Status.APR_SUCCESS) { >- sendfileCount--; >- } >+ sendfileCount--; > sendfileData.remove(new Long(data.socket)); > } > >@@ -1751,7 +1748,7 @@ > > maintainTime += pollTime; > // Pool for the specified interval >- int rv = Poll.poll(sendfilePollset, pollTime, desc, false); >+ int rv = Poll.poll(sendfilePollset, pollTime, desc, true); > if (rv > 0) { > for (int n = 0; n < rv; n++) { > // Get the sendfile state >@@ -1789,14 +1786,27 @@ > Socket.timeoutSet(state.socket, soTimeout * 1000); > // If all done hand this socket off to a worker for > // processing of further requests >- if (!processSocket(state.socket)) { >- Socket.destroy(state.socket); >- } >+ >+ // See if this fixes problems - hand it directly to the poller first >+ //if (!processSocket(state.socket)) { >+ // Socket.destroy(state.socket); >+ //} >+ getPoller().add(state.socket); > } else { > // Close the socket since this is > // the end of not keep-alive request. > Socket.destroy(state.socket); > } >+ } else { >+ // Add this descriptor back to the poller - we do this taking out and >+ // putting back to ensure that the socket ttl gets reset each time >+ int r = Poll.add(sendfilePollset, state.socket, Poll.APR_POLLOUT); >+ if (r != Status.APR_SUCCESS) { >+ // Game over for this transfer >+ remove(state); >+ Socket.destroy(state.socket); >+ continue; >+ } > } > } > } else if (rv < 0) { >Only in .: output
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45071
:
21992
|
21993
|
22034