代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/openjdk-1.8.0 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b1c3eca9320e83db1fe6fe281c2d4a8875e8f16b Mon Sep 17 00:00:00 2001
Date: Thu, 27 Jul 2023 20:07:00 +0800
Subject: [PATCH] [Backport]8179273: sun.net.httpserver.LeftOverInputStream should stop
attempting to drain the stream when the server is stopped
---
.../classes/sun/net/httpserver/LeftOverInputStream.java | 7 +++++--
jdk/src/share/classes/sun/net/httpserver/ServerImpl.java | 4 ++++
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/jdk/src/share/classes/sun/net/httpserver/LeftOverInputStream.java b/jdk/src/share/classes/sun/net/httpserver/LeftOverInputStream.java
index c715d72ad..d3a6e1b08 100644
--- a/jdk/src/share/classes/sun/net/httpserver/LeftOverInputStream.java
+++ b/jdk/src/share/classes/sun/net/httpserver/LeftOverInputStream.java
@@ -41,8 +41,8 @@ import com.sun.net.httpserver.spi.*;
* isEOF() returns true, when all expected bytes have been read
*/
abstract class LeftOverInputStream extends FilterInputStream {
- ExchangeImpl t;
- ServerImpl server;
+ final ExchangeImpl t;
+ final ServerImpl server;
protected boolean closed = false;
protected boolean eof = false;
byte[] one = new byte [1];
@@ -109,6 +109,9 @@ abstract class LeftOverInputStream extends FilterInputStream {
int bufSize = 2048;
byte[] db = new byte [bufSize];
while (l > 0) {
+ if (server.isFinishing()) {
+ break;
+ }
long len = readImpl (db, 0, bufSize);
if (len == -1) {
eof = true;
diff --git a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
index a5adbf609..271a5bbc7 100644
--- a/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
+++ b/jdk/src/share/classes/sun/net/httpserver/ServerImpl.java
@@ -219,6 +219,10 @@ class ServerImpl {
return httpsConfig;
}
+ public final boolean isFinishing() {
+ return finished;
+ }
+
public void stop (int delay) {
if (delay < 0) {
throw new IllegalArgumentException ("negative delay parameter");
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。