[jira] [Issue Comment Deleted] (HTTPCLIENT-1618) EntityUtils toByteArray EOFException

2015-03-01 Thread guor (JIRA)

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

guor updated HTTPCLIENT-1618:
-
Comment: was deleted

(was: But how can I handle this exception? I don't know how to deal with the 
stream I got. Is there any sample code?)

 EntityUtils toByteArray EOFException
 

 Key: HTTPCLIENT-1618
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1618
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpClient
Affects Versions: 4.3.5, 4.3.6, 4.4 Final
 Environment: jdk1.7
Reporter: guor

 when I visit website below `http://club.kdnet.net`, such as 
 `http://club.kdnet.net/dispbbs.asp?id=10731573boardid=1`, I got 
 java.io.EOFException, the full exception stack as below:
 Exception in thread main java.io.EOFException
   at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:264)
   at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:254)
   at java.util.zip.GZIPInputStream.readUInt(GZIPInputStream.java:246)
   at java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:218)
   at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:118)
   at java.io.FilterInputStream.read(FilterInputStream.java:107)
   at 
 org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:67)
   at org.apache.http.util.EntityUtils.toByteArray(EntityUtils.java:136)
   at demo.Test.main(Test.java:19)
 This happens at httpclient4.3.5/httpclient4.3.6/httpclient4.4, but It's OK in 
 commons-httpclient3.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Reopened] (HTTPCLIENT-1618) EntityUtils toByteArray EOFException

2015-03-01 Thread guor (JIRA)

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

guor reopened HTTPCLIENT-1618:
--

But how can I handle this exception with HC 4.X? I don't know how to deal with 
the stream I got. Is there any sample code?

 EntityUtils toByteArray EOFException
 

 Key: HTTPCLIENT-1618
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1618
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpClient
Affects Versions: 4.3.5, 4.3.6, 4.4 Final
 Environment: jdk1.7
Reporter: guor

 when I visit website below `http://club.kdnet.net`, such as 
 `http://club.kdnet.net/dispbbs.asp?id=10731573boardid=1`, I got 
 java.io.EOFException, the full exception stack as below:
 Exception in thread main java.io.EOFException
   at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:264)
   at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:254)
   at java.util.zip.GZIPInputStream.readUInt(GZIPInputStream.java:246)
   at java.util.zip.GZIPInputStream.readTrailer(GZIPInputStream.java:218)
   at java.util.zip.GZIPInputStream.read(GZIPInputStream.java:118)
   at java.io.FilterInputStream.read(FilterInputStream.java:107)
   at 
 org.apache.http.client.entity.LazyDecompressingInputStream.read(LazyDecompressingInputStream.java:67)
   at org.apache.http.util.EntityUtils.toByteArray(EntityUtils.java:136)
   at demo.Test.main(Test.java:19)
 This happens at httpclient4.3.5/httpclient4.3.6/httpclient4.4, but It's OK in 
 commons-httpclient3.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



Need clarification on the auth backend design for HTTPCLIENT-1625

2015-03-01 Thread Michael Osipov

Hi folks,

I need some design clarification on the HttpClient auth backend.

Currently, I trying to figure out how I can plug in connection-based 
auth best into the code. From reading the docs and the code, this is 
what I understood now:
Client receives a 401/407, looks up the best available 
AuthSchemeProvider for that. This one creates a scheme implementation 
instance which does all the hard work.


Given that I have a connection-based auth, I need to be sure that the 
created instance is maintained on the HTTP connection, refed on the same 
connection when I receive the mutual response from the server back and 
then finally disposed (important) when I return isCompleted == true. 
This instance is internally stateful and must be stateful. It must also 
disposed when the authentication has failed for some reason.


I am quite confused by AuthProtocolState and HttpAuthenticator. Latter 
retains an auth state with the former but I cannot set the former from 
within my authenticator. Is that opaque to me and I should solely rely 
on setting isConnectionBased?


In other words: I need to create a GSSContext which is stateful on the 
HTTP connection and has to be maintained until the context has been 
successfully established. After that, I have to dispose it explicitly 
and HttpClient must throw away the scheme instance around that. If 
further request arrive on that connection later on a new scheme instance 
must be created by the backend. So, does it simply suffice to implement 
ContextAwareAuthScheme, AuthSchemeProvider and AuthSchemeBase properly?


Further questions:

1. Why does MalformedChallengeException not extend 
AuthenticationException though it is documented for authentication purposes?
2. The name of ChallengeState is quite confusing. Where is the state? 
This is merely a ChallengeHostType.


Michael

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



Update Jenkins jobs

2015-03-01 Thread Michael Osipov

Hi folks,

can someone update job httpcomponents-client-4.4.x from trunk to 
branches/4.4.x and create a 4.5.x job from trunk?


I am solely a dev on Jenkins.

Michael

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



[jira] [Resolved] (HTTPCLIENT-1621) Possible NPE/incorrect type in HttpClientBuilder#evictIdleConnections

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov resolved HTTPCLIENT-1621.

Resolution: Fixed

Fixed with [r1663151|http://svn.apache.org/r1663151].

 Possible NPE/incorrect type in HttpClientBuilder#evictIdleConnections
 -

 Key: HTTPCLIENT-1621
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1621
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpClient
Affects Versions: 4.4 Final
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 The method accepts a {{Long}} as first arg and not {{long}} (simple type). 
 This might lead to an NPE.
 I think this is also safe to fix for 4.4.x because due to autoboxing this 
 would be transparent.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Resolved] (HTTPCLIENT-1622) Name of HttpClientBuilder#setSslcontext inconsistent with the rest of SSL-related methods

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov resolved HTTPCLIENT-1622.

Resolution: Fixed

Fixed with [r1663155|http://svn.apache.org/r1663155].

 Name of HttpClientBuilder#setSslcontext inconsistent with the rest of 
 SSL-related methods
 -

 Key: HTTPCLIENT-1622
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1622
 Project: HttpComponents HttpClient
  Issue Type: Improvement
  Components: HttpClient
Affects Versions: 4.4 Final
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 Similar setters use a uppercase, three-letter style method name. This should 
 be consistent. Current method will be deprecated and replaced with a new one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



Re: Update Jenkins jobs

2015-03-01 Thread Oleg Kalnichevski
On Sun, 2015-03-01 at 20:26 +0100, Michael Osipov wrote:
 Hi folks,
 
 can someone update job httpcomponents-client-4.4.x from trunk to 
 branches/4.4.x and create a 4.5.x job from trunk?
 

Done.

https://builds.apache.org/view/H-L/view/HttpComponents/job/httpcomponents-client-4.5.x/

Oleg



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



[jira] [Created] (HTTPCLIENT-1625) Completely overhaul GSS-API-based authentication backend

2015-03-01 Thread Michael Osipov (JIRA)
Michael Osipov created HTTPCLIENT-1625:
--

 Summary: Completely overhaul GSS-API-based authentication backend
 Key: HTTPCLIENT-1625
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1625
 Project: HttpComponents HttpClient
  Issue Type: Task
  Components: Documentation, HttpAuth, HttpClient
Affects Versions: 4.5 Alpha1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


The current implementation does not reflect the way GSS-API-based 
authentication should be done. It has several design flaws.

This is an umbrella task for:

1. Deprecate all old classes
2. Investigate how it has to be plugged into HttpClient
3. Reimplement from scratch
4. Thoroughly test all new stuff
5. Rewrite documentation




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (HTTPCLIENT-1570) GGSSchemeBase blindly assumes that SPNEGO is always used

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov updated HTTPCLIENT-1570:
---
Fix Version/s: (was: 5.0)
   4.5 Alpha1

 GGSSchemeBase blindly assumes that SPNEGO is always used
 

 Key: HTTPCLIENT-1570
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1570
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpAuth
Affects Versions: 4.4 Beta1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 Lines 248 to 249 say:
 {code}
 buffer.append(: Negotiate );
 buffer.append(tokenstr);
 {code}
 This is incorrect. Since this is an abstract class the actual scheme must be 
 passed by the extending class through the super constructor. Same applies for 
 the {{getSchemeName}} method. Correct behavior is implemented in the 
 {{httpclient-win}} module and can be used as a template.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (HTTPCLIENT-1569) GGSSchemeBase incorrectly spelled

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov updated HTTPCLIENT-1569:
---
Fix Version/s: (was: 5.0)
   4.5 Alpha1

 GGSSchemeBase incorrectly spelled
 -

 Key: HTTPCLIENT-1569
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1569
 Project: HttpComponents HttpClient
  Issue Type: Bug
  Components: HttpAuth
Affects Versions: 4.4 Beta1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 The scheme classname is supposed to be called {{GSSSchemeBase}} or rather 
 {{GssSchemeBase}}. The current name seems to be a unnoticed typo.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Created] (HTTPCLIENT-1626) Rewrite documentation for GSS-API-based authentication

2015-03-01 Thread Michael Osipov (JIRA)
Michael Osipov created HTTPCLIENT-1626:
--

 Summary: Rewrite documentation for GSS-API-based authentication
 Key: HTTPCLIENT-1626
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1626
 Project: HttpComponents HttpClient
  Issue Type: Sub-task
  Components: Documentation
Affects Versions: 4.5 Alpha1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



[jira] [Updated] (HTTPCLIENT-1625) Completely overhaul GSS-API-based authentication backend

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov updated HTTPCLIENT-1625:
---
Description: 
The current implementation does not reflect the way GSS-API-based 
authentication should be done. It has several design flaws.

This is an umbrella task for:

1. Deprecate all old classes
2. Investigate how it has to be plugged into HttpClient
3. Reimplement from scratch
4. Thoroughly test all new stuff
5. Rewrite documentation

Implementation ideas and notes will be canonically available under: 

  was:
The current implementation does not reflect the way GSS-API-based 
authentication should be done. It has several design flaws.

This is an umbrella task for:

1. Deprecate all old classes
2. Investigate how it has to be plugged into HttpClient
3. Reimplement from scratch
4. Thoroughly test all new stuff
5. Rewrite documentation



 Completely overhaul GSS-API-based authentication backend
 

 Key: HTTPCLIENT-1625
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1625
 Project: HttpComponents HttpClient
  Issue Type: Task
  Components: Documentation, HttpAuth, HttpClient
Affects Versions: 4.5 Alpha1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 The current implementation does not reflect the way GSS-API-based 
 authentication should be done. It has several design flaws.
 This is an umbrella task for:
 1. Deprecate all old classes
 2. Investigate how it has to be plugged into HttpClient
 3. Reimplement from scratch
 4. Thoroughly test all new stuff
 5. Rewrite documentation
 Implementation ideas and notes will be canonically available under: 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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



Re: Update Jenkins jobs

2015-03-01 Thread Michael Osipov

Am 2015-03-01 um 21:16 schrieb Oleg Kalnichevski:

On Sun, 2015-03-01 at 20:26 +0100, Michael Osipov wrote:

Hi folks,

can someone update job httpcomponents-client-4.4.x from trunk to
branches/4.4.x and create a 4.5.x job from trunk?



Done.

https://builds.apache.org/view/H-L/view/HttpComponents/job/httpcomponents-client-4.5.x/


Perfect, thanks! Though the new job is missing in this [1] listing.

[1] https://builds.apache.org/view/H-L/view/HttpComponents/

Michael


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



[jira] [Updated] (HTTPCLIENT-1625) Completely overhaul GSS-API-based authentication backend

2015-03-01 Thread Michael Osipov (JIRA)

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

Michael Osipov updated HTTPCLIENT-1625:
---
Description: 
The current implementation does not reflect the way GSS-API-based 
authentication should be done. It has several design flaws.

This is an umbrella task for:

1. Deprecate all old classes
2. Investigate how it has to be plugged into HttpClient
3. Reimplement from scratch
4. Thoroughly test all new stuff
5. Rewrite documentation

Implementation ideas and notes will be canonically available under: 
http://people.apache.org/~michaelo/issues/HTTPCLIENT-1625/

  was:
The current implementation does not reflect the way GSS-API-based 
authentication should be done. It has several design flaws.

This is an umbrella task for:

1. Deprecate all old classes
2. Investigate how it has to be plugged into HttpClient
3. Reimplement from scratch
4. Thoroughly test all new stuff
5. Rewrite documentation

Implementation ideas and notes will be canonically available under: 


 Completely overhaul GSS-API-based authentication backend
 

 Key: HTTPCLIENT-1625
 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1625
 Project: HttpComponents HttpClient
  Issue Type: Task
  Components: Documentation, HttpAuth, HttpClient
Affects Versions: 4.5 Alpha1
Reporter: Michael Osipov
Assignee: Michael Osipov
 Fix For: 4.5 Alpha1


 The current implementation does not reflect the way GSS-API-based 
 authentication should be done. It has several design flaws.
 This is an umbrella task for:
 1. Deprecate all old classes
 2. Investigate how it has to be plugged into HttpClient
 3. Reimplement from scratch
 4. Thoroughly test all new stuff
 5. Rewrite documentation
 Implementation ideas and notes will be canonically available under: 
 http://people.apache.org/~michaelo/issues/HTTPCLIENT-1625/



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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