@@ -100,40 +100,37 @@ Http1ServerSession::new_connection(NetVConnection *new_vc, MIOBuffer *iobuf, IOB
100100void
101101Http1ServerSession::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}
0 commit comments