OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ftp/ftp_ctrl_response_buffer.h" | 5 #include "net/ftp/ftp_ctrl_response_buffer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_piece.h" | 10 #include "base/strings/string_piece.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // static | 16 // static |
17 const int FtpCtrlResponse::kInvalidStatusCode = -1; | 17 const int FtpCtrlResponse::kInvalidStatusCode = -1; |
18 | 18 |
19 FtpCtrlResponse::FtpCtrlResponse() : status_code(kInvalidStatusCode) {} | 19 FtpCtrlResponse::FtpCtrlResponse() : status_code(kInvalidStatusCode) {} |
20 | 20 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 for (size_t i = 0; i < buffer_.length(); i++) { | 143 for (size_t i = 0; i < buffer_.length(); i++) { |
144 if (i >= 1 && buffer_[i - 1] == '\r' && buffer_[i] == '\n') { | 144 if (i >= 1 && buffer_[i - 1] == '\r' && buffer_[i] == '\n') { |
145 lines_.push(ParseLine(buffer_.substr(cut_pos, i - cut_pos - 1))); | 145 lines_.push(ParseLine(buffer_.substr(cut_pos, i - cut_pos - 1))); |
146 cut_pos = i + 1; | 146 cut_pos = i + 1; |
147 } | 147 } |
148 } | 148 } |
149 buffer_.erase(0, cut_pos); | 149 buffer_.erase(0, cut_pos); |
150 } | 150 } |
151 | 151 |
152 } // namespace net | 152 } // namespace net |
OLD | NEW |