return;
}
- http_vfts[hc->version].transport_close_callback (hc);
+ /* in case nothing received on cleartext connection before timeout */
+ if (PREDICT_FALSE (hc->version != HTTP_VERSION_NA))
+ http_vfts[hc->version].transport_close_callback (hc);
http_disconnect_transport (hc);
}
hc = http_conn_get_w_thread (hc_handle.conn_index, ts->thread_index);
hc->state = HTTP_CONN_STATE_CLOSED;
- http_vfts[hc->version].transport_reset_callback (hc);
+ /* in case peer reset cleartext connection before send something */
+ if (PREDICT_FALSE (hc->version != HTTP_VERSION_NA))
+ http_vfts[hc->version].transport_reset_callback (hc);
http_disconnect_transport (hc);
}
if (!(hc->flags & HTTP_CONN_F_PENDING_TIMER))
http_conn_timer_stop (hc);
- http_vfts[hc->version].conn_cleanup_callback (hc);
+ /* in case nothing received on cleartext connection */
+ if (PREDICT_FALSE (hc->version != HTTP_VERSION_NA))
+ http_vfts[hc->version].conn_cleanup_callback (hc);
if (!(hc->flags & HTTP_CONN_F_IS_SERVER))
{