[GitHub] [httpcomponents-client] niranjanghule opened a new pull request, #361: Remove unused code

2022-05-04 Thread GitBox


niranjanghule opened a new pull request, #361:
URL: https://github.com/apache/httpcomponents-client/pull/361

   Removed dead code from testcase.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] niranjanghule closed pull request #360: Refactor code

2022-05-04 Thread GitBox


niranjanghule closed pull request #360: Refactor code
URL: https://github.com/apache/httpcomponents-client/pull/360


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] niranjanghule commented on pull request #360: Refactor code

2022-05-04 Thread GitBox


niranjanghule commented on PR #360:
URL: 
https://github.com/apache/httpcomponents-client/pull/360#issuecomment-1118093964

   I'll raise another PR. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-2212) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread Lubos Husivarga (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531915#comment-17531915
 ] 

Lubos Husivarga commented on HTTPCLIENT-2212:
-

Tested and working fine.

Thank you [~olegk] again for quick response and fix!

All the best,
Lubos

> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCLIENT-2212
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2212
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (async)
>Affects Versions: 5.1.3, 5.2-alpha1
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c commented on pull request #360: Refactor code

2022-05-04 Thread GitBox


ok2c commented on PR #360:
URL: 
https://github.com/apache/httpcomponents-client/pull/360#issuecomment-1117742717

   @niranjanghule Your change to `DefaultRedirectStrategy` break the build due 
to API breakage. I cannot commit it. I could merge 2364def though.
   
   Oleg


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-2212) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531904#comment-17531904
 ] 

Oleg Kalnichevski commented on HTTPCLIENT-2212:
---

[~lhusivarga]  Please review / test the proposed fix:

[https://github.com/apache/httpcomponents-client/commit/830adcd254e6b7be305c112ca004720c0d14d887]

Oleg

> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCLIENT-2212
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2212
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (async)
>Affects Versions: 5.1.3, 5.2-alpha1
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCLIENT-2212) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531903#comment-17531903
 ] 

ASF subversion and git services commented on HTTPCLIENT-2212:
-

Commit 830adcd254e6b7be305c112ca004720c0d14d887 in httpcomponents-client's 
branch refs/heads/HTTPCLIENT-2212 from Oleg Kalnichevski
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-client.git;h=830adcd25 ]

HTTPCLIENT-2212: MinimalHttpAsyncClient fails to release client endpoints in 
case of a connect error (such as TLS handshake failure)


> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCLIENT-2212
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2212
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (async)
>Affects Versions: 5.1.3, 5.2-alpha1
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Moved] (HTTPCLIENT-2212) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread Oleg Kalnichevski (Jira)


 [ 
https://issues.apache.org/jira/browse/HTTPCLIENT-2212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski moved HTTPCORE-712 to HTTPCLIENT-2212:


  Component/s: HttpClient (async)
   (was: HttpCore NIO)
  Key: HTTPCLIENT-2212  (was: HTTPCORE-712)
Affects Version/s: 5.2-alpha1
   5.1.3
   (was: 5.2-alpha1)
 Workflow: Default workflow, editable Closed status  (was: classic 
default workflow)
  Project: HttpComponents HttpClient  (was: HttpComponents HttpCore)

> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCLIENT-2212
> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2212
> Project: HttpComponents HttpClient
>  Issue Type: Bug
>  Components: HttpClient (async)
>Affects Versions: 5.2-alpha1, 5.1.3
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-712) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531901#comment-17531901
 ] 

Oleg Kalnichevski commented on HTTPCORE-712:


[~lhusivarga] The defect is actually in HttpClient, not HttpCore.

Oleg

> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCORE-712
> URL: https://issues.apache.org/jira/browse/HTTPCORE-712
> Project: HttpComponents HttpCore
>  Issue Type: Bug
>  Components: HttpCore NIO
>Affects Versions: 5.2-alpha1
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] niranjanghule opened a new pull request, #360: Refactor method signature

2022-05-04 Thread GitBox


niranjanghule opened a new pull request, #360:
URL: https://github.com/apache/httpcomponents-client/pull/360

   The method never throws ProtocolException. Hence removed it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Resolved] (HTTPCORE-713) Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread Oleg Kalnichevski (Jira)


 [ 
https://issues.apache.org/jira/browse/HTTPCORE-713?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Oleg Kalnichevski resolved HTTPCORE-713.

Fix Version/s: 5.1.4
   5.2-beta2
   Resolution: Fixed

> Optimize InetAddressUtils#isIPv6*Address checks
> ---
>
> Key: HTTPCORE-713
> URL: https://issues.apache.org/jira/browse/HTTPCORE-713
> Project: HttpComponents HttpCore
>  Issue Type: Improvement
>  Components: HttpCore
>Reporter: David Schlosnagle
>Priority: Major
> Fix For: 5.1.4, 5.2-beta2
>
> Attachments: 166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> See https://github.com/apache/httpcomponents-core/pull/347
> Check input colon count before performing IPv6 regex validation.
> {{org.apache.hc.core5.net.InetAddressUtils.isIPv6Address}} is used when 
> constructing the {{host}} header for requests, and currently allocates a 
> regex matcher when checking if the provided address is an IPv6 address. This 
> is generates excess garbage and CPU cycles, especially in environments with 
> mostly IPv4 addresses. By checking the colon count first, we see a 50x 
> improvement checking {{InetAddressUtils.isIPv6Address}} for an IPv4 address.
> The specific call backtrace seen looks like:
> {code:java}
> void java.util.regex.Matcher.(Pattern, CharSequence)
>    Matcher java.util.regex.Pattern.matcher(CharSequence)
>    boolean 
> org.apache.hc.core5.net.InetAddressUtils.isIPv6HexCompressedAddress(String)
>       boolean org.apache.hc.core5.net.InetAddressUtils.isIPv6Address(String)
>       void org.apache.hc.core5.net.Host.format(StringBuilder, NamedEndpoint)
>       void org.apache.hc.core5.net.URIAuthority.format(StringBuilder, 
> URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.format(URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.toString()
>          String java.util.Objects.toString(Object, String)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object, boolean)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object)
>          void 
> org.apache.hc.core5.http.message.BasicHttpRequest.addHeader(String, Object)
>          void 
> org.apache.hc.core5.http.protocol.RequestTargetHost.process(HttpRequest, 
> EntityDetails, HttpContext)
>          void 
> org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(HttpRequest, 
> EntityDetails, HttpContext)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(HttpHost,
>  ClassicHttpRequest, HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest,
>  HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest)
> {code}
> From JFR profile: 
> !166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png! 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-client] ok2c merged pull request #359: Updated copyright statement in NOTICE.txt

2022-05-04 Thread GitBox


ok2c merged PR #359:
URL: https://github.com/apache/httpcomponents-client/pull/359


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #347: HTTPCORE-713 - Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread GitBox


ok2c commented on PR #347:
URL: 
https://github.com/apache/httpcomponents-core/pull/347#issuecomment-1116989561

   Ported to `5.1.x`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-713) Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531521#comment-17531521
 ] 

ASF subversion and git services commented on HTTPCORE-713:
--

Commit ece5876b65fad1a5ea0bf7985abc1b9aba1e08ac in httpcomponents-core's branch 
refs/heads/master from David Schlosnagle
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=ece5876b6 ]

HTTPCORE-713: Optimize InetAddressUtils#isIPv6*Address

Check input colon count before performing IPv6 regex validation


> Optimize InetAddressUtils#isIPv6*Address checks
> ---
>
> Key: HTTPCORE-713
> URL: https://issues.apache.org/jira/browse/HTTPCORE-713
> Project: HttpComponents HttpCore
>  Issue Type: Improvement
>  Components: HttpCore
>Reporter: David Schlosnagle
>Priority: Major
> Attachments: 166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> See https://github.com/apache/httpcomponents-core/pull/347
> Check input colon count before performing IPv6 regex validation.
> {{org.apache.hc.core5.net.InetAddressUtils.isIPv6Address}} is used when 
> constructing the {{host}} header for requests, and currently allocates a 
> regex matcher when checking if the provided address is an IPv6 address. This 
> is generates excess garbage and CPU cycles, especially in environments with 
> mostly IPv4 addresses. By checking the colon count first, we see a 50x 
> improvement checking {{InetAddressUtils.isIPv6Address}} for an IPv4 address.
> The specific call backtrace seen looks like:
> {code:java}
> void java.util.regex.Matcher.(Pattern, CharSequence)
>    Matcher java.util.regex.Pattern.matcher(CharSequence)
>    boolean 
> org.apache.hc.core5.net.InetAddressUtils.isIPv6HexCompressedAddress(String)
>       boolean org.apache.hc.core5.net.InetAddressUtils.isIPv6Address(String)
>       void org.apache.hc.core5.net.Host.format(StringBuilder, NamedEndpoint)
>       void org.apache.hc.core5.net.URIAuthority.format(StringBuilder, 
> URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.format(URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.toString()
>          String java.util.Objects.toString(Object, String)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object, boolean)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object)
>          void 
> org.apache.hc.core5.http.message.BasicHttpRequest.addHeader(String, Object)
>          void 
> org.apache.hc.core5.http.protocol.RequestTargetHost.process(HttpRequest, 
> EntityDetails, HttpContext)
>          void 
> org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(HttpRequest, 
> EntityDetails, HttpContext)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(HttpHost,
>  ClassicHttpRequest, HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest,
>  HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest)
> {code}
> From JFR profile: 
> !166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png! 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-713) Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread ASF subversion and git services (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531519#comment-17531519
 ] 

ASF subversion and git services commented on HTTPCORE-713:
--

Commit c6dfb03a1c74cda8a1905f006efc640b680db886 in httpcomponents-core's branch 
refs/heads/5.1.x from David Schlosnagle
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=c6dfb03a1 ]

HTTPCORE-713: Optimize InetAddressUtils#isIPv6*Address

Check input colon count before performing IPv6 regex validation


> Optimize InetAddressUtils#isIPv6*Address checks
> ---
>
> Key: HTTPCORE-713
> URL: https://issues.apache.org/jira/browse/HTTPCORE-713
> Project: HttpComponents HttpCore
>  Issue Type: Improvement
>  Components: HttpCore
>Reporter: David Schlosnagle
>Priority: Major
> Attachments: 166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png
>
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> See https://github.com/apache/httpcomponents-core/pull/347
> Check input colon count before performing IPv6 regex validation.
> {{org.apache.hc.core5.net.InetAddressUtils.isIPv6Address}} is used when 
> constructing the {{host}} header for requests, and currently allocates a 
> regex matcher when checking if the provided address is an IPv6 address. This 
> is generates excess garbage and CPU cycles, especially in environments with 
> mostly IPv4 addresses. By checking the colon count first, we see a 50x 
> improvement checking {{InetAddressUtils.isIPv6Address}} for an IPv4 address.
> The specific call backtrace seen looks like:
> {code:java}
> void java.util.regex.Matcher.(Pattern, CharSequence)
>    Matcher java.util.regex.Pattern.matcher(CharSequence)
>    boolean 
> org.apache.hc.core5.net.InetAddressUtils.isIPv6HexCompressedAddress(String)
>       boolean org.apache.hc.core5.net.InetAddressUtils.isIPv6Address(String)
>       void org.apache.hc.core5.net.Host.format(StringBuilder, NamedEndpoint)
>       void org.apache.hc.core5.net.URIAuthority.format(StringBuilder, 
> URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.format(URIAuthority)
>          String org.apache.hc.core5.net.URIAuthority.toString()
>          String java.util.Objects.toString(Object, String)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object, boolean)
>          void org.apache.hc.core5.http.message.BasicHeader.(String, 
> Object)
>          void 
> org.apache.hc.core5.http.message.BasicHttpRequest.addHeader(String, Object)
>          void 
> org.apache.hc.core5.http.protocol.RequestTargetHost.process(HttpRequest, 
> EntityDetails, HttpContext)
>          void 
> org.apache.hc.core5.http.protocol.DefaultHttpProcessor.process(HttpRequest, 
> EntityDetails, HttpContext)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ProtocolExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement$1.proceed(ClassicHttpRequest,
>  ExecChain$Scope)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.RedirectExec.execute(ClassicHttpRequest,
>  ExecChain$Scope, ExecChain)
>          ClassicHttpResponse 
> org.apache.hc.client5.http.impl.classic.ExecChainElement.execute(ClassicHttpRequest,
>  ExecChain$Scope)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.InternalHttpClient.doExecute(HttpHost,
>  ClassicHttpRequest, HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest,
>  HttpContext)
>          CloseableHttpResponse 
> org.apache.hc.client5.http.impl.classic.CloseableHttpClient.execute(ClassicHttpRequest)
> {code}
> From JFR profile: 
> !166573589-2c814d53-9639-4b14-82d0-9238f285be0b.png! 



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c merged pull request #347: HTTPCORE-713 - Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread GitBox


ok2c merged PR #347:
URL: https://github.com/apache/httpcomponents-core/pull/347


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[GitHub] [httpcomponents-core] ok2c commented on pull request #347: HTTPCORE-713 - Optimize InetAddressUtils#isIPv6*Address checks

2022-05-04 Thread GitBox


ok2c commented on PR #347:
URL: 
https://github.com/apache/httpcomponents-core/pull/347#issuecomment-1116980251

   @schlosna Awesome!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-712) AsyncClientEndpoint is not released upon lease failure

2022-05-04 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-712?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531508#comment-17531508
 ] 

Oleg Kalnichevski commented on HTTPCORE-712:


[~lhusivarga] I will look into it shortly.

Oleg

> AsyncClientEndpoint is not released upon lease failure
> --
>
> Key: HTTPCORE-712
> URL: https://issues.apache.org/jira/browse/HTTPCORE-712
> Project: HttpComponents HttpCore
>  Issue Type: Bug
>  Components: HttpCore NIO
>Affects Versions: 5.2-alpha1
>Reporter: Lubos Husivarga
>Priority: Major
>
> When I use AsyncHttpClient and try to lease an endpoint to host 
> "https://localhost;, I receive javax.net.ssl.SSLHandshakeException exception 
> via callback's failed method. That's ok, because my localhost certificate is 
> not signed by authority.
> The strange thing is that the endpoint is allocated from 
> PoolingAsyncClientConnectionManager, but not released after the connection 
> failure during the endpoint lease operation.
> There is no way to release the endpoint from callback failed method, because 
> there is no reference to it.
> Failing the lease multiple times consumes all available connections from 
> connection manager pool and any further lease operation remains in pending 
> state preventing any other connections to the host.
> example:
>  
> {code:java}
> httpManager = PoolingAsyncClientConnectionManagerBuilder.create()
>         .setDefaultConnectionConfig(ConnectionConfig.custom()
>                 .setTimeToLive(TimeValue.NEG_ONE_MILLISECOND)    //TTL is 
> maximum time one connection can be used,
>                         //then it is closed and new one is opened. Therefore 
> -1 disables TTL and same connection lasts until
>                         //it is actively used. Then closed by 
> IdleConnectionEvictor thread.
>                 .build())
>         .setDefaultTlsConfig(TlsConfig.custom()
>                 .setVersionPolicy(HttpVersionPolicy.NEGOTIATE)
>                 .build())
>         .build();
> httpClient = HttpAsyncClients.createMinimal(
>         H2Config.DEFAULT,
>         Http1Config.DEFAULT,
>         IOReactorConfig.DEFAULT,
>         httpManager);
> httpClient.start();
>  
> HttpHost host = new HttpHost("https", "localhost", 443);
> httpClient.lease(host, new FutureCallback() {
>                             @Override
>                             public void failed(Exception ex) {
>                             }
>                             
>                             @Override
>                             public void completed(AsyncClientEndpoint result) 
> {
>                             }
>                             
>                             @Override
>                             public void cancelled() {
>                             }
>                         });
>  
> Set routes = httpManager.getRoutes();
>         List stats = new ArrayList(routes.size());
>         
>         for(HttpRoute route : routes){
>             PoolStats s = httpManager.getStats(route);
>             System.out.println(route.getTargetHost().getHostName());
>             System.out.println(s.getAvailable());
>             System.out.println(s.getLeased());
>             System.out.println(s.getMax());
>             System.out.println(s.getPending());
>         }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org



[jira] [Commented] (HTTPCORE-711) Integration of httpcomponents-core into OSS-Fuzz

2022-05-04 Thread Oleg Kalnichevski (Jira)


[ 
https://issues.apache.org/jira/browse/HTTPCORE-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17531507#comment-17531507
 ] 

Oleg Kalnichevski commented on HTTPCORE-711:


[~onionpsy]  Ideally all communication should happen on 
[dev@hc.apache.org|mailto:dev@hc.apache.org], not directly with individual 
project committers. This is a general ASF policy.

Oleg

> Integration of httpcomponents-core into OSS-Fuzz
> 
>
> Key: HTTPCORE-711
> URL: https://issues.apache.org/jira/browse/HTTPCORE-711
> Project: HttpComponents HttpCore
>  Issue Type: Test
>  Components: HttpCore
>Reporter: Patrice
>Priority: Minor
>
> Hi all,
> I have prepared the initial integration 
> [https://github.com/CodeIntelligenceTesting/oss-fuzz/commit/88316189c9c57b7846e1bc78cf23b70e6087093e]
>  of httpcomponents-core into [google 
> oss-fuzz|https://github.com/google/oss-fuzz]. This will enable continuous 
> fuzzing of this project, which will be conducted by Google. Bugs that will be 
> found by fuzzing will be reported to you. After the initial integration of 
> this project into oss-fuzz, I will continue to add additional fuzz tests to 
> improve the code coverage over time.
> The integration requires a primary contact, someone to deal with the bug 
> reports submitted by oss-fuzz. The email address needs to belong to an 
> established project committer and be associated with a Google account as per 
> [here|https://google.github.io/oss-fuzz/getting-started/accepting-new-projects/].
>  When a bug is found, you will receive an email that will provide you with 
> access to ClusterFuzz, crash reports, and fuzzer statistics. More than 1 
> person can be included. Please let me know who I should include, if anyone.
> [Jazzer|https://github.com/CodeIntelligenceTesting/jazzer] is used for 
> fuzzing Java applications. Jazzer is a coverage-guided, in-process fuzzer for 
> the JVM platform developed by Code Intelligence. It is based on libFuzzer and 
> brings many of its instrumentation-powered mutation features to the JVM. 
> Jazzer has already found several bugs in JVM applications: [Jazzer 
> Findings|https://github.com/CodeIntelligenceTesting/jazzer#findings]
> Please let me know if you have any questions regarding fuzzing or the 
> oss-fuzz integration.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

-
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org