You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/05/17 11:08:09 UTC
[tomcat] branch master updated: Add sync back after #4366
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push:
new c946142 Add sync back after #4366
c946142 is described below
commit c946142b886e1c103fd1ad992f5cb9c6604b99f1
Author: remm <re...@apache.org>
AuthorDate: Fri May 17 13:07:59 2019 +0200
Add sync back after #4366
---
java/org/apache/tomcat/util/net/Nio2Endpoint.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index b1a038d..e1ab5d0 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -1016,9 +1016,11 @@ public class Nio2Endpoint extends AbstractJsseEndpoint<Nio2Channel,AsynchronousS
long nBytes = 0;
// If there is still data inside the main read buffer, it needs to be read first
if (!socketBufferHandler.isReadBufferEmpty()) {
- socketBufferHandler.configureReadBufferForRead();
- for (int i = 0; i < length && !socketBufferHandler.isReadBufferEmpty(); i++) {
- nBytes += transfer(socketBufferHandler.getReadBuffer(), buffers[offset + i]);
+ synchronized (readCompletionHandler) {
+ socketBufferHandler.configureReadBufferForRead();
+ for (int i = 0; i < length && !socketBufferHandler.isReadBufferEmpty(); i++) {
+ nBytes += transfer(socketBufferHandler.getReadBuffer(), buffers[offset + i]);
+ }
}
if (nBytes > 0) {
completion.completed(Long.valueOf(nBytes), this);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org