Skip to content

Commit b0cccb6

Browse files
committed
Fix Publisher.subscribe running check and add the metadata information such as name, description to the protocol poms
1 parent 07b72ee commit b0cccb6

File tree

7 files changed

+35
-12
lines changed

7 files changed

+35
-12
lines changed

core/sdk-core/src/main/java/software/amazon/awssdk/core/internal/http/async/SimpleHttpContentPublisher.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ private SubscriptionImpl(Subscriber<? super ByteBuffer> s) {
6262

6363
@Override
6464
public void request(long n) {
65-
if (n <= 0) {
66-
s.onError(new IllegalArgumentException("Demand must be positive"));
67-
} else if (running) {
68-
s.onNext(ByteBuffer.wrap(content));
69-
s.onComplete();
65+
if (running) {
7066
running = false;
67+
if (n <= 0) {
68+
s.onError(new IllegalArgumentException("Demand must be positive"));
69+
} else {
70+
s.onNext(ByteBuffer.wrap(content));
71+
s.onComplete();
72+
}
7173
}
7274
}
7375

http-clients/netty-nio-client/src/main/java/software/amazon/awssdk/http/nio/netty/internal/ResponseHandler.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -310,14 +310,15 @@ public void subscribe(Subscriber<? super ByteBuffer> subscriber) {
310310
subscriber.onSubscribe(new Subscription() {
311311
@Override
312312
public void request(long l) {
313-
if (l <= 0 && running) {
313+
if (running) {
314314
running = false;
315-
subscriber.onError(new IllegalArgumentException("Demand must be positive!"));
316-
} else if (running) {
317-
running = false;
318-
subscriber.onNext(fullContent);
319-
subscriber.onComplete();
320-
executeFuture.complete(null);
315+
if (l <= 0) {
316+
subscriber.onError(new IllegalArgumentException("Demand must be positive!"));
317+
} else {
318+
subscriber.onNext(fullContent);
319+
subscriber.onComplete();
320+
executeFuture.complete(null);
321+
}
321322
}
322323
}
323324

protocols/aws-cbor-protocol/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>aws-cbor-protocol</artifactId>
13+
<name>AWS Java SDK :: AWS Cbor Protocol</name>
14+
<description>The AWS SDK for Java - module holds the classes for AWS Cbor protocol
15+
</description>
16+
<url>https://aws.amazon.com/sdkforjava</url>
1317

1418
<dependencies>
1519
<dependency>

protocols/aws-ion-protocol/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>aws-ion-protocol</artifactId>
13+
<name>AWS Java SDK :: AWS Ion Protocol</name>
14+
<description>The AWS SDK for Java - module holds the classes for AWS Ion protocol
15+
</description>
16+
<url>https://aws.amazon.com/sdkforjava</url>
1317

1418
<dependencies>
1519
<dependency>

protocols/aws-json-protocol/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>aws-json-protocol</artifactId>
13+
<name>AWS Java SDK :: AWS Json Protocol</name>
14+
<description>The AWS SDK for Java - module holds the classes for AWS Json protocol
15+
</description>
16+
<url>https://aws.amazon.com/sdkforjava</url>
1317

1418
<dependencies>
1519
<dependency>

protocols/aws-query-protocol/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>aws-query-protocol</artifactId>
13+
<name>AWS Java SDK :: AWS Query Protocol</name>
14+
<description>The AWS SDK for Java - module holds the classes for AWS Query protocol
15+
</description>
16+
<url>https://aws.amazon.com/sdkforjava</url>
1317

1418
<dependencies>
1519
<dependency>

protocols/protocol-core/pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<modelVersion>4.0.0</modelVersion>
1111

1212
<artifactId>protocol-core</artifactId>
13+
<name>AWS Java SDK :: Protocol Core</name>
14+
<description>The AWS SDK for Java - module holds the core protocol classes
15+
</description>
16+
<url>https://aws.amazon.com/sdkforjava</url>
1317

1418

1519
<dependencies>

0 commit comments

Comments
 (0)