| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/flip_server/streamer_interface.h" | 5 #include "net/tools/flip_server/streamer_interface.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "net/tools/balsa/balsa_frame.h" | 9 #include "net/tools/balsa/balsa_frame.h" |
| 10 #include "net/tools/flip_server/constants.h" | 10 #include "net/tools/flip_server/constants.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } else { | 166 } else { |
| 167 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "StraemerHttpSM: MessageDone."; | 167 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "StraemerHttpSM: MessageDone."; |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 void StreamerSM::ProcessHeaders(const BalsaHeaders& headers) { | 171 void StreamerSM::ProcessHeaders(const BalsaHeaders& headers) { |
| 172 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "HttpStreamerSM: Process Headers"; | 172 VLOG(2) << ACCEPTOR_CLIENT_IDENT << "HttpStreamerSM: Process Headers"; |
| 173 BalsaHeaders mod_headers; | 173 BalsaHeaders mod_headers; |
| 174 mod_headers.CopyFrom(headers); | 174 mod_headers.CopyFrom(headers); |
| 175 if (forward_ip_header_.length()) { | 175 if (forward_ip_header_.length()) { |
| 176 LOG(INFO) << "Adding forward header: " << forward_ip_header_; | 176 VLOG(0) << "Adding forward header: " << forward_ip_header_; |
| 177 mod_headers.ReplaceOrAppendHeader(forward_ip_header_, | 177 mod_headers.ReplaceOrAppendHeader(forward_ip_header_, |
| 178 connection_->client_ip()); | 178 connection_->client_ip()); |
| 179 } else { | 179 } else { |
| 180 LOG(INFO) << "NOT adding forward header."; | 180 VLOG(0) << "NOT adding forward header."; |
| 181 } | 181 } |
| 182 SimpleBuffer sb; | 182 SimpleBuffer sb; |
| 183 char* buffer; | 183 char* buffer; |
| 184 int size; | 184 int size; |
| 185 mod_headers.WriteHeaderAndEndingToBuffer(&sb); | 185 mod_headers.WriteHeaderAndEndingToBuffer(&sb); |
| 186 sb.GetReadablePtr(&buffer, &size); | 186 sb.GetReadablePtr(&buffer, &size); |
| 187 sm_other_interface_->ProcessWriteInput(buffer, size); | 187 sm_other_interface_->ProcessWriteInput(buffer, size); |
| 188 } | 188 } |
| 189 | 189 |
| 190 void StreamerSM::HandleHeaderError(BalsaFrame* framer) { | 190 void StreamerSM::HandleHeaderError(BalsaFrame* framer) { |
| 191 HandleError(); | 191 HandleError(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void StreamerSM::HandleChunkingError(BalsaFrame* framer) { | 194 void StreamerSM::HandleChunkingError(BalsaFrame* framer) { |
| 195 HandleError(); | 195 HandleError(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void StreamerSM::HandleBodyError(BalsaFrame* framer) { | 198 void StreamerSM::HandleBodyError(BalsaFrame* framer) { |
| 199 HandleError(); | 199 HandleError(); |
| 200 } | 200 } |
| 201 | 201 |
| 202 void StreamerSM::HandleError() { | 202 void StreamerSM::HandleError() { |
| 203 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Error detected"; | 203 VLOG(1) << ACCEPTOR_CLIENT_IDENT << "Error detected"; |
| 204 } | 204 } |
| 205 | 205 |
| 206 } // namespace net | 206 } // namespace net |
| 207 | 207 |
| OLD | NEW |