Skip to content

Commit 4042775

Browse files
oleksiysOleksiy Stashok
oleksiys
authored and
Oleksiy Stashok
committed
+ refactoring
1 parent a2ba430 commit 4042775

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/main/java/com/ning/http/client/providers/grizzly/PartialBodyGenerator.java renamed to src/main/java/com/ning/http/client/providers/grizzly/FeedableBodyGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @author The Grizzly Team
3333
* @since 1.7.0
3434
*/
35-
public class PartialBodyGenerator implements BodyGenerator {
35+
public class FeedableBodyGenerator implements BodyGenerator {
3636
private final Queue<BodyPart> queue = new ConcurrentLinkedQueue<BodyPart>();
3737
private final AtomicInteger queueSize = new AtomicInteger();
3838

@@ -41,10 +41,10 @@ public class PartialBodyGenerator implements BodyGenerator {
4141

4242
@Override
4343
public Body createBody() throws IOException {
44-
return new PartialBody();
44+
return new EmptyBody();
4545
}
4646

47-
public void append(final Buffer buffer, final boolean isLast)
47+
public void feed(final Buffer buffer, final boolean isLast)
4848
throws IOException {
4949
queue.offer(new BodyPart(buffer, isLast));
5050
queueSize.incrementAndGet();
@@ -81,7 +81,7 @@ private void flushQueue() throws IOException {
8181
}
8282
}
8383

84-
private final class PartialBody implements Body {
84+
private final class EmptyBody implements Body {
8585

8686
@Override
8787
public long getContentLength() {

src/main/java/com/ning/http/client/providers/grizzly/GrizzlyAsyncHttpProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,8 +1972,8 @@ public boolean doHandle(final FilterChainContext ctx,
19721972
} else {
19731973
// pass the context to bodyLocal to be able to
19741974
// continue body transferring once more data is available
1975-
if (generator instanceof PartialBodyGenerator) {
1976-
((PartialBodyGenerator) generator).initializeAsynchronousTransfer(ctx, requestPacket);
1975+
if (generator instanceof FeedableBodyGenerator) {
1976+
((FeedableBodyGenerator) generator).initializeAsynchronousTransfer(ctx, requestPacket);
19771977
return false;
19781978
} else {
19791979
throw new IllegalStateException("BodyGenerator unexpectedly returned 0 bytes available");

0 commit comments

Comments
 (0)