135
135
import java .util .concurrent .atomic .AtomicInteger ;
136
136
import java .util .concurrent .atomic .AtomicLong ;
137
137
138
+ import static com .ning .http .client .providers .grizzly .GrizzlyAsyncHttpProviderConfig .Property .MAX_HTTP_PACKET_HEADER_SIZE ;
138
139
import static com .ning .http .client .providers .grizzly .GrizzlyAsyncHttpProviderConfig .Property .TRANSPORT_CUSTOMIZER ;
139
140
140
141
/**
@@ -370,8 +371,14 @@ public void onTimeout(Connection connection) {
370
371
false );
371
372
final SwitchingSSLFilter filter = new SwitchingSSLFilter (configurator , defaultSecState );
372
373
fcb .add (filter );
373
- final AsyncHttpClientEventFilter eventFilter = new
374
- AsyncHttpClientEventFilter (this );
374
+ GrizzlyAsyncHttpProviderConfig providerConfig =
375
+ (GrizzlyAsyncHttpProviderConfig ) clientConfig .getAsyncHttpProviderConfig ();
376
+ final AsyncHttpClientEventFilter eventFilter ;
377
+ if (providerConfig != null ) {
378
+ eventFilter = new AsyncHttpClientEventFilter (this , (Integer ) providerConfig .getProperty (MAX_HTTP_PACKET_HEADER_SIZE ));
379
+ } else {
380
+ eventFilter = new AsyncHttpClientEventFilter (this );
381
+ }
375
382
final AsyncHttpClientFilter clientFilter =
376
383
new AsyncHttpClientFilter (clientConfig );
377
384
ContentEncoding [] encodings = eventFilter .getContentEncodings ();
@@ -389,8 +396,6 @@ public void onTimeout(Connection connection) {
389
396
fcb .add (eventFilter );
390
397
fcb .add (clientFilter );
391
398
392
- GrizzlyAsyncHttpProviderConfig providerConfig =
393
- (GrizzlyAsyncHttpProviderConfig ) clientConfig .getAsyncHttpProviderConfig ();
394
399
if (providerConfig != null ) {
395
400
final TransportCustomizer customizer = (TransportCustomizer )
396
401
providerConfig .getProperty (TRANSPORT_CUSTOMIZER );
@@ -1070,7 +1075,14 @@ private static final class AsyncHttpClientEventFilter extends HttpClientFilter {
1070
1075
1071
1076
1072
1077
AsyncHttpClientEventFilter (final GrizzlyAsyncHttpProvider provider ) {
1078
+ this (provider , DEFAULT_MAX_HTTP_PACKET_HEADER_SIZE );
1079
+ }
1080
+
1081
+
1082
+ AsyncHttpClientEventFilter (final GrizzlyAsyncHttpProvider provider ,
1083
+ final int maxHeaderSize ) {
1073
1084
1085
+ super (maxHeaderSize );
1074
1086
this .provider = provider ;
1075
1087
HANDLER_MAP .put (HttpStatus .UNAUTHORIZED_401 .getStatusCode (),
1076
1088
AuthorizationHandler .INSTANCE );
0 commit comments