diff options
Diffstat (limited to 'net')
20 files changed, 80 insertions, 82 deletions
diff --git a/net/tools/flip_server/balsa_enums.h b/net/tools/flip_server/balsa_enums.h index 342b3bf..c665c16 100644 --- a/net/tools/flip_server/balsa_enums.h +++ b/net/tools/flip_server/balsa_enums.h @@ -5,7 +5,7 @@ #ifndef NET_TOOLS_FLIP_SERVER_BALSA_ENUMS_H_ #define NET_TOOLS_FLIP_SERVER_BALSA_ENUMS_H_ -namespace gfe2 { +namespace net { struct BalsaFrameEnums { enum ParseState { @@ -105,7 +105,7 @@ struct BalsaHeadersEnums { }; }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BALSA_ENUMS_H_ diff --git a/net/tools/flip_server/balsa_frame.cc b/net/tools/flip_server/balsa_frame.cc index 39695cd..fca045e 100644 --- a/net/tools/flip_server/balsa_frame.cc +++ b/net/tools/flip_server/balsa_frame.cc @@ -28,7 +28,7 @@ #include "strings/stringpiece_utils.h" #endif -namespace gfe2 { +namespace net { // Constants holding some header names for headers which can affect the way the // HTTP message is framed, and so must be processed specially: @@ -1567,5 +1567,5 @@ const int32 BalsaFrame::kValidTerm1Mask; const int32 BalsaFrame::kValidTerm2; const int32 BalsaFrame::kValidTerm2Mask; -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/balsa_frame.h b/net/tools/flip_server/balsa_frame.h index 25e9e54..0799981 100644 --- a/net/tools/flip_server/balsa_frame.h +++ b/net/tools/flip_server/balsa_frame.h @@ -22,7 +22,7 @@ // For additional debug output, uncomment the following: // #define DEBUGFRAMER 1 -namespace gfe2 { +namespace net { // BalsaFrame is a 'Model' of a framer (haha). // It exists as a proof of concept headers framer. @@ -277,7 +277,7 @@ class BalsaFrame { DoNothingBalsaVisitor do_nothing_visitor_; }; -} // namespace gfe2; +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BALSA_FRAME_H_ diff --git a/net/tools/flip_server/balsa_headers.cc b/net/tools/flip_server/balsa_headers.cc index c957a82..82a0279 100644 --- a/net/tools/flip_server/balsa_headers.cc +++ b/net/tools/flip_server/balsa_headers.cc @@ -63,7 +63,7 @@ REGISTER_MODULE_INITIALIZER(multivalued_headers, InitMultivaluedHeaders()); } // namespace -namespace gfe2 { +namespace net { const size_t BalsaBuffer::kDefaultBlocksize; @@ -744,5 +744,5 @@ void BalsaHeaders::SetResponseReasonPhrase(const StringPiece& reason) { SetRequestVersion(reason); } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/balsa_headers.h b/net/tools/flip_server/balsa_headers.h index f7d9512..0eb83a5 100644 --- a/net/tools/flip_server/balsa_headers.h +++ b/net/tools/flip_server/balsa_headers.h @@ -43,7 +43,7 @@ struct StringPieceCaseEqual { #include "strings/stringpiece_utils.h" #endif -namespace gfe2 { +namespace net { // WARNING: // Note that -no- char* returned by any function in this @@ -415,7 +415,7 @@ class BalsaHeaders { }; typedef vector<StringPiece> HeaderTokenList; - friend bool gfe2::ParseHTTPFirstLine(const char* begin, + friend bool net::ParseHTTPFirstLine(const char* begin, const char* end, bool is_request, size_t max_request_uri_length, @@ -789,8 +789,6 @@ class BalsaHeaders { void CopyFrom(const BalsaHeaders& other); - // TODO(fenix): remove this function and rename all occurances - // of it in the code to AppendHeader... void HackHeader(const StringPiece& key, const StringPiece& value); // Same as AppendToHeader, except that it will attempt to preserve @@ -1295,7 +1293,7 @@ class BalsaHeaders { HeaderLines header_lines_; }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BALSA_HEADERS_H_ diff --git a/net/tools/flip_server/balsa_headers_token_utils.cc b/net/tools/flip_server/balsa_headers_token_utils.cc index 5e27bd0..0a56c5d 100644 --- a/net/tools/flip_server/balsa_headers_token_utils.cc +++ b/net/tools/flip_server/balsa_headers_token_utils.cc @@ -6,7 +6,7 @@ #include "strings/stringpiece_utils.h" -namespace gfe2 { +namespace net { inline void BalsaHeadersTokenUtils::TokenizeHeaderLine( const BalsaHeaders& headers, @@ -139,5 +139,5 @@ void BalsaHeadersTokenUtils::ParseTokenList( } } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/balsa_headers_token_utils.h b/net/tools/flip_server/balsa_headers_token_utils.h index 450c089..31ae8ee 100644 --- a/net/tools/flip_server/balsa_headers_token_utils.h +++ b/net/tools/flip_server/balsa_headers_token_utils.h @@ -11,7 +11,7 @@ #include "net/tools/flip_server/balsa_headers.h" #include "strings/stringpiece.h" -namespace gfe2 { +namespace net { class BalsaHeadersTokenUtils { public: @@ -55,7 +55,7 @@ class BalsaHeadersTokenUtils { BalsaHeadersTokenUtils(); // Prohibit instantiation }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BALSA_HEADERS_TOKEN_UTILS_H_ diff --git a/net/tools/flip_server/balsa_visitor_interface.h b/net/tools/flip_server/balsa_visitor_interface.h index be6fa98..c932ff8 100644 --- a/net/tools/flip_server/balsa_visitor_interface.h +++ b/net/tools/flip_server/balsa_visitor_interface.h @@ -7,7 +7,7 @@ #include <cstddef> -namespace gfe2 { +namespace net { class BalsaFrame; class BalsaHeaders; @@ -175,7 +175,7 @@ class BalsaVisitorInterface { virtual void HandleBodyError(BalsaFrame* framer) = 0; }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BALSA_VISITOR_INTERFACE_H_ diff --git a/net/tools/flip_server/buffer_interface.h b/net/tools/flip_server/buffer_interface.h index 7f38fa1..ec061c9 100644 --- a/net/tools/flip_server/buffer_interface.h +++ b/net/tools/flip_server/buffer_interface.h @@ -5,7 +5,7 @@ #ifndef NET_TOOLS_FLIP_SERVER_BUFFER_INTERFACE_H__ #define NET_TOOLS_FLIP_SERVER_BUFFER_INTERFACE_H__ -namespace gfe2 { +namespace net { class BufferInterface { public: @@ -115,7 +115,7 @@ class BufferInterface { BufferInterface() {} }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_BUFFER_INTERFACE__H__ diff --git a/net/tools/flip_server/create_listener.cc b/net/tools/flip_server/create_listener.cc index 1a1998d..94d7ae4 100644 --- a/net/tools/flip_server/create_listener.cc +++ b/net/tools/flip_server/create_listener.cc @@ -15,7 +15,7 @@ #include "base/logging.h" -namespace gfe2 { +namespace net { // used to ensure we delete the addrinfo structure // alloc'd by getaddrinfo @@ -175,5 +175,5 @@ void CreateListeningSocket(const string& host, *listen_fd = sock; } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/create_listener.h b/net/tools/flip_server/create_listener.h index 3e6c9bb..7541260 100644 --- a/net/tools/flip_server/create_listener.h +++ b/net/tools/flip_server/create_listener.h @@ -8,7 +8,7 @@ #include <iostream> #include <string> -namespace gfe2 { +namespace net { // Summary: // creates a socket for listening, and bind()s and listen()s it. @@ -39,7 +39,7 @@ void CreateListeningSocket(const string& host, bool reuseport, ostream* error_stream); -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_CREATE_LISTENER_H__ diff --git a/net/tools/flip_server/epoll_server.cc b/net/tools/flip_server/epoll_server.cc index 2597ada..0d8d46fd 100644 --- a/net/tools/flip_server/epoll_server.cc +++ b/net/tools/flip_server/epoll_server.cc @@ -55,7 +55,7 @@ // The size we use for buffers passed to strerror_r static const int kErrorBufferSize = 256; -namespace gfe2 { +namespace net { // Clears the pipe and returns. Used for waking the epoll server up. class ReadPipeCallback : public EpollCallbackInterface { @@ -146,7 +146,7 @@ void EpollServer::CleanupTimeToAlarmCBMap() { EpollServer::~EpollServer() { DCHECK_EQ(in_shutdown_, false); in_shutdown_ = true; -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING LOG(INFO) << "\n" << event_recorder_; #endif VLOG(2) << "Shutting down epoll server "; @@ -263,7 +263,7 @@ void EpollServer::UnregisterFD(int fd) { // inside the callchain of OnEvent. return; } -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordUnregistration(fd); #endif CB* cb = fd_i->cb; @@ -311,7 +311,7 @@ void EpollServer::StartWrite(int fd) { } void EpollServer::HandleEvent(int fd, int event_mask) { -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordEpollEvent(fd, event_mask); #endif FDToCBMap::iterator fd_i = cb_map_.find(CBAndEventMask(NULL, 0, fd)); @@ -540,7 +540,7 @@ void EpollServer::LogStateOnCrash() { void EpollServer::DelFD(int fd) const { struct epoll_event ee; memset(&ee, 0, sizeof(ee)); -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordFDMaskEvent(fd, 0, "DelFD"); #endif if (epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, fd, &ee)) { @@ -558,7 +558,7 @@ void EpollServer::AddFD(int fd, int event_mask) const { memset(&ee, 0, sizeof(ee)); ee.events = event_mask | EPOLLERR | EPOLLHUP; ee.data.fd = fd; -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordFDMaskEvent(fd, ee.events, "AddFD"); #endif if (epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, fd, &ee)) { @@ -576,7 +576,7 @@ void EpollServer::ModFD(int fd, int event_mask) const { memset(&ee, 0, sizeof(ee)); ee.events = event_mask | EPOLLERR | EPOLLHUP; ee.data.fd = fd; -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordFDMaskEvent(fd, ee.events, "ModFD"); #endif VLOG(3) << "modifying fd= " << fd << " " @@ -644,7 +644,7 @@ void EpollServer::WaitForEventsAndCallHandleEvents(int64 timeout_in_us, << " events at a time, so events[] should be larger."; } -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING event_recorder_.RecordEpollWaitEvent(timeout_in_ms, nfds); #endif @@ -818,5 +818,5 @@ void EpollAlarm::UnregisterIfRegistered() { eps_->UnregisterAlarm(token_); } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/epoll_server.h b/net/tools/flip_server/epoll_server.h index 5999aa4..12c8924 100644 --- a/net/tools/flip_server/epoll_server.h +++ b/net/tools/flip_server/epoll_server.h @@ -15,9 +15,9 @@ #include <set> #include <vector> -// #define GFE_GFE2_EPOLL_SERVER_EVENT_TRACING 1 +// #define EPOLL_SERVER_EVENT_TRACING 1 // -// Defining GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +// Defining EPOLL_SERVER_EVENT_TRACING // causes code to exist which didn't before. // This code tracks each event generated by the epollserver, // as well as providing a per-fd-registered summary of @@ -29,7 +29,7 @@ // A structure called 'EventRecorder' will exist when // the macro is defined. See the EventRecorder class interface // within the EpollServer class for more details. -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING #include <iostream> #include "base/logging.h" #endif @@ -43,7 +43,7 @@ #include "net/base/epollstubs.h" #endif -namespace gfe2 { +namespace net { class EpollServer; class EpollAlarmCallbackInterface; @@ -727,7 +727,7 @@ class EpollServer { // TODO(sushantj): Add test for this. int64 DoRoundingOnNow(int64 now_in_us) const; -#ifdef GFE_GFE2_EPOLL_SERVER_EVENT_TRACING +#ifdef EPOLL_SERVER_EVENT_TRACING struct EventRecorder { public: EventRecorder() : num_records_(0), record_threshold_(10000) {} @@ -1065,7 +1065,7 @@ class EpollAlarm : public EpollAlarmCallbackInterface { bool registered_; }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_EPOLL_SERVER_H_ diff --git a/net/tools/flip_server/flip_in_mem_edsm_server.cc b/net/tools/flip_server/flip_in_mem_edsm_server.cc index 7eab376..a32d74b 100644 --- a/net/tools/flip_server/flip_in_mem_edsm_server.cc +++ b/net/tools/flip_server/flip_in_mem_edsm_server.cc @@ -92,35 +92,35 @@ DEFINE_string(record_path, ".", "The path to save the record files"); //////////////////////////////////////////////////////////////////////////////// -using gfe_flip::CONTROL_FLAG_NONE; -using gfe_flip::DATA_FLAG_COMPRESSED; -using gfe_flip::DATA_FLAG_FIN; -using gfe_flip::FIN_STREAM; -using gfe_flip::FlipControlFrame; -using gfe_flip::FlipFrame; -using gfe_flip::FlipDataFlags; -using gfe_flip::FlipDataFrame; -using gfe_flip::FlipFrameBuilder; -using gfe_flip::FlipFramer; -using gfe_flip::FlipFramerVisitorInterface; -using gfe_flip::FlipHeaderBlock; -using gfe_flip::FlipFinStreamControlFrame; -using gfe_flip::FlipStreamId; -using gfe_flip::FlipSynReplyControlFrame; -using gfe_flip::FlipSynStreamControlFrame; -using gfe_flip::SYN_REPLY; -using gfe_flip::SYN_STREAM; -using gfe2::BalsaFrame; -using gfe2::BalsaFrameEnums; -using gfe2::BalsaHeaders; -using gfe2::BalsaHeadersEnums; -using gfe2::BalsaVisitorInterface; -using gfe2::EpollAlarmCallbackInterface; -using gfe2::EpollCallbackInterface; -using gfe2::EpollEvent; -using gfe2::EpollServer; -using gfe2::RingBuffer; -using gfe2::SimpleBuffer; +using flip::CONTROL_FLAG_NONE; +using flip::DATA_FLAG_COMPRESSED; +using flip::DATA_FLAG_FIN; +using flip::FIN_STREAM; +using flip::FlipControlFrame; +using flip::FlipFrame; +using flip::FlipDataFlags; +using flip::FlipDataFrame; +using flip::FlipFrameBuilder; +using flip::FlipFramer; +using flip::FlipFramerVisitorInterface; +using flip::FlipHeaderBlock; +using flip::FlipFinStreamControlFrame; +using flip::FlipStreamId; +using flip::FlipSynReplyControlFrame; +using flip::FlipSynStreamControlFrame; +using flip::SYN_REPLY; +using flip::SYN_STREAM; +using net::BalsaFrame; +using net::BalsaFrameEnums; +using net::BalsaHeaders; +using net::BalsaHeadersEnums; +using net::BalsaVisitorInterface; +using net::EpollAlarmCallbackInterface; +using net::EpollCallbackInterface; +using net::EpollEvent; +using net::EpollServer; +using net::RingBuffer; +using net::SimpleBuffer; using net::UrlUtilities; //////////////////////////////////////////////////////////////////////////////// @@ -2077,7 +2077,7 @@ int CreateListeningSocket(int port, int backlog_size, snprintf(port_buf, sizeof(port_buf), "%d", port); cerr <<" Attempting to listen on port: " << port_buf << "\n"; cerr <<" input port: " << port << "\n"; - gfe2::CreateListeningSocket("", + net::CreateListeningSocket("", port_buf, true, backlog_size, diff --git a/net/tools/flip_server/http_message_constants.cc b/net/tools/flip_server/http_message_constants.cc index 8d3b7f8..e60fb1c 100644 --- a/net/tools/flip_server/http_message_constants.cc +++ b/net/tools/flip_server/http_message_constants.cc @@ -4,7 +4,7 @@ #include "net/tools/flip_server/http_message_constants.h" -namespace gfe2 { +namespace net { const char* get_http_status_message(int status_message) { switch (status_message) { @@ -142,5 +142,5 @@ const int http_status_codes[] = { const int http_status_code_count = sizeof(http_status_codes) / sizeof(http_status_codes[0]); -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/http_message_constants.h b/net/tools/flip_server/http_message_constants.h index fdee50b..de700cc 100644 --- a/net/tools/flip_server/http_message_constants.h +++ b/net/tools/flip_server/http_message_constants.h @@ -5,13 +5,13 @@ #ifndef NET_TOOLS_FLIP_SERVER_HTTP_MESSAGE_CONSTANTS_H__ #define NET_TOOLS_FLIP_SERVER_HTTP_MESSAGE_CONSTANTS_H__ -namespace gfe2 { +namespace net { const char* get_http_status_message(int status_message); extern const int http_status_codes[]; extern const int http_status_code_count; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_HTTP_MESSAGE_CONSTANTS_H__ diff --git a/net/tools/flip_server/ring_buffer.cc b/net/tools/flip_server/ring_buffer.cc index 9f702a0..2662edf 100644 --- a/net/tools/flip_server/ring_buffer.cc +++ b/net/tools/flip_server/ring_buffer.cc @@ -5,7 +5,7 @@ #include "net/tools/flip_server/ring_buffer.h" #include "base/logging.h" -namespace gfe2 { +namespace net { RingBuffer::RingBuffer(int buffer_size) : buffer_(new char[buffer_size]), @@ -261,5 +261,5 @@ void RingBuffer::Resize(int buffer_size) { write_idx_ = bytes_used_ % buffer_size_; } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/ring_buffer.h b/net/tools/flip_server/ring_buffer.h index 75b1756..63d4be2 100644 --- a/net/tools/flip_server/ring_buffer.h +++ b/net/tools/flip_server/ring_buffer.h @@ -8,7 +8,7 @@ #include "base/scoped_ptr.h" #include "net/tools/flip_server/buffer_interface.h" -namespace gfe2 { +namespace net { // The ring buffer is a circular buffer, that is, reads or writes may wrap // around the end of the linear memory contained by the class (and back to @@ -106,7 +106,7 @@ class RingBuffer : public BufferInterface { void operator=(const RingBuffer&); }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_RING_BUFFER_H__ diff --git a/net/tools/flip_server/simple_buffer.cc b/net/tools/flip_server/simple_buffer.cc index dc28e4c..6501d54 100644 --- a/net/tools/flip_server/simple_buffer.cc +++ b/net/tools/flip_server/simple_buffer.cc @@ -16,7 +16,7 @@ // qualify the method calls, thus disabling the virtual dispatch and enable // inlining. -namespace gfe2 { +namespace net { static const int kInitialSimpleBufferSize = 10; @@ -200,5 +200,5 @@ inline void SimpleBuffer::AdvanceWritablePtr(int amount_to_advance) { } } -} // namespace gfe2 +} // namespace net diff --git a/net/tools/flip_server/simple_buffer.h b/net/tools/flip_server/simple_buffer.h index 20d52748..33a6a0c 100644 --- a/net/tools/flip_server/simple_buffer.h +++ b/net/tools/flip_server/simple_buffer.h @@ -9,7 +9,7 @@ #include "net/tools/flip_server/buffer_interface.h" -namespace gfe2 { +namespace net { class SimpleBuffer : public BufferInterface { public: @@ -88,7 +88,7 @@ class SimpleBuffer : public BufferInterface { //DISALLOW_COPY_AND_ASSIGN(SimpleBuffer); }; -} // namespace gfe2 +} // namespace net #endif // NET_TOOLS_FLIP_SERVER_SIMPLE_BUFFER_H__ |