Skip to content

Commit 594d0ad

Browse files
committed
Max concurrent stream check should happen after authority verification failure if any
1 parent 8870995 commit 594d0ad

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,9 +521,6 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) {
521521
if (goAwayStatus != null) {
522522
clientStream.transportState().transportReportStatus(
523523
goAwayStatus, RpcProgress.MISCARRIED, true, new Metadata());
524-
} else if (streams.size() >= maxConcurrentStreams) {
525-
pendingStreams.add(clientStream);
526-
setInUse(clientStream);
527524
} else {
528525
if (socket instanceof SSLSocket && !authority.equals(defaultAuthority)) {
529526
Status authorityVerificationResult;
@@ -541,7 +538,12 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) {
541538
}
542539
}
543540
}
544-
startStream(clientStream);
541+
if (streams.size() >= maxConcurrentStreams) {
542+
pendingStreams.add(clientStream);
543+
setInUse(clientStream);
544+
} else {
545+
startStream(clientStream);
546+
}
545547
}
546548
}
547549

0 commit comments

Comments
 (0)