Skip to content

Commit

Permalink
fix: requestList concurrency (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
monkeyWie committed Nov 17, 2022
1 parent b3fd35e commit 37bc807
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -25,7 +25,7 @@ Proxyee is a JAVA written HTTP proxy server library that supports HTTP, HTTPS, W
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Expand Up @@ -25,7 +25,7 @@ Proxyee 是一个 JAVA 编写的 HTTP 代理服务器类库,支持 HTTP、HTTP
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.7.0</version>
<version>1.7.1</version>

<packaging>jar</packaging>

Expand Down
Expand Up @@ -323,14 +323,16 @@ private void handleProxyData(Channel channel, Object msg, boolean isHttp) throws
getChannelFuture().addListener((ChannelFutureListener) future -> {
if (future.isSuccess()) {
future.channel().writeAndFlush(msg);
synchronized (requestList) {
synchronized (getRequestList()) {
getRequestList().forEach(obj -> future.channel().writeAndFlush(obj));
getRequestList().clear();
setIsConnect(true);
}
} else {
getRequestList().forEach(obj -> ReferenceCountUtil.release(obj));
getRequestList().clear();
synchronized (getRequestList()) {
getRequestList().forEach(obj -> ReferenceCountUtil.release(obj));
getRequestList().clear();
}
getExceptionHandle().beforeCatch(channel, future.cause());
future.channel().close();
channel.close();
Expand Down

0 comments on commit 37bc807

Please sign in to comment.