Skip to content

Commit

Permalink
lssl添加
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Apr 11, 2024
1 parent a926656 commit 4e389a7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions extend/lssl/src/ssl/lssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ namespace lssl {
if (read < 0 || read > SSL_TLS_READ_SIZE) {
int err = SSL_get_error(ssl, read);
ERR_clear_error();
if (err == SSL_ERROR_WANT_READ || err == SSL_ERROR_WANT_WRITE) {
break;
}
throw lua_exception("SSL_read error:%d", err);
}
m_buf->pop_space(read);
Expand Down
5 changes: 2 additions & 3 deletions script/network/http_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,15 @@ function HttpClient:on_socket_recv(socket, proto, ...)
if proto == "TLS" then
return self:on_handshake(socket, ...)
end
log_debug("[HttpClient][on_socket_recv] client(proto:{}) message({})!", proto, {...})
return self:on_http_recv(socket, ...)
return self:on_http_recv(socket.token, ...)
end

function HttpClient:on_handshake(socket, codec, message)
log_debug("[HttpClient][on_handshake] message({})!", #message)
if message then
socket:send_data(message)
end
if codec.isfinish() then
log_debug("[HttpClient][on_handshake] success!")
thread_mgr:response(socket.session_id, socket)
end
end
Expand Down

0 comments on commit 4e389a7

Please sign in to comment.