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

Oleg Kalnichevski commented on HTTPCORE-72:
-------------------------------------------

Hi Steffen

The trouble here is that it is difficult to say what the default value should 
be, as it may not suit all types of HTTP service handlers. In some cases where 
the size of the content buffer stays constant, it makes sense to have a largish 
value. For expandable buffers it would probably make make more sense to keep 
the initial size relatively small. I think this is more of a problem with the 
silly practice on the part of SUN developers to throw generic exceptions 
without an accompanying message that describes the nature of the problem.

What the default value should be?

Oleg

> HttpConnectionParams.getSocketBufferSize() returns -1 by default
> ----------------------------------------------------------------
>
>                 Key: HTTPCORE-72
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-72
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha5
>            Reporter: Steffen Pingel
>
> I was using an object of type BasicHttpParams which had no properties set and 
> got an exception in the constructor of ExpandableBuffer when I tried to 
> create a DefaultNHttpServerConnection. It is somewhat difficult for a caller 
> to tell from the trace was the cause of the error actually is:
> java.lang.IllegalArgumentException
>       at java.nio.Buffer.<init>(Buffer.java:174)
>       at java.nio.ByteBuffer.<init>(ByteBuffer.java:259)
>       at java.nio.ByteBuffer.<init>(ByteBuffer.java:267)
>       at java.nio.MappedByteBuffer.<init>(MappedByteBuffer.java:64)
>       at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:94)
>       at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:288)
>       at 
> org.apache.http.nio.util.ExpandableBuffer.<init>(ExpandableBuffer.java:46)
>       at 
> org.apache.http.impl.nio.reactor.SessionInputBuffer.<init>(SessionInputBuffer.java:55)
>       at 
> org.apache.http.impl.nio.NHttpConnectionBase.<init>(NHttpConnectionBase.java:111)
>       at 
> org.apache.http.impl.nio.DefaultNHttpServerConnection.<init>(DefaultNHttpServerConnection.java:63)
> [...]

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to