@@ -69,8 +69,11 @@ private static void getPoolInstance() {
6969 .register ("http" , PlainConnectionSocketFactory .INSTANCE ).register ("https" , getSSLSecureInstance ())
7070 .build ();
7171 connManager = new PoolingHttpClientConnectionManager (socketFactoryRegistry );
72- connManager .setMaxTotal ((int ) CommonUtil .val (clientCfg .getProperty ("Client" ,"HTTPCLIENT_MAX_SIZE" ,"1000" )));
73- connManager .setDefaultMaxPerRoute ((int ) CommonUtil .val (clientCfg .getProperty ("Client" ,"HTTPCLIENT_MAX_PER_ROUTE" ,"1000" )));
72+ connManager .setMaxTotal ((int ) CommonUtil .val (clientCfg .getProperty ("Client" , "HTTPCLIENT_MAX_SIZE" , "1000" )));
73+ connManager .setDefaultMaxPerRoute ((int ) CommonUtil .val (clientCfg .getProperty ("Client" , "HTTPCLIENT_MAX_PER_ROUTE" , "1000" )));
74+ }
75+ else {
76+ connManager .closeExpiredConnections ();
7477 }
7578 }
7679
@@ -277,7 +280,13 @@ private void SetCookieAtr(CookieStore cookiesToSend) {
277280 for (Header header : headers ) {
278281 String [] cookieParts = header .getValue ().split (";" );
279282 String [] cookieKeyAndValue = cookieParts [0 ].split ("=" );
280- webcontextCookieHeader += cookieKeyAndValue [0 ] + "=" + cookieKeyAndValue [1 ] + "; " ;
283+ webcontextCookieHeader += cookieKeyAndValue [0 ];
284+ if (cookieKeyAndValue .length > 1 ) {
285+ webcontextCookieHeader += "=" + cookieKeyAndValue [1 ] + "; " ;
286+ }
287+ else {
288+ webcontextCookieHeader += "; " ;
289+ }
281290 }
282291 webcontextCookieHeader = webcontextCookieHeader .trim ().substring (0 ,webcontextCookieHeader .length ()-2 ); // Se quita el espacio y la coma al final
283292 webcontext .setCookie (SET_COOKIE ,webcontextCookieHeader ,"" ,CommonUtil .nullDate (),"" ,this .getSecure ());
0 commit comments