Skip to content

Commit

Permalink
Merge pull request eclipse-ee4j#5779 from senivam/40_merged
Browse files Browse the repository at this point in the history
merge of the actual 3.1 into the 4.0
  • Loading branch information
jansupol authored Nov 15, 2024
2 parents 466c482 + 47c0908 commit b4fb825
Show file tree
Hide file tree
Showing 88 changed files with 2,447 additions and 310 deletions.
16 changes: 8 additions & 8 deletions NOTICE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Notice for Jersey
# Notice for Jersey
This content is produced and maintained by the Eclipse Jersey project.

* Project home: https://projects.eclipse.org/projects/ee4j.jersey
Expand Down Expand Up @@ -57,25 +57,25 @@ Bootstrap v3.3.7
* Project: http://getbootstrap.com
* Copyright: 2011-2016 Twitter, Inc

Google Guava Version 18.0
Google Guava Version 33.3.0-jre
* License: Apache License, 2.0
* Copyright (C) 2009 The Guava Authors
* Copyright (C) 2009, 2024 The Guava Authors

jakarta.inject Version: 1
jakarta.inject Version: 2.0.1
* License: Apache License, 2.0
* Copyright (C) 2009 The JSR-330 Expert Group
* Copyright (C) 2009, 2021 The JSR-330 Expert Group

Javassist Version 3.30.2-GA
* License: Apache License, 2.0
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.

Jackson JAX-RS Providers Version 2.17.1
Jackson JAX-RS Providers Version 2.18.0
* License: Apache License, 2.0
* Project: https://github.com/FasterXML/jackson-jaxrs-providers
* Copyright: (c) 2009-2024 FasterXML, LLC. All rights reserved unless otherwise indicated.

jQuery v1.12.4
jQuery v3.7.1
* License: jquery.org/license
* Project: jquery.org
* Copyright: (c) jQuery Foundation
Expand All @@ -95,7 +95,7 @@ KineticJS, v4.7.1
* Project: http://www.kineticjs.com, https://github.com/ericdrowell/KineticJS
* Copyright: Eric Rowell

org.objectweb.asm Version 9.7
org.objectweb.asm Version 9.7.1
* License: Modified BSD (https://asm.ow2.io/license.html)
* Copyright (c) 2000-2011 INRIA, France Telecom. All rights reserved.

Expand Down
18 changes: 18 additions & 0 deletions connectors/netty-connector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@
</plugins>
</build>
</profile>
<profile>
<id>InaccessibleObjectException</id>
<activation><jdk>[12,)</jdk></activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--add-opens java.base/java.lang=ALL-UNNAMED
--add-opens java.base/java.lang.reflect=ALL-UNNAMED
</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public void operationComplete(io.netty.util.concurrent.Future<? super Void> futu
};
ch.closeFuture().addListener(closeListener);

final NettyEntityWriter entityWriter = NettyEntityWriter.getInstance(jerseyRequest, ch);
final NettyEntityWriter entityWriter = nettyEntityWriter(jerseyRequest, ch);
switch (entityWriter.getType()) {
case CHUNKED:
HttpUtil.setTransferEncodingChunked(nettyRequest, true);
Expand Down Expand Up @@ -524,6 +524,10 @@ public void run() {
}
}

/* package */ NettyEntityWriter nettyEntityWriter(ClientRequest clientRequest, Channel channel) {
return NettyEntityWriter.getInstance(clientRequest, channel);
}

private SSLContext getSslContext(Client client, ClientRequest request) {
Supplier<SSLContext> supplier = request.resolveProperty(ClientProperties.SSL_CONTEXT_SUPPLIER, Supplier.class);
return supplier == null ? client.getSslContext() : supplier.get();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -101,7 +101,15 @@ public ByteBuf readChunk(ChannelHandlerContext ctx) throws Exception {

@Override
public ByteBuf readChunk(ByteBufAllocator allocator) throws Exception {
try {
return readChunk0(allocator);
} catch (Exception e) {
closeOnThrowable();
throw e;
}
}

private ByteBuf readChunk0(ByteBufAllocator allocator) throws Exception {
if (!open) {
return null;
}
Expand Down Expand Up @@ -143,6 +151,14 @@ public long progress() {
return offset;
}

private void closeOnThrowable() {
try {
close();
} catch (Throwable t) {
// do not throw other throwable
}
}

@Override
public void close() throws IOException {

Expand Down Expand Up @@ -208,10 +224,12 @@ private void write(Provider<ByteBuffer> bufferSupplier) throws IOException {
try {
boolean queued = queue.offer(bufferSupplier.get(), WRITE_TIMEOUT, TimeUnit.MILLISECONDS);
if (!queued) {
closeOnThrowable();
throw new IOException("Buffer overflow.");
}

} catch (InterruptedException e) {
closeOnThrowable();
throw new IOException(e);
}
}
Expand Down
Loading

0 comments on commit b4fb825

Please sign in to comment.