users@grizzly.java.net

Re: Grizzly http client race condition

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 16 Jun 2015 18:35:06 +0200

I see what you mean, it that case it's a bug in jersey connector, and it
has to be fixed.

I'll take care of it.

WBR,
Alexey.


On 11.06.15 20:50, testn wrote:
> The feeder code is from grizzly-http-client (aka async-http-client 1.8.15)
> and jersey-grizzly-connector
>
> /**
> * Utility OutputStream implementation that can feed Grizzly
> chunk-encoded body generator.
> */
> private class FeederAdapter extends OutputStream {
>
> final FeedableBodyGenerator.Feeder delegate;
>
> /**
> * Get me a new adapter for given feeder.
> *
> * @param bodyFeeder adaptee to get fed as an output stream.
> */
> FeederAdapter(FeedableBodyGenerator.Feeder bodyFeeder) {
> this.delegate = bodyFeeder;
> }
>
> @Override
> public void write(int b) throws IOException {
> final byte[] buffer = new byte[1];
> buffer[0] = (byte) b;
> delegate.feed(Buffers.wrap(MemoryManager.DEFAULT_MEMORY_MANAGER,
> buffer), false);
> }
>
> @Override
> public void write(byte[] b) throws IOException {
> delegate.feed(Buffers.wrap(MemoryManager.DEFAULT_MEMORY_MANAGER,
> b), false);
> }
>
> @Override
> public void write(byte[] b, int off, int len) throws IOException {
> delegate.feed(Buffers.wrap(MemoryManager.DEFAULT_MEMORY_MANAGER,
> b, off, len), false);
> }
>
> @Override
> public void close() throws IOException {
> delegate.feed(Buffers.EMPTY_BUFFER, true);
> }
> }
>
>
>
>
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/Grizzly-http-client-race-condition-tp5710847p5710901.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.