| 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 #include "net/tools/balsa/balsa_frame.h" | 5 #include "net/tools/balsa/balsa_frame.h" |
| 6 | 6 |
| 7 #include <assert.h> | 7 #include <assert.h> |
| 8 #if __SSE2__ | 8 #if __SSE2__ |
| 9 #include <emmintrin.h> | 9 #include <emmintrin.h> |
| 10 #endif // __SSE2__ | 10 #endif // __SSE2__ |
| 11 #include <strings.h> | |
| 12 | 11 |
| 13 #include <limits> | 12 #include <limits> |
| 14 #include <string> | 13 #include <string> |
| 15 #include <utility> | 14 #include <utility> |
| 16 #include <vector> | 15 #include <vector> |
| 17 | 16 |
| 18 #include "base/logging.h" | 17 #include "base/logging.h" |
| 19 #include "base/port.h" | 18 #include "base/port.h" |
| 20 #include "base/strings/string_piece.h" | 19 #include "base/strings/string_piece.h" |
| 21 #include "net/tools/balsa/balsa_enums.h" | 20 #include "net/tools/balsa/balsa_enums.h" |
| 22 #include "net/tools/balsa/balsa_headers.h" | 21 #include "net/tools/balsa/balsa_headers.h" |
| 23 #include "net/tools/balsa/balsa_visitor_interface.h" | 22 #include "net/tools/balsa/balsa_visitor_interface.h" |
| 24 #include "net/tools/balsa/buffer_interface.h" | 23 #include "net/tools/balsa/buffer_interface.h" |
| 25 #include "net/tools/balsa/simple_buffer.h" | 24 #include "net/tools/balsa/simple_buffer.h" |
| 26 #include "net/tools/balsa/split.h" | 25 #include "net/tools/balsa/split.h" |
| 27 #include "net/tools/balsa/string_piece_utils.h" | 26 #include "net/tools/balsa/string_piece_utils.h" |
| 28 | 27 |
| 28 #if defined(COMPILER_MSVC) |
| 29 #include <string.h> |
| 30 #define strncasecmp _strnicmp |
| 31 #else |
| 32 #include <strings.h> |
| 33 #endif |
| 34 |
| 29 namespace net { | 35 namespace net { |
| 30 | 36 |
| 31 // Constants holding some header names for headers which can affect the way the | 37 // Constants holding some header names for headers which can affect the way the |
| 32 // HTTP message is framed, and so must be processed specially: | 38 // HTTP message is framed, and so must be processed specially: |
| 33 static const char kContentLength[] = "content-length"; | 39 static const char kContentLength[] = "content-length"; |
| 34 static const size_t kContentLengthSize = sizeof(kContentLength) - 1; | 40 static const size_t kContentLengthSize = sizeof(kContentLength) - 1; |
| 35 static const char kTransferEncoding[] = "transfer-encoding"; | 41 static const char kTransferEncoding[] = "transfer-encoding"; |
| 36 static const size_t kTransferEncodingSize = sizeof(kTransferEncoding) - 1; | 42 static const size_t kTransferEncodingSize = sizeof(kTransferEncoding) - 1; |
| 37 | 43 |
| 38 BalsaFrame::BalsaFrame() | 44 BalsaFrame::BalsaFrame() |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1549 << BalsaFrameEnums::ParseStateToString(parse_state_) | 1555 << BalsaFrameEnums::ParseStateToString(parse_state_) |
| 1550 << "$$$$$$$$$$$$$$$" | 1556 << "$$$$$$$$$$$$$$$" |
| 1551 << " consumed: " << (current - input); | 1557 << " consumed: " << (current - input); |
| 1552 if (Error()) { | 1558 if (Error()) { |
| 1553 LOG(INFO) << BalsaFrameEnums::ErrorCodeToString(ErrorCode()); | 1559 LOG(INFO) << BalsaFrameEnums::ErrorCodeToString(ErrorCode()); |
| 1554 } | 1560 } |
| 1555 #endif // DEBUGFRAMER | 1561 #endif // DEBUGFRAMER |
| 1556 return current - input; | 1562 return current - input; |
| 1557 } | 1563 } |
| 1558 | 1564 |
| 1559 const uint32 BalsaFrame::kValidTerm1; | |
| 1560 const uint32 BalsaFrame::kValidTerm1Mask; | |
| 1561 const uint32 BalsaFrame::kValidTerm2; | |
| 1562 const uint32 BalsaFrame::kValidTerm2Mask; | |
| 1563 | |
| 1564 } // namespace net | 1565 } // namespace net |
| OLD | NEW |