Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd7fb4cc

Browse files
author
oleksiys
committed
[1.8.x] + close the transaction, if connection is closed locally
1 parent25002d5 commitd7fb4cc

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎src/main/java/com/ning/http/client/providers/grizzly/FeedableBodyGenerator.java‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2014 Sonatype, Inc. All rights reserved.
2+
* Copyright (c) 2012-2015 Sonatype, Inc. All rights reserved.
33
*
44
* This program is licensed to you under the Apache License Version 2.0,
55
* and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -38,6 +38,7 @@
3838
importstaticjava.lang.Boolean.TRUE;
3939
importstaticjava.util.concurrent.TimeUnit.MILLISECONDS;
4040
importstaticorg.glassfish.grizzly.ssl.SSLUtils.getSSLEngine;
41+
importorg.glassfish.grizzly.utils.Exceptions;
4142
importstaticorg.glassfish.grizzly.utils.Exceptions.*;
4243

4344
/**
@@ -215,6 +216,10 @@ private void flushOnSSLHandshakeComplete() throws IOException {
215216
publicvoidonStart(Connectionconnection) {
216217
}
217218

219+
publicvoidonFailure(Connectionconnection,Throwablet) {
220+
connection.closeWithReason(Exceptions.makeIOException(t));
221+
}
222+
218223
publicvoidonComplete(Connectionconnection) {
219224
if (c.equals(connection)) {
220225
filter.removeHandshakeListener(this);
@@ -225,10 +230,6 @@ public void onComplete(Connection connection) {
225230
}
226231
}
227232
}
228-
229-
publicvoidonFailure(Connectionconnection,Throwablet) {
230-
231-
}
232233
});
233234
filter.handshake(context.getConnection(),null);
234235
}

‎src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012-2014 Sonatype, Inc. All rights reserved.
2+
* Copyright (c) 2012-2015 Sonatype, Inc. All rights reserved.
33
*
44
* This program is licensed to you under the Apache License Version 2.0,
55
* and you may not use this file except in compliance with the Apache License Version 2.0.
@@ -658,6 +658,12 @@ public void onClosed(Closeable closeable, CloseType type) throws IOException {
658658
newGracefulCloseEvent(HttpTransactionContext.this),null);
659659
}elseif (CloseType.REMOTELY.equals(type)) {
660660
abort(REMOTELY_CLOSED_EXCEPTION);
661+
}else {
662+
try {
663+
closeable.assertOpen();
664+
}catch (IOExceptionioe) {
665+
abort(ioe);
666+
}
661667
}
662668
}
663669
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp