Re: [Simpleweb-Support] Simpleweb Shutting Down Connection Unexpecteadly During HTTP POST
Brought to you by:
niallg
From: <nik...@go...> - 2008-09-21 21:48:08
|
Hello Niall, Sunday, September 21, 2008, 10:08:11 PM, you wrote: > Ya, this looks like a bug. The issue is somewhat related to parsing > the upload but more related to how the upload is transferred over > TCP. Simple parses the upload in segments, each segment is taken > from what is currently in the server TCP window. When the terminal > boundary is in a small final packet then it fails to parse it > correctly. I am not going to include this in 4.0.3 but will ensure > its a priority for 4.0.4, which should not be too long. I had a look at the source and traced where an exception occurs (I am no Java expert, but it looks a bit "unfinished" that the according exception is never thrown or display - it would be nice if the console would show that an exception occured, the only way I was aware of this was when I was adding a conditional exception breakpoint (I am using eclipse)) and this is the trace I found: Thread [pool-1-thread-3] (Suspended (exception BufferException)) BufferAllocator.allocate(int) line: 211 BufferAllocator.allocate() line: 195 BoundaryConsumer.process() line: 117 BoundaryConsumer(ArrayConsumer).consume(Cursor) line: 123 PartEntryConsumer.consume(Cursor) line: 71 PartListConsumer.consume(Cursor) line: 138 BuilderConsumer.consume(Cursor) line: 86 EntityCollector.collect(Selector) line: 94 Retry.run() line: 91 SelectEvent.run() line: 74 ThreadPoolExecutor$Worker.runTask(Runnable) line: 650 ThreadPoolExecutor$Worker.run() line: 675 Thread.run() line: 595 At line 211 in BufferAllocator.allocate(int) it is simply asking for a buffer which has the size of the uploaded file. This buffer is bigger than the maximum buffer size and then a BufferException (Specified size beyond limit) is raised. Not sure where I would have to search for a fix (if a simple fix is possible at all). > The bug is in the class > org.simpleframework.http.core.ContentConsumer and how it interacts > with the org.simpleframework.http.core.TransportCursor which feeds > the consumer the tokens it uses to parse the upload. Its a little > complex, but well documented, if you can spot the bug before I get a > chance to work on it then that would be greatly appreciated. -- Best regards, nik.thirtynine mailto:nik.thirtynine |