add debug traces for http-upgrade code