Re: [Simpleweb-Support] Simpleweb Shutting Down Connection Unexpecteadly During HTTP POST
Brought to you by:
niallg
From: <nik...@go...> - 2008-09-21 22:45:12
|
Hello Niall, Monday, September 22, 2008, 12:24:33 AM, you wrote: > The exception you have spotted is one of two exceptions I > encountered. When I fixed this one another one cropped up. This is a > pretty simple bug to fix, when I fixed this the bug appeared far > less often, about 1 in 1000. However there are instances where the > boundary that wraps the upload is not fully ready then the > connection just hangs there in an idle state and the upload does not > complete. Okay, I don't know how the buffer handling is done and what you are doing internally that's why I said I don't know whether it is easy to fix :) As said, I am not an Java expert. > Also the terminal token is the specified boundary with a final > --\r\n ending. This specifies that that particular part has > finished. For instance if the boundary is --abcdefg then the > terminal is --abcdefg--\r\n. I was aware that a problem could arise > from the current implementation however I thought it would be far > less frequent. The fix for the buffer exception is to comment out > (or remove) the following lines in > org.simpleframework.util.buffer.BufferAllocator.allocate(int) > // if(capacity > size) { > // size = capacity; > // } > This reduces the size of the buffer allocated and should improve the issue. Does this mean that the issue will not happen as often as before, but it may happen with a small probability? I think I will wait for the 4.0.3 release b/c with my current knowledge and skills I'd probably screw up things. A suggestion: It would help IMHO if the raised exceptions are printed out to stderr rather than simply skipped. However, thanks for your help, Niall. Also (since I haven't said it explicitly) thanks for this very nice and easy to use library! :-) -- Best regards, nik.thirtynine mailto:nik.thirtynine |