fix memory copy bug in upgrade to http2