hprose-cpp1x
hprose-cpp1x copied to clipboard
使用Go服务器时,readsome阻塞问题
在原始http/asio/Transport.cpp
中,当服务器使用Transfer-Encoding: chunked
方式时,没有问题,但是在Go服务器中,没有使用这种方式,导致137行的readsome阻塞,程序无反应,修改方式如下:
// 125-129
bool nosize = !len;
size_t n = std::min<size_t>(len, response.size()); // 将header修改为response
for (size_t i = 0; i < n; ++i, --len) {
responseStream << (char) response_stream.get();
};
同时,使用VS编译时,因为有两套Client.h&cpp文件,编译会出现警告,并且生成时找不到部分实现,修改其中一套文件名就可以正常通过了!
建议使用boost库中的asio,否则编译问题很多....
修改完成的vs项目 https://github.com/BBDXF/hprosec1x-vs