| 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 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1541 // ERR_EMPTY_RESPONSE. This may still be close/reuse race if the socket was | 1541 // ERR_EMPTY_RESPONSE. This may still be close/reuse race if the socket was |
| 1542 // preconnected but failed to be used before the server timed it out. | 1542 // preconnected but failed to be used before the server timed it out. |
| 1543 case ERR_EMPTY_RESPONSE: | 1543 case ERR_EMPTY_RESPONSE: |
| 1544 if (ShouldResendRequest()) { | 1544 if (ShouldResendRequest()) { |
| 1545 net_log_.AddEventWithNetErrorCode( | 1545 net_log_.AddEventWithNetErrorCode( |
| 1546 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | 1546 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| 1547 ResetConnectionAndRequestForResend(); | 1547 ResetConnectionAndRequestForResend(); |
| 1548 error = OK; | 1548 error = OK; |
| 1549 } | 1549 } |
| 1550 break; | 1550 break; |
| 1551 case ERR_QUIC_BROKEN_ERROR: | |
| 1552 DCHECK(GetResponseHeaders() == nullptr); | |
| 1553 net_log_.AddEventWithNetErrorCode( | |
| 1554 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | |
| 1555 ResetConnectionAndRequestForResend(); | |
| 1556 error = OK; | |
| 1557 break; | |
| 1558 case ERR_SPDY_PING_FAILED: | 1551 case ERR_SPDY_PING_FAILED: |
| 1559 case ERR_SPDY_SERVER_REFUSED_STREAM: | 1552 case ERR_SPDY_SERVER_REFUSED_STREAM: |
| 1560 case ERR_QUIC_HANDSHAKE_FAILED: | 1553 case ERR_QUIC_HANDSHAKE_FAILED: |
| 1561 net_log_.AddEventWithNetErrorCode( | 1554 net_log_.AddEventWithNetErrorCode( |
| 1562 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | 1555 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| 1563 ResetConnectionAndRequestForResend(); | 1556 ResetConnectionAndRequestForResend(); |
| 1564 error = OK; | 1557 error = OK; |
| 1565 break; | 1558 break; |
| 1559 case ERR_QUIC_PROTOCOL_ERROR: { |
| 1560 AlternativeService alternative_service; |
| 1561 if (GetResponseHeaders() == nullptr && |
| 1562 stream_->GetAlternativeService(&alternative_service) && |
| 1563 session_->http_server_properties()->IsAlternativeServiceBroken( |
| 1564 alternative_service)) { |
| 1565 net_log_.AddEventWithNetErrorCode( |
| 1566 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| 1567 ResetConnectionAndRequestForResend(); |
| 1568 error = OK; |
| 1569 } |
| 1570 break; |
| 1571 } |
| 1566 case ERR_MISDIRECTED_REQUEST: | 1572 case ERR_MISDIRECTED_REQUEST: |
| 1567 // If this is the second try, just give up. | 1573 // If this is the second try, just give up. |
| 1568 if (!enable_ip_based_pooling_ && !enable_alternative_services_) | 1574 if (!enable_ip_based_pooling_ && !enable_alternative_services_) |
| 1569 return OK; | 1575 return OK; |
| 1570 // Otherwise retry the request with both IP based pooling | 1576 // Otherwise retry the request with both IP based pooling |
| 1571 // and Alternative Services disabled. | 1577 // and Alternative Services disabled. |
| 1572 enable_ip_based_pooling_ = false; | 1578 enable_ip_based_pooling_ = false; |
| 1573 enable_alternative_services_ = false; | 1579 enable_alternative_services_ = false; |
| 1574 net_log_.AddEventWithNetErrorCode( | 1580 net_log_.AddEventWithNetErrorCode( |
| 1575 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); | 1581 NetLogEventType::HTTP_TRANSACTION_RESTART_AFTER_ERROR, error); |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1776 continue; | 1782 continue; |
| 1777 if (allowed_encodings.find(encoding) == allowed_encodings.end()) { | 1783 if (allowed_encodings.find(encoding) == allowed_encodings.end()) { |
| 1778 FilterSourceStream::ReportContentDecodingFailed(source_type); | 1784 FilterSourceStream::ReportContentDecodingFailed(source_type); |
| 1779 return false; | 1785 return false; |
| 1780 } | 1786 } |
| 1781 } | 1787 } |
| 1782 return true; | 1788 return true; |
| 1783 } | 1789 } |
| 1784 | 1790 |
| 1785 } // namespace net | 1791 } // namespace net |
| OLD | NEW |