Fixed a race condition in HttpTunnelingServlet which caused data corruption and duplicate write
This commit is contained in:
parent
a28d08936d
commit
8ed89dbd8f
@ -240,9 +240,11 @@ public class HttpTunnelingServlet extends HttpServlet {
|
|||||||
@Override
|
@Override
|
||||||
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
|
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
|
||||||
ChannelBuffer buffer = (ChannelBuffer) e.getMessage();
|
ChannelBuffer buffer = (ChannelBuffer) e.getMessage();
|
||||||
|
synchronized (this) {
|
||||||
buffer.readBytes(out, buffer.readableBytes());
|
buffer.readBytes(out, buffer.readableBytes());
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user