Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into check_network
Browse files Browse the repository at this point in the history
# Conflicts:
#	script/driver/sqlite.lua
#	script/network/http_client.lua
#	script/store/store_kv.lua
  • Loading branch information
wangpeng committed Apr 15, 2024
2 parents 099fe0c + bd5309f commit 054f4b4
Show file tree
Hide file tree
Showing 342 changed files with 1,283,978 additions and 4,202 deletions.
4 changes: 2 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ stds.quanta = {
"quanta", "environ", "signal", "service", "logger",
"import", "class", "enum", "mixin", "property", "singleton", "super", "implemented",
"logfeature", "db_property", "classof", "is_class", "is_subclass", "instanceof", "conv_class", "class_review",
"codec", "crypt", "stdfs", "luabus", "luakit", "json", "protobuf", "curl", "timer", "aoi", "log", "worker", "http", "bson", "detour",
"lmdb", "unqlite", "sqlite"
"codec", "stdfs", "luabus", "luakit", "json", "protobuf", "timer", "aoi", "log", "worker", "http", "bson",
"detour", "lmdb", "unqlite", "sqlite", "ssl"
}
}
std = "max+quanta"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ luaext:
cd extend/laoi; make SOLUTION_DIR=$(CUR_DIR) -f laoi.mak;
cd extend/lbson; make SOLUTION_DIR=$(CUR_DIR) -f lbson.mak;
cd extend/lcodec; make SOLUTION_DIR=$(CUR_DIR) -f lcodec.mak;
cd extend/lcrypt; make SOLUTION_DIR=$(CUR_DIR) -f lcrypt.mak;
cd extend/ldetour; make SOLUTION_DIR=$(CUR_DIR) -f ldetour.mak;
cd extend/ljson; make SOLUTION_DIR=$(CUR_DIR) -f ljson.mak;
cd extend/lmdb; make SOLUTION_DIR=$(CUR_DIR) -f lmdb.mak;
cd extend/lsqlite; make SOLUTION_DIR=$(CUR_DIR) -f lsqlite.mak;
cd extend/lssl; make SOLUTION_DIR=$(CUR_DIR) -f lssl.mak;
cd extend/lstdfs; make SOLUTION_DIR=$(CUR_DIR) -f lstdfs.mak;
cd extend/ltimer; make SOLUTION_DIR=$(CUR_DIR) -f ltimer.mak;
cd extend/lualog; make SOLUTION_DIR=$(CUR_DIR) -f lualog.mak;
Expand Down
2 changes: 1 addition & 1 deletion core/luabus/src/lua_socket_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int lua_socket_node::call_data(lua_State* L) {
if (m_codec) {
size_t data_len = 0;
char* data = (char*)m_codec->encode(L, 1, &data_len);
if (data_len <= SOCKET_PACKET_MAX){
if (data_len > 0 && data_len <= SOCKET_PACKET_MAX){
m_mgr->send(m_token, data, data_len);
lua_pushinteger(L, data_len);
return 1;
Expand Down
9 changes: 4 additions & 5 deletions core/luabus/src/socket_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void socket_stream::stream_send(const char* data, size_t data_len)
while (data_len > 0) {
int send_len = ::send(m_socket, data, (int)data_len, 0);
if (send_len == 0) {
on_error("connection-lost");
on_error("connection-send-lost");
return;
}
if (send_len == SOCKET_ERROR) {
Expand Down Expand Up @@ -369,7 +369,7 @@ void socket_stream::do_send(size_t max_len, bool is_eof) {
return;
}
if (send_len == 0) {
on_error("connection-lost");
on_error("connection-send-lost");
return;
}
total_send += send_len;
Expand All @@ -380,8 +380,7 @@ void socket_stream::do_send(size_t max_len, bool is_eof) {
}
}

void socket_stream::do_recv(size_t max_len, bool is_eof)
{
void socket_stream::do_recv(size_t max_len, bool is_eof) {
size_t total_recv = 0;
while (total_recv < max_len && m_link_status == elink_status::link_connected) {
auto* space = m_recv_buffer->peek_space(SOCKET_RECV_LEN);
Expand Down Expand Up @@ -412,7 +411,7 @@ void socket_stream::do_recv(size_t max_len, bool is_eof)
return;
}
if (recv_len == 0) {
on_error("connection-lost");
on_error("connection-recv-lost");
return;
}
total_recv += recv_len;
Expand Down
2 changes: 2 additions & 0 deletions extend/lcodec/src/http.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ namespace lcodec {
if (parts.size() < 2) {
throw lua_exception("invalid http header");
}
//proto
lua_pushstring(L, "HTTP");
//status
string status = string(parts[1]);
if (lua_stringtonumber(L, status.c_str()) == 0) {
Expand Down
31 changes: 0 additions & 31 deletions extend/lcrypt/lcrypt.lmak

This file was deleted.

134 changes: 0 additions & 134 deletions extend/lcrypt/lcrypt.mak

This file was deleted.

96 changes: 0 additions & 96 deletions extend/lcrypt/lcrypt.vcxproj

This file was deleted.

Loading

0 comments on commit 054f4b4

Please sign in to comment.