You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/org/apache/coyote/AbstractProtocol.java
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -669,7 +669,7 @@ public SocketState process(SocketWrapper<S> wrapper,
669
669
}
670
670
671
671
wrapper.setAsync(false);
672
-
ContainerThreadMarker.set();
672
+
ContainerThreadMarker.set();//设置容器标识
673
673
674
674
try {
675
675
if (processor == null) {
@@ -688,7 +688,7 @@ public SocketState process(SocketWrapper<S> wrapper,
688
688
if (status == SocketStatus.CLOSE_NOW) {
689
689
processor.errorDispatch();
690
690
state = SocketState.CLOSED;
691
-
} elseif (dispatches != null) {
691
+
} elseif (dispatches != null) {//处理分发下来读写请求
692
692
// Associate the processor with the connection as
693
693
// these calls may result in a nested call to process()
694
694
connections.put(socket, processor);
@@ -734,7 +734,7 @@ public SocketState process(SocketWrapper<S> wrapper,
734
734
}
735
735
736
736
if (state != SocketState.CLOSED && processor.isAsync()) {
737
-
state = processor.asyncPostProcess();
737
+
state = processor.asyncPostProcess();//Mat.AsyncStateMachine-->AsyncState.STARTING->AsyncState.STARTED
738
738
}
739
739
740
740
if (state == SocketState.UPGRADING) {
@@ -783,14 +783,14 @@ public SocketState process(SocketWrapper<S> wrapper,
783
783
state == SocketState.UPGRADING ||
784
784
dispatches != null && state != SocketState.CLOSED);
785
785
786
-
if (state == SocketState.LONG) {
786
+
if (state == SocketState.LONG) {//后续还有数据要读取,将Processor和处理的socket继续做映射。
787
787
// In the middle of processing a request/response. Keep the
788
788
// socket associated with the processor. Exact requirements
789
789
// depend on type of long poll
790
790
connections.put(socket, processor);
791
791
longPoll(wrapper, processor);
792
792
getLog().info("Mat-->SocketState:SocketState.LONG.In the middle of processing a request/response. Keep the socket associated with the processor. Exact requirements depend on type of long poll!");
0 commit comments