15
15
*/
16
16
package com .ning .http .client ;
17
17
18
+ import com .ning .http .client .date .TimeConverter ;
18
19
import com .ning .http .client .filter .IOExceptionFilter ;
19
20
import com .ning .http .client .filter .RequestFilter ;
20
21
import com .ning .http .client .filter .ResponseFilter ;
24
25
import javax .net .ssl .HostnameVerifier ;
25
26
import javax .net .ssl .SSLContext ;
26
27
import javax .net .ssl .SSLEngine ;
28
+
27
29
import java .security .GeneralSecurityException ;
28
30
import java .util .Collections ;
29
31
import java .util .LinkedList ;
@@ -84,7 +86,7 @@ public class AsyncHttpClientConfig {
84
86
protected boolean strict302Handling ;
85
87
protected boolean useRelativeURIsWithSSLProxies ;
86
88
protected int maxConnectionLifeTimeInMs ;
87
- protected boolean rfc6265CookieEncoding ;
89
+ protected TimeConverter timeConverter ;
88
90
89
91
protected AsyncHttpClientConfig () {
90
92
}
@@ -120,7 +122,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
120
122
int ioThreadMultiplier ,
121
123
boolean strict302Handling ,
122
124
boolean useRelativeURIsWithSSLProxies ,
123
- boolean rfc6265CookieEncoding ) {
125
+ TimeConverter timeConverter ) {
124
126
125
127
this .maxTotalConnections = maxTotalConnections ;
126
128
this .maxConnectionPerHost = maxConnectionPerHost ;
@@ -151,7 +153,6 @@ private AsyncHttpClientConfig(int maxTotalConnections,
151
153
this .ioThreadMultiplier = ioThreadMultiplier ;
152
154
this .strict302Handling = strict302Handling ;
153
155
this .useRelativeURIsWithSSLProxies = useRelativeURIsWithSSLProxies ;
154
- this .rfc6265CookieEncoding = rfc6265CookieEncoding ;
155
156
156
157
if (applicationThreadPool == null ) {
157
158
this .applicationThreadPool = Executors .newCachedThreadPool ();
@@ -160,6 +161,7 @@ private AsyncHttpClientConfig(int maxTotalConnections,
160
161
}
161
162
this .proxyServerSelector = proxyServerSelector ;
162
163
this .useRawUrl = useRawUrl ;
164
+ this .timeConverter = timeConverter ;
163
165
}
164
166
165
167
/**
@@ -512,13 +514,10 @@ public int getMaxConnectionLifeTimeInMs() {
512
514
}
513
515
514
516
/**
515
- * @return<code>true</code> if AHC should use rfc6265 for encoding client side cookies,
516
- * otherwise <code>false</code>.
517
- *
518
- * @since 1.7.18
517
+ * @return 1.8.2
519
518
*/
520
- public boolean isRfc6265CookieEncoding () {
521
- return rfc6265CookieEncoding ;
519
+ public TimeConverter getTimeConverter () {
520
+ return timeConverter ;
522
521
}
523
522
524
523
/**
@@ -559,7 +558,7 @@ public static class Builder {
559
558
private HostnameVerifier hostnameVerifier = new AllowAllHostnameVerifier ();
560
559
private int ioThreadMultiplier = 2 ;
561
560
private boolean strict302Handling ;
562
- private boolean rfc6265CookieEncoding ;
561
+ private TimeConverter timeConverter ;
563
562
564
563
public Builder () {
565
564
}
@@ -1029,17 +1028,8 @@ public Builder setMaxConnectionLifeTimeInMs(int maxConnectionLifeTimeInMs) {
1029
1028
return this ;
1030
1029
}
1031
1030
1032
- /**
1033
- * Configures this AHC instance to use RFC 6265 cookie encoding style
1034
- *
1035
- * @param rfc6265CookieEncoding
1036
- * @return this
1037
- *
1038
- * @since 1.7.18
1039
- */
1040
- public Builder setRfc6265CookieEncoding (boolean rfc6265CookieEncoding ) {
1041
- this .rfc6265CookieEncoding = rfc6265CookieEncoding ;
1042
- return this ;
1031
+ public void setTimeConverter (TimeConverter timeConverter ) {
1032
+ this .timeConverter = timeConverter ;
1043
1033
}
1044
1034
1045
1035
/**
@@ -1084,7 +1074,7 @@ public Builder(AsyncHttpClientConfig prototype) {
1084
1074
removeQueryParamOnRedirect = prototype .isRemoveQueryParamOnRedirect ();
1085
1075
hostnameVerifier = prototype .getHostnameVerifier ();
1086
1076
strict302Handling = prototype .isStrict302Handling ();
1087
- rfc6265CookieEncoding = prototype .isRfc6265CookieEncoding () ;
1077
+ timeConverter = prototype .timeConverter ;
1088
1078
}
1089
1079
1090
1080
/**
@@ -1149,7 +1139,7 @@ public Thread newThread(Runnable r) {
1149
1139
ioThreadMultiplier ,
1150
1140
strict302Handling ,
1151
1141
useRelativeURIsWithSSLProxies ,
1152
- rfc6265CookieEncoding );
1142
+ timeConverter );
1153
1143
}
1154
1144
}
1155
1145
}
0 commit comments