mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
修复https读取数据返回0报错 (#1622)
* 修复https读取数据返回0报错
./skynet/lualib/skynet.lua:861: ./skynet/lualib/skynet.lua:333: ./skynet/lualib/http/httpc.lua:109: ./skynet/lualib/http/tlshelper.lua:54: SSL_read error:6
stack traceback:
[C]: in function 'error'
./skynet/lualib/http/httpc.lua:109: in function 'http.httpc.request'
* http请求header中host头修改为默认的Host名字
This commit is contained in:
@@ -219,14 +219,17 @@ _ltls_context_read(lua_State* L) {
|
||||
|
||||
do {
|
||||
read = SSL_read(tls_p->ssl, outbuff, sizeof(outbuff));
|
||||
if(read <= 0) {
|
||||
if(read < 0) {
|
||||
int err = SSL_get_error(tls_p->ssl, read);
|
||||
ERR_clear_error();
|
||||
if(err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
|
||||
break;
|
||||
}
|
||||
luaL_error(L, "SSL_read error:%d", err);
|
||||
}else if(read <= sizeof(outbuff)) {
|
||||
}else if(read == 0){
|
||||
break;
|
||||
}
|
||||
else if(read <= sizeof(outbuff)) {
|
||||
luaL_addlstring(&b, outbuff, read);
|
||||
}else {
|
||||
luaL_error(L, "invalid SSL_read:%d", read);
|
||||
|
||||
Reference in New Issue
Block a user