Skip to content

Commit e84ee12

Browse files
author
oleksiys
committed
[master] + fix the issue #559
#559 GrizzlyAsyncHttpProvider hangs on Exception #559
1 parent 3c56c7f commit e84ee12

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/EventHandler.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,14 @@ public void onInitialLineParsed(HttpHeader httpHeader, FilterChainContext ctx) {
196196

197197
public void onHttpHeaderError(final HttpHeader httpHeader, final FilterChainContext ctx, final Throwable t) {
198198

199-
t.printStackTrace();
200199
httpHeader.setSkipRemainder(true);
201-
final HttpTxContext context = HttpTxContext.get(ctx);
202-
context.abort(t);
200+
HttpTxContext.get(ctx).abort(t);
201+
}
202+
203+
public void onHttpContentError(final HttpHeader httpHeader, final FilterChainContext ctx, final Throwable t) {
204+
205+
httpHeader.setSkipRemainder(true);
206+
HttpTxContext.get(ctx).abort(t);
203207
}
204208

205209
@SuppressWarnings({ "unchecked" })

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/filters/AsyncHttpClientEventFilter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ protected void onHttpHeaderError(HttpHeader httpHeader, FilterChainContext ctx,
101101
eventHandler.onHttpHeaderError(httpHeader, ctx, t);
102102
}
103103

104+
@Override
105+
protected void onHttpContentError(HttpHeader httpHeader, FilterChainContext ctx, Throwable t) throws IOException {
106+
eventHandler.onHttpContentError(httpHeader, ctx, t);
107+
}
108+
104109
@Override
105110
protected void onHttpHeadersParsed(HttpHeader httpHeader, FilterChainContext ctx) {
106111
eventHandler.onHttpHeadersParsed(httpHeader, ctx);

providers/grizzly/src/main/java/org/asynchttpclient/providers/grizzly/filters/AsyncSpdyClientEventFilter.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013 Sonatype, Inc. All rights reserved.
2+
* Copyright (c) 2013-2014 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.
@@ -72,6 +72,12 @@ protected void onHttpHeaderError(HttpHeader httpHeader, FilterChainContext ctx,
7272
eventHandler.onHttpHeaderError(httpHeader, ctx, t);
7373
}
7474

75+
@Override
76+
protected void onHttpContentError(HttpHeader httpHeader, FilterChainContext ctx, Throwable t) throws IOException {
77+
eventHandler.onHttpContentError(httpHeader, ctx, t);
78+
}
79+
80+
7581
@Override
7682
protected void onHttpHeadersParsed(HttpHeader httpHeader, FilterChainContext ctx) {
7783
eventHandler.onHttpHeadersParsed(httpHeader, ctx);

0 commit comments

Comments
 (0)