Skip to content

Commit 2fa1180

Browse files
committed
Make NamedPipeSocket.connect a no-op to fix connection exceptions
Update `NamedPipeSocket` so that `connect` methods are now no-ops. This restores the behavior of Spring Boot 3.3 which previously handled the case by overriding `ConnectionSocketFactory.connectSocket`. The newer HTTP client code uses the `DetachedSocketFactory` interface which doesn't offer a method that we can override, so instead we must change the socket implementation itself. Fixes gh-42952
1 parent bc5a25b commit 2fa1180

File tree

1 file changed

+11
-0
lines changed
  • spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket

1 file changed

+11
-0
lines changed

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/socket/NamedPipeSocket.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.io.InputStream;
2121
import java.io.OutputStream;
2222
import java.net.Socket;
23+
import java.net.SocketAddress;
2324
import java.nio.ByteBuffer;
2425
import java.nio.channels.AsynchronousByteChannel;
2526
import java.nio.channels.AsynchronousCloseException;
@@ -73,6 +74,16 @@ private AsynchronousFileByteChannel open(String path) throws IOException {
7374
}
7475
}
7576

77+
@Override
78+
public void connect(SocketAddress endpoint) throws IOException {
79+
// No-op
80+
}
81+
82+
@Override
83+
public void connect(SocketAddress endpoint, int timeout) throws IOException {
84+
// No-op
85+
}
86+
7687
@Override
7788
public InputStream getInputStream() {
7889
return Channels.newInputStream(this.channel);

0 commit comments

Comments
 (0)