Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1526 // ERR_EMPTY_RESPONSE. This may still be close/reuse race if the socket was | 1526 // ERR_EMPTY_RESPONSE. This may still be close/reuse race if the socket was |
| 1527 // preconnected but failed to be used before the server timed it out. | 1527 // preconnected but failed to be used before the server timed it out. |
| 1528 case ERR_EMPTY_RESPONSE: | 1528 case ERR_EMPTY_RESPONSE: |
| 1529 if (ShouldResendRequest()) { | 1529 if (ShouldResendRequest()) { |
| 1530 net_log_.AddEventWithNetErrorCode( | 1530 net_log_.AddEventWithNetErrorCode( |
| 1531 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | 1531 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| 1532 ResetConnectionAndRequestForResend(); | 1532 ResetConnectionAndRequestForResend(); |
| 1533 error = OK; | 1533 error = OK; |
| 1534 } | 1534 } |
| 1535 break; | 1535 break; |
| 1536 case ERR_QUIC_BROKEN_ERROR: | |
| 1537 DCHECK(GetResponseHeaders() == nullptr); | |
|
Jana
2017/04/06 02:29:18
why is this a DCHECK and not if (ShouldResendReque
Ryan Hamilton
2017/04/06 03:43:38
Because this error code is never returned when hea
| |
| 1538 net_log_.AddEventWithNetErrorCode( | |
| 1539 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | |
| 1540 ResetConnectionAndRequestForResend(); | |
| 1541 error = OK; | |
| 1542 break; | |
| 1536 case ERR_SPDY_PING_FAILED: | 1543 case ERR_SPDY_PING_FAILED: |
| 1537 case ERR_SPDY_SERVER_REFUSED_STREAM: | 1544 case ERR_SPDY_SERVER_REFUSED_STREAM: |
| 1538 case ERR_QUIC_HANDSHAKE_FAILED: | 1545 case ERR_QUIC_HANDSHAKE_FAILED: |
| 1539 net_log_.AddEventWithNetErrorCode( | 1546 net_log_.AddEventWithNetErrorCode( |
| 1540 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | 1547 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| 1541 ResetConnectionAndRequestForResend(); | 1548 ResetConnectionAndRequestForResend(); |
| 1542 error = OK; | 1549 error = OK; |
| 1543 break; | 1550 break; |
| 1544 case ERR_MISDIRECTED_REQUEST: | 1551 case ERR_MISDIRECTED_REQUEST: |
| 1545 // If this is the second try, just give up. | 1552 // If this is the second try, just give up. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1712 DCHECK(stream_request_); | 1719 DCHECK(stream_request_); |
| 1713 | 1720 |
| 1714 // Since the transaction can restart with auth credentials, it may create a | 1721 // Since the transaction can restart with auth credentials, it may create a |
| 1715 // stream more than once. Accumulate all of the connection attempts across | 1722 // stream more than once. Accumulate all of the connection attempts across |
| 1716 // those streams by appending them to the vector: | 1723 // those streams by appending them to the vector: |
| 1717 for (const auto& attempt : stream_request_->connection_attempts()) | 1724 for (const auto& attempt : stream_request_->connection_attempts()) |
| 1718 connection_attempts_.push_back(attempt); | 1725 connection_attempts_.push_back(attempt); |
| 1719 } | 1726 } |
| 1720 | 1727 |
| 1721 } // namespace net | 1728 } // namespace net |
| OLD | NEW |