|
49 | 49 | import io.grpc.internal.ClientStream; |
50 | 50 | import io.grpc.internal.ClientStreamListener.RpcProgress; |
51 | 51 | import io.grpc.internal.ConnectionClientTransport; |
52 | | -import io.grpc.internal.FailingClientStream; |
53 | 52 | import io.grpc.internal.GrpcAttributes; |
54 | 53 | import io.grpc.internal.GrpcUtil; |
55 | 54 | import io.grpc.internal.Http2Ping; |
@@ -247,12 +246,12 @@ private static Map<ErrorCode, Status> buildErrorCodeToStatusMap() { |
247 | 246 | @GuardedBy("lock") |
248 | 247 | private final TransportTracer transportTracer; |
249 | 248 | private final Map<String, Status> peerVerificationResults = Collections.synchronizedMap( |
250 | | - new LinkedHashMap<String, Status>() { |
251 | | - @Override |
252 | | - protected boolean removeEldestEntry(Map.Entry<String, Status> eldest) { |
253 | | - return size() > 100; |
254 | | - } |
255 | | - }); |
| 249 | + new LinkedHashMap<String, Status>() { |
| 250 | + @Override |
| 251 | + protected boolean removeEldestEntry(Map.Entry<String, Status> eldest) { |
| 252 | + return size() > 100; |
| 253 | + } |
| 254 | + }); |
256 | 255 |
|
257 | 256 | @GuardedBy("lock") |
258 | 257 | private final InUseStateAggregator<OkHttpClientStream> inUseState = |
@@ -520,23 +519,26 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) { |
520 | 519 | } |
521 | 520 | } |
522 | 521 | if (socket instanceof SSLSocket && authority != null |
523 | | - && channelCredentials != null && channelCredentials instanceof TlsChannelCredentials) { |
| 522 | + && channelCredentials != null |
| 523 | + && channelCredentials instanceof TlsChannelCredentials) { |
524 | 524 | Status peerVerificationStatus = null; |
525 | 525 | if (peerVerificationResults.containsKey(authority)) { |
526 | 526 | peerVerificationStatus = peerVerificationResults.get(authority); |
527 | 527 | } else { |
528 | 528 | TrustManager x509ExtendedTrustManager = null; |
529 | 529 | try { |
530 | 530 | x509ExtendedTrustManager = x509ExtendedTrustManagerClass != null |
531 | | - ? getX509ExtendedTrustManager((TlsChannelCredentials) channelCredentials) : null; |
| 531 | + ? getX509ExtendedTrustManager((TlsChannelCredentials) channelCredentials) |
| 532 | + : null; |
532 | 533 | } catch (GeneralSecurityException e) { |
533 | 534 | peerVerificationStatus = Status.UNAVAILABLE.withCause(e) |
534 | 535 | .withDescription("Could not verify authority due to failure getting " |
535 | 536 | + "X509ExtendedTrustManager from TlsCredentials"); |
536 | 537 | } |
537 | 538 | if (x509ExtendedTrustManager == null) { |
538 | | - peerVerificationStatus = Status.UNAVAILABLE.withDescription(String.format("Could not verify authority '%s' for " |
539 | | - + "the rpc with no X509ExtendedTrustManager available", |
| 539 | + peerVerificationStatus = Status.UNAVAILABLE.withDescription( |
| 540 | + String.format("Could not verify authority '%s' for the rpc with no " |
| 541 | + + "X509ExtendedTrustManager available", |
540 | 542 | authority)); |
541 | 543 | } |
542 | 544 | if (x509ExtendedTrustManager != null) { |
@@ -567,7 +569,8 @@ void streamReadyToStart(OkHttpClientStream clientStream, String authority) { |
567 | 569 | } else { |
568 | 570 | if (peerVerificationStatus.getCause() != null) { |
569 | 571 | log.log(Level.WARNING, peerVerificationStatus.getDescription() |
570 | | - + ". This will be an error in the future.", peerVerificationStatus.getCause()); |
| 572 | + + ". This will be an error in the future.", |
| 573 | + peerVerificationStatus.getCause()); |
571 | 574 | } else { |
572 | 575 | log.log(Level.WARNING, peerVerificationStatus.getDescription() |
573 | 576 | + ". This will be an error in the future."); |
|
0 commit comments