Skip to content

Commit d39d7f2

Browse files
authored
Fix issue with jersey and unix domain sockets (#697)
1 parent 95e5075 commit d39d7f2

File tree

12 files changed

+914
-149
lines changed

12 files changed

+914
-149
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ target
2121
*.log
2222

2323
#Ignore Test Output
24-
test-output
24+
test-output
25+
/.checkstyle

pom.xml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
23
<modelVersion>4.0.0</modelVersion>
34

45
<parent>
@@ -67,7 +68,7 @@
6768
<slf4j-api.version>1.7.21</slf4j-api.version>
6869

6970
<bouncycastle.version>1.54</bouncycastle.version>
70-
<unix-socket-factory.version>2015-01-27T15-02-14</unix-socket-factory.version>
71+
<junixsocket.version>2.0.4</junixsocket.version>
7172
<guava.version>19.0</guava.version>
7273

7374
<!-- test dependencies -->
@@ -115,11 +116,15 @@
115116
<version>${jersey.version}</version>
116117
</dependency>
117118
<dependency>
118-
<groupId>de.gesellix</groupId>
119-
<artifactId>unix-socket-factory</artifactId>
120-
<version>${unix-socket-factory.version}</version>
119+
<groupId>com.kohlschutter.junixsocket</groupId>
120+
<artifactId>junixsocket-common</artifactId>
121+
<version>${junixsocket.version}</version>
122+
</dependency>
123+
<dependency>
124+
<groupId>com.kohlschutter.junixsocket</groupId>
125+
<artifactId>junixsocket-native-common</artifactId>
126+
<version>${junixsocket.version}</version>
121127
</dependency>
122-
123128
<dependency>
124129
<groupId>org.apache.commons</groupId>
125130
<artifactId>commons-compress</artifactId>
@@ -266,13 +271,6 @@
266271
</distributionManagement>
267272

268273
<build>
269-
<!-- <extensions> -->
270-
<!-- <extension> -->
271-
<!-- <groupId>kr.motd.maven</groupId> -->
272-
<!-- <artifactId>os-maven-plugin</artifactId> -->
273-
<!-- <version>1.2.3.Final</version> -->
274-
<!-- </extension> -->
275-
<!-- </extensions> -->
276274
<pluginManagement>
277275
<plugins>
278276

@@ -419,7 +417,7 @@
419417
<perCoreThreadCount>true</perCoreThreadCount>
420418
<threadCount>1</threadCount>
421419
<groups>integration</groups>
422-
<excludedGroups>integration-auth</excludedGroups>
420+
<excludedGroups>integration-auth</excludedGroups>
423421
<includes>
424422
<include>**/*Test.java</include>
425423
</includes>
@@ -483,7 +481,8 @@
483481
<failOnViolation>true</failOnViolation>
484482
<logViolationsToConsole>true</logViolationsToConsole>
485483
<linkXRef>false</linkXRef>
486-
<!-- if some IDE has integration and requires other place, propose it -->
484+
<!-- if some IDE has integration and requires other place, propose
485+
it -->
487486
<configLocation>
488487
src/test/resources/checkstyle/checkstyle-config.xml
489488
</configLocation>

src/main/java/com/github/dockerjava/core/async/ResultCallbackTemplate.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,13 @@ public void onComplete() {
7575

7676
@Override
7777
public void close() throws IOException {
78-
closed = true;
79-
if (stream != null) {
80-
stream.close();
78+
if (!closed) {
79+
closed = true;
80+
if (stream != null) {
81+
stream.close();
82+
}
83+
completed.countDown();
8184
}
82-
completed.countDown();
8385
}
8486

8587
/**

src/main/java/com/github/dockerjava/jaxrs/util/WrappedResponseInputStream.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ public int available() throws IOException {
5353
}
5454

5555
public void close() throws IOException {
56+
if (closed) {
57+
return;
58+
}
5659
closed = true;
57-
response.close();
5860
delegate.close();
61+
response.close();
5962
}
6063

6164
public void mark(int readlimit) {

0 commit comments

Comments
 (0)