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/spdy/spdy_protocol.h" | 5 #include "net/spdy/spdy_protocol.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "net/spdy/spdy_bug_tracker.h" | 8 #include "net/spdy/spdy_bug_tracker.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 // FRAME_TOO_LARGE is the valid last status code. | 383 // FRAME_TOO_LARGE is the valid last status code. |
384 if (rst_stream_status_field > | 384 if (rst_stream_status_field > |
385 SerializeRstStreamStatus(version, RST_STREAM_FRAME_TOO_LARGE)) { | 385 SerializeRstStreamStatus(version, RST_STREAM_FRAME_TOO_LARGE)) { |
386 return false; | 386 return false; |
387 } | 387 } |
388 | 388 |
389 return true; | 389 return true; |
390 case HTTP2: | 390 case HTTP2: |
391 // NO_ERROR is the first valid status code. | 391 // NO_ERROR is the first valid status code. |
392 if (rst_stream_status_field < | 392 if (rst_stream_status_field < |
393 SerializeRstStreamStatus(version, RST_STREAM_PROTOCOL_ERROR)) { | 393 SerializeRstStreamStatus(version, RST_STREAM_NO_ERROR)) { |
394 return false; | 394 return false; |
395 } | 395 } |
396 | 396 |
397 // TODO(hkhalil): Omit COMPRESSION_ERROR and SETTINGS_TIMEOUT | 397 // TODO(hkhalil): Omit COMPRESSION_ERROR and SETTINGS_TIMEOUT |
398 /* | 398 /* |
399 // This works because GOAWAY and RST_STREAM share a namespace. | 399 // This works because GOAWAY and RST_STREAM share a namespace. |
400 if (rst_stream_status_field == | 400 if (rst_stream_status_field == |
401 SerializeGoAwayStatus(version, GOAWAY_COMPRESSION_ERROR) || | 401 SerializeGoAwayStatus(version, GOAWAY_COMPRESSION_ERROR) || |
402 rst_stream_status_field == | 402 rst_stream_status_field == |
403 SerializeGoAwayStatus(version, GOAWAY_SETTINGS_TIMEOUT)) { | 403 SerializeGoAwayStatus(version, GOAWAY_SETTINGS_TIMEOUT)) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 case 8: | 440 case 8: |
441 return RST_STREAM_STREAM_IN_USE; | 441 return RST_STREAM_STREAM_IN_USE; |
442 case 9: | 442 case 9: |
443 return RST_STREAM_STREAM_ALREADY_CLOSED; | 443 return RST_STREAM_STREAM_ALREADY_CLOSED; |
444 case 11: | 444 case 11: |
445 return RST_STREAM_FRAME_TOO_LARGE; | 445 return RST_STREAM_FRAME_TOO_LARGE; |
446 } | 446 } |
447 break; | 447 break; |
448 case HTTP2: | 448 case HTTP2: |
449 switch (rst_stream_status_field) { | 449 switch (rst_stream_status_field) { |
| 450 case 0: |
| 451 return RST_STREAM_NO_ERROR; |
450 case 1: | 452 case 1: |
451 return RST_STREAM_PROTOCOL_ERROR; | 453 return RST_STREAM_PROTOCOL_ERROR; |
452 case 2: | 454 case 2: |
453 return RST_STREAM_INTERNAL_ERROR; | 455 return RST_STREAM_INTERNAL_ERROR; |
454 case 3: | 456 case 3: |
455 return RST_STREAM_FLOW_CONTROL_ERROR; | 457 return RST_STREAM_FLOW_CONTROL_ERROR; |
456 case 5: | 458 case 5: |
457 return RST_STREAM_STREAM_CLOSED; | 459 return RST_STREAM_STREAM_CLOSED; |
458 case 6: | 460 case 6: |
459 return RST_STREAM_FRAME_SIZE_ERROR; | 461 return RST_STREAM_FRAME_SIZE_ERROR; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 case RST_STREAM_STREAM_ALREADY_CLOSED: | 504 case RST_STREAM_STREAM_ALREADY_CLOSED: |
503 return 9; | 505 return 9; |
504 case RST_STREAM_FRAME_TOO_LARGE: | 506 case RST_STREAM_FRAME_TOO_LARGE: |
505 return 11; | 507 return 11; |
506 default: | 508 default: |
507 SPDY_BUG << "Unhandled RST_STREAM status " << rst_stream_status; | 509 SPDY_BUG << "Unhandled RST_STREAM status " << rst_stream_status; |
508 return -1; | 510 return -1; |
509 } | 511 } |
510 case HTTP2: | 512 case HTTP2: |
511 switch (rst_stream_status) { | 513 switch (rst_stream_status) { |
| 514 case RST_STREAM_NO_ERROR: |
| 515 return 0; |
512 case RST_STREAM_PROTOCOL_ERROR: | 516 case RST_STREAM_PROTOCOL_ERROR: |
513 return 1; | 517 return 1; |
514 case RST_STREAM_INTERNAL_ERROR: | 518 case RST_STREAM_INTERNAL_ERROR: |
515 return 2; | 519 return 2; |
516 case RST_STREAM_FLOW_CONTROL_ERROR: | 520 case RST_STREAM_FLOW_CONTROL_ERROR: |
517 return 3; | 521 return 3; |
518 case RST_STREAM_STREAM_CLOSED: | 522 case RST_STREAM_STREAM_CLOSED: |
519 return 5; | 523 return 5; |
520 case RST_STREAM_FRAME_SIZE_ERROR: | 524 case RST_STREAM_FRAME_SIZE_ERROR: |
521 return 6; | 525 return 6; |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 | 886 |
883 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { | 887 void SpdyAltSvcIR::Visit(SpdyFrameVisitor* visitor) const { |
884 return visitor->VisitAltSvc(*this); | 888 return visitor->VisitAltSvc(*this); |
885 } | 889 } |
886 | 890 |
887 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { | 891 void SpdyPriorityIR::Visit(SpdyFrameVisitor* visitor) const { |
888 return visitor->VisitPriority(*this); | 892 return visitor->VisitPriority(*this); |
889 } | 893 } |
890 | 894 |
891 } // namespace net | 895 } // namespace net |
OLD | NEW |