Since we're on the topic of WOAdaptors, if anyone knows how to properly handle 
streaming multipart requests in a WOAdaptor, I'll be a very happy man.

I wrote an experimental Jetty-based WOAdaptor a while back (I also want 
WebSockets) — but I wasn't able to get it to handle streaming mulitpart uploads.
When handling those, WONoCopyPushbackInputStream.read() complains about "Amount 
read didn't match content-length".
Pretty sure I'm passing in a proper data stream and length since I can read the 
data and consume other streaming requests just fine — just won't work when 
multipart parsing is involved.

https://github.com/undur/wo-jetty-adaptor/blob/048928a4878d3db8c2d7014fe47afcc39887e3b6/src/main/java/com/webobjects/appserver/WOAdaptorJetty.java#L203-L214

Unfortunately it seems the Netty adaptor loads the entire request data into 
memory before handling the request, if I'm understanding this correctly, so no 
help there :-/

https://github.com/wocommunity/wonder/blob/53e84729120a3a6cdf4bf793a963c670da2d8493/Frameworks/WOAdaptors/ERWOAdaptor/Sources/er/woadaptor/ERWOAdaptorUtilities.java#L45

-- 

Unrelated; if you're thinking of writing an adaptor I wrote a an adaptor using 
Java's built in HTTP server to ensure the multipart thing wasn't a Jetty 
problem. It's a nice way to see the very basics of writing a WOAdaptor I think 
(with the caveat that I'm really no WOAdaptor expert :). It has the same 
problem with streaming multiparts though.

https://github.com/undur/wonder-slim/blob/9cc6a793555d55f4465d45b33ce8f7be9c432799/ERExtensions/src/main/java/com/webobjects/appserver/WOAdaptorPlain.java#L35

Cheers,
- hugi



> On 11 Nov 2025, at 09:12, Ramsey Gurley <[email protected]> wrote:
> 
> I would not be surprised if that WOAdaptor needs a lot of work. It was neat 
> at the time it was written, but maybe one built with vertx would be a lot 
> better these days. I'd like to try building a vertx based WOAdaptor when I 
> have time. And a vertx based EOAdaptor for Postgresql as well to see if we 
> could make WO non-blocking. Also a vertx eventbus/NSNotificationCenter 
> bridge, to handle things like websockets specifically would be cool.
> 
> I guess you can tell I'm a vertx fan :D
> 
> 
> On 11/11/25 1:04 PM, Michael Kondratov via Webobjects-dev wrote:
>> Hello,
>> 
>> I’ve enabled ERWOAdaptor in my application to get websockets to work, but 
>> now experiencing a strange issue with file upload component. The uploaded 
>> files show up twice. Is it a know issue?
>> 
>> 
>> Michael
>> Aspire Auctions

Reply via email to