Skip to content

Commit 2e5a4ed

Browse files
committed
Incorproate comments
1 parent 5ccc4dd commit 2e5a4ed

File tree

10 files changed

+113
-151
lines changed

10 files changed

+113
-151
lines changed

proxy/PoolableSession.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class PoolableSession : public ProxySession
9797
// singleton that keeps track of the connection counts.
9898
OutboundConnTrack::Group *conn_track_group = nullptr;
9999

100-
virtual IOBufferReader *get_reader() = 0;
100+
virtual IOBufferReader *get_remote_reader() = 0;
101101

102102
private:
103103
// Sessions become if authentication headers

proxy/ProxyTransaction.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,6 @@ ProxyTransaction::has_request_body(int64_t request_content_length, bool is_chunk
221221
return request_content_length > 0 || is_chunked;
222222
}
223223

224-
bool
225-
ProxyTransaction::is_read_closed() const
226-
{
227-
return false;
228-
}
229-
230224
void
231225
ProxyTransaction::attach_transaction(HttpSM *attach_sm)
232226
{

proxy/ProxyTransaction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class ProxyTransaction : public VConnection
4949
virtual void set_inactivity_timeout(ink_hrtime timeout_in);
5050
virtual void cancel_inactivity_timeout();
5151
virtual void cancel_active_timeout();
52-
virtual bool is_read_closed() const;
5352

5453
// Implement VConnection interface.
5554
VIO *do_io_read(Continuation *c, int64_t nbytes = INT64_MAX, MIOBuffer *buf = nullptr) override;
@@ -130,7 +129,7 @@ class ProxyTransaction : public VConnection
130129
//
131130
HttpSessionAccept::Options upstream_outbound_options; // overwritable copy of options
132131

133-
IOBufferReader *get_reader();
132+
IOBufferReader *get_remote_reader();
134133

135134
protected:
136135
ProxySession *_proxy_ssn = nullptr;
@@ -285,7 +284,7 @@ ProxyTransaction::adjust_thread(Continuation *cont, int event, void *data)
285284
}
286285

287286
inline IOBufferReader *
288-
ProxyTransaction::get_reader()
287+
ProxyTransaction::get_remote_reader()
289288
{
290289
return _reader;
291290
}

proxy/http/Http1ClientSession.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ Http1ClientSession::attach_server_session(PoolableSession *ssession, bool transa
485485
// have it call the client session back. This IO also prevent
486486
// the server net conneciton from calling back a dead sm
487487
SET_HANDLER(&Http1ClientSession::state_keep_alive);
488-
slave_ka_vio = ssession->do_io_read(this, INT64_MAX, ssession->get_reader()->mbuf);
488+
slave_ka_vio = ssession->do_io_read(this, INT64_MAX, ssession->get_remote_reader()->mbuf);
489489
ink_assert(slave_ka_vio != ka_vio);
490490

491491
// Transfer control of the write side as well

proxy/http/Http1ServerSession.cc

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,40 +100,37 @@ Http1ServerSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOB
100100
void
101101
Http1ServerSession::do_io_close(int alerrno)
102102
{
103-
if (state == SSN_CLOSED) { // Already been closed
104-
if (transact_count == released_transactions) {
105-
this->destroy();
106-
}
107-
return;
108-
}
103+
// Only do the close bookkeeping 1 time
104+
if (state != SSN_CLOSED) {
105+
ts::LocalBufferWriter<256> w;
106+
bool debug_p = is_debug_tag_set("http_ss");
109107

110-
ts::LocalBufferWriter<256> w;
111-
bool debug_p = is_debug_tag_set("http_ss");
108+
state = SSN_CLOSED;
112109

113-
state = SSN_CLOSED;
110+
if (debug_p) {
111+
w.print("[{}] session close: nevtc {:x}", con_id, _vc);
112+
}
114113

115-
if (debug_p) {
116-
w.print("[{}] session close: nevtc {:x}", con_id, _vc);
117-
}
114+
HTTP_SUM_GLOBAL_DYN_STAT(http_current_server_connections_stat, -1); // Make sure to work on the global stat
115+
HTTP_SUM_DYN_STAT(http_transactions_per_server_con, transact_count);
118116

119-
HTTP_SUM_GLOBAL_DYN_STAT(http_current_server_connections_stat, -1); // Make sure to work on the global stat
120-
HTTP_SUM_DYN_STAT(http_transactions_per_server_con, transact_count);
117+
// Update upstream connection tracking data if present.
118+
this->release_outbound_connection_tracking();
121119

122-
// Update upstream connection tracking data if present.
123-
this->release_outbound_connection_tracking();
120+
if (debug_p) {
121+
Debug("http_ss", "%.*s", static_cast<int>(w.size()), w.data());
122+
}
124123

125-
if (debug_p) {
126-
Debug("http_ss", "%.*s", static_cast<int>(w.size()), w.data());
127-
}
124+
if (_vc) {
125+
_vc->do_io_close(alerrno);
126+
}
127+
_vc = nullptr;
128128

129-
if (_vc) {
130-
_vc->do_io_close(alerrno);
129+
if (to_parent_proxy) {
130+
HTTP_DECREMENT_DYN_STAT(http_current_parent_proxy_connections_stat);
131+
}
131132
}
132-
_vc = nullptr;
133133

134-
if (to_parent_proxy) {
135-
HTTP_DECREMENT_DYN_STAT(http_current_parent_proxy_connections_stat);
136-
}
137134
if (transact_count == released_transactions) {
138135
this->destroy();
139136
}
@@ -254,6 +251,6 @@ Http1ServerSession::new_transaction()
254251
state = SSN_IN_USE;
255252
transact_count++;
256253
ink_release_assert(transact_count == (released_transactions + 1));
257-
trans.set_reader(this->get_reader());
254+
trans.set_reader(this->get_remote_reader());
258255
return &trans;
259256
}

proxy/http/Http1ServerSession.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Http1ServerSession : public PoolableSession
7878
void free() override;
7979
bool is_chunked_encoding_supported() const override;
8080

81-
IOBufferReader *get_reader() override;
81+
IOBufferReader *get_remote_reader() override;
8282
IpEndpoint const &get_server_ip() const;
8383

8484
ProxyTransaction *new_transaction() override;
@@ -113,7 +113,7 @@ extern ClassAllocator<Http1ServerSession, true> httpServerSessionAllocator;
113113
// INLINE
114114

115115
inline IOBufferReader *
116-
Http1ServerSession::get_reader()
116+
Http1ServerSession::get_remote_reader()
117117
{
118118
return _reader;
119119
};

0 commit comments

Comments
 (0)