Fix srv_dst EOF on outbound connection before connection establishment, free conn, also move i/o debug lines to prevent segfault due to already freed srv_dst
log_dbg_level_printf(LOG_DBG_MODE_FINEST,">>>>>=================================== pxy_bev_eventcb: EOF on outbound connection before connection establishment, fd=%d\n",ctx->fd);
pxy_conn_free(ctx,1);
return;
}else{
#ifdef DEBUG_PROXY
if(OPTS_DEBUG(ctx->opts)){
log_dbg_printf("evbuffer size at EOF: "
"i:%zu o:%zu i:%zu o:%zu\n",
evbuffer_get_length(
bufferevent_get_input(bev)),
evbuffer_get_length(
bufferevent_get_output(bev)),
evbuffer_get_length(
bufferevent_get_input(other->bev)),
evbuffer_get_length(
bufferevent_get_output(other->bev))
);
}
#endif /* DEBUG_PROXY */
// @todo How to handle the following case?
if(!ctx->connected){
log_dbg_printf("EOF on outbound connection before "