Skip to content

Commit

Permalink
合并主干代码
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed Apr 16, 2024
2 parents 099fe0c + b1c418c commit e8ffc3a
Show file tree
Hide file tree
Showing 343 changed files with 1,283,979 additions and 4,203 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
4 changes: 2 additions & 2 deletions core/quanta/src/mainlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
extern "C" {
#endif

int luaopen_lssl(lua_State* L);
int luaopen_lbson(lua_State* L);
int luaopen_ljson(lua_State* L);
int luaopen_luapb(lua_State* L);
int luaopen_lualog(lua_State* L);
int luaopen_luabus(lua_State* L);
int luaopen_lcodec(lua_State* L);
int luaopen_lcrypt(lua_State* L);
int luaopen_lstdfs(lua_State* L);
int luaopen_ltimer(lua_State* L);
int luaopen_lsqlite(lua_State* L);
Expand All @@ -29,13 +29,13 @@ int luaopen_lworker(lua_State* L);
#define QUANTA_ARGS_NUM 2

static void luaL_open_worldlibs(lua_State* L) {
luaopen_lssl(L);
luaopen_lbson(L);
luaopen_ljson(L);
luaopen_luapb(L);
luaopen_lualog(L);
luaopen_luabus(L);
luaopen_lcodec(L);
luaopen_lcrypt(L);
luaopen_lstdfs(L);
luaopen_ltimer(L);
luaopen_lsqlite(L);
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 e8ffc3a

Please sign in to comment.