| 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 #ifndef NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 5 #ifndef NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ |
| 6 #define NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 6 #define NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ |
| 7 | 7 |
| 8 #include <arpa/inet.h> // in_addr_t | 8 #include <arpa/inet.h> // in_addr_t |
| 9 #include <time.h> | 9 #include <time.h> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 typedef std::list<DataFrame*> OutputList; | 40 typedef std::list<DataFrame*> OutputList; |
| 41 | 41 |
| 42 class SMConnection : public SMConnectionInterface, | 42 class SMConnection : public SMConnectionInterface, |
| 43 public EpollCallbackInterface, | 43 public EpollCallbackInterface, |
| 44 public NotifierInterface { | 44 public NotifierInterface { |
| 45 public: | 45 public: |
| 46 virtual ~SMConnection(); | 46 virtual ~SMConnection(); |
| 47 | 47 |
| 48 static SMConnection* NewSMConnection(EpollServer* epoll_server, | 48 static SMConnection* NewSMConnection(EpollServer* epoll_server, |
| 49 SSLState *ssl_state, | 49 SSLState* ssl_state, |
| 50 MemoryCache* memory_cache, | 50 MemoryCache* memory_cache, |
| 51 FlipAcceptor *acceptor, | 51 FlipAcceptor* acceptor, |
| 52 std::string log_prefix); | 52 std::string log_prefix); |
| 53 | 53 |
| 54 // TODO(mbelshe): Make these private. | 54 // TODO(mbelshe): Make these private. |
| 55 time_t last_read_time_; | 55 time_t last_read_time_; |
| 56 std::string server_ip_; | 56 std::string server_ip_; |
| 57 std::string server_port_; | 57 std::string server_port_; |
| 58 | 58 |
| 59 virtual EpollServer* epoll_server() OVERRIDE; | 59 virtual EpollServer* epoll_server() OVERRIDE; |
| 60 OutputList* output_list() { return &output_list_; } | 60 OutputList* output_list() { return &output_list_; } |
| 61 MemoryCache* memory_cache() { return memory_cache_; } | 61 MemoryCache* memory_cache() { return memory_cache_; } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 friend std::ostream& operator<<(std::ostream& os, const SMConnection& c) { | 118 friend std::ostream& operator<<(std::ostream& os, const SMConnection& c) { |
| 119 os << &c << "\n"; | 119 os << &c << "\n"; |
| 120 return os; | 120 return os; |
| 121 } | 121 } |
| 122 | 122 |
| 123 SMConnection(EpollServer* epoll_server, | 123 SMConnection(EpollServer* epoll_server, |
| 124 SSLState* ssl_state, | 124 SSLState* ssl_state, |
| 125 MemoryCache* memory_cache, | 125 MemoryCache* memory_cache, |
| 126 FlipAcceptor* acceptor, | 126 FlipAcceptor* acceptor, |
| 127 std::string log_prefix); | 127 std::string log_prefix); |
| 128 |
| 128 private: | 129 private: |
| 129 int fd_; | 130 int fd_; |
| 130 int events_; | 131 int events_; |
| 131 | 132 |
| 132 bool registered_in_epoll_server_; | 133 bool registered_in_epoll_server_; |
| 133 bool initialized_; | 134 bool initialized_; |
| 134 bool protocol_detected_; | 135 bool protocol_detected_; |
| 135 bool connection_complete_; | 136 bool connection_complete_; |
| 136 | 137 |
| 137 SMConnectionPoolInterface* connection_pool_; | 138 SMConnectionPoolInterface* connection_pool_; |
| 138 | 139 |
| 139 EpollServer *epoll_server_; | 140 EpollServer* epoll_server_; |
| 140 SSLState *ssl_state_; | 141 SSLState* ssl_state_; |
| 141 MemoryCache* memory_cache_; | 142 MemoryCache* memory_cache_; |
| 142 FlipAcceptor *acceptor_; | 143 FlipAcceptor* acceptor_; |
| 143 std::string client_ip_; | 144 std::string client_ip_; |
| 144 | 145 |
| 145 RingBuffer read_buffer_; | 146 RingBuffer read_buffer_; |
| 146 | 147 |
| 147 OutputList output_list_; | 148 OutputList output_list_; |
| 148 SMInterface* sm_spdy_interface_; | 149 SMInterface* sm_spdy_interface_; |
| 149 SMInterface* sm_http_interface_; | 150 SMInterface* sm_http_interface_; |
| 150 SMInterface* sm_streamer_interface_; | 151 SMInterface* sm_streamer_interface_; |
| 151 SMInterface* sm_interface_; | 152 SMInterface* sm_interface_; |
| 152 std::string log_prefix_; | 153 std::string log_prefix_; |
| 153 | 154 |
| 154 size_t max_bytes_sent_per_dowrite_; | 155 size_t max_bytes_sent_per_dowrite_; |
| 155 | 156 |
| 156 SSL* ssl_; | 157 SSL* ssl_; |
| 157 | 158 |
| 158 static bool force_spdy_; | 159 static bool force_spdy_; |
| 159 }; | 160 }; |
| 160 | 161 |
| 161 } // namespace net | 162 } // namespace net |
| 162 | 163 |
| 163 #endif // NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ | 164 #endif // NET_TOOLS_FLIP_SERVER_SM_CONNECTION_H_ |
| OLD | NEW |