fixed a bug in content-length transfer mode