| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_TOOLS_BALSA_BALSA_ENUMS_H_ | 5 #ifndef NET_TOOLS_BALSA_BALSA_ENUMS_H_ |
| 6 #define NET_TOOLS_BALSA_BALSA_ENUMS_H_ | 6 #define NET_TOOLS_BALSA_BALSA_ENUMS_H_ |
| 7 | 7 |
| 8 namespace net { | 8 namespace net { |
| 9 | 9 |
| 10 struct BalsaFrameEnums { | 10 struct BalsaFrameEnums { |
| 11 enum ParseState { | 11 enum ParseState { |
| 12 PARSE_ERROR, | 12 PARSE_ERROR, |
| 13 READING_HEADER_AND_FIRSTLINE, | 13 READING_HEADER_AND_FIRSTLINE, |
| 14 READING_CHUNK_LENGTH, | 14 READING_CHUNK_LENGTH, |
| 15 READING_CHUNK_EXTENSION, | 15 READING_CHUNK_EXTENSION, |
| 16 READING_CHUNK_DATA, | 16 READING_CHUNK_DATA, |
| 17 READING_CHUNK_TERM, | 17 READING_CHUNK_TERM, |
| 18 READING_LAST_CHUNK_TERM, | 18 READING_LAST_CHUNK_TERM, |
| 19 READING_TRAILER, | 19 READING_TRAILER, |
| 20 READING_UNTIL_CLOSE, | 20 READING_UNTIL_CLOSE, |
| 21 READING_CONTENT, | 21 READING_CONTENT, |
| 22 MESSAGE_FULLY_READ, | 22 MESSAGE_FULLY_READ, |
| 23 NUM_STATES, | 23 NUM_STATES, |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 enum ErrorCode { | 26 enum ErrorCode { |
| 27 #if defined(_WIN32) |
| 28 // On Windows, <WinError.h> defines the NO_ERROR macro as 0L, which |
| 29 // breaks the compilation of the "NO_ERROR = 0" line. |
| 30 #undef NO_ERROR |
| 31 #endif |
| 27 NO_ERROR = 0, // A sentinel value for convenience, none of the callbacks | 32 NO_ERROR = 0, // A sentinel value for convenience, none of the callbacks |
| 28 // should ever see this error code. | 33 // should ever see this error code. |
| 29 // Header parsing errors | 34 // Header parsing errors |
| 30 // Note that adding one to many of the REQUEST errors yields the | 35 // Note that adding one to many of the REQUEST errors yields the |
| 31 // appropriate RESPONSE error. | 36 // appropriate RESPONSE error. |
| 32 // Particularly, when parsing the first line of a request or response, | 37 // Particularly, when parsing the first line of a request or response, |
| 33 // there are three sequences of non-whitespace regardless of whether or | 38 // there are three sequences of non-whitespace regardless of whether or |
| 34 // not it is a request or response. These are listed below, in order. | 39 // not it is a request or response. These are listed below, in order. |
| 35 // | 40 // |
| 36 // firstline_a firstline_b firstline_c | 41 // firstline_a firstline_b firstline_c |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 CONTENT_LENGTH_OVERFLOW, | 107 CONTENT_LENGTH_OVERFLOW, |
| 103 NO_CONTENT_LENGTH, | 108 NO_CONTENT_LENGTH, |
| 104 VALID_CONTENT_LENGTH, | 109 VALID_CONTENT_LENGTH, |
| 105 }; | 110 }; |
| 106 }; | 111 }; |
| 107 | 112 |
| 108 } // namespace net | 113 } // namespace net |
| 109 | 114 |
| 110 #endif // NET_TOOLS_BALSA_BALSA_ENUMS_H_ | 115 #endif // NET_TOOLS_BALSA_BALSA_ENUMS_H_ |
| 111 | 116 |
| OLD | NEW |