387 Commits

Author SHA1 Message Date
nop
abc11d7b6a Allow socket.listen on port 0 (#2152)
* Allow socket.listen on port 0

* Validate port string parsed from address

---------

Co-authored-by: byte.nop <byte.nop@gmail.com>
2026-05-12 12:50:01 +08:00
Cloud Wu
bbb12f3c85 update sproto 2025-12-29 18:51:36 +08:00
IAN.Z
bed435660e fix: httpc支持ipv6 (#2125)
* fix: httpc支持ipv6

* httpc ip:port解析放在c层

* lua-socket.c listen增加ip:port字符串解析, 相关cluster代码修改 #2124

* socketchannel changehost port可置空

* socketchannel changehost恢复port判空

* httpc解析域名加端口号逻辑优化

* 注释中字符串模式内容格式优化

---------

Co-authored-by: zhuyin.zhu <zhuyin.zhu@bytedance.com>
2025-12-27 17:11:52 +08:00
Bruce
ae034cf692 fix: use same hash seed when creating VM for shared tables (#2122)
When creating a new Lua VM to load shared tables, use the same hash
seed from the parent VM instead of generating a new random seed.

Different VMs have different hash seeds, causing identical strings to
have different hash values. When looking up string keys in a shared
table from another VM, the hash-based bucket lookup fails because the
search key's hash doesn't match the stored key's hash.

Solution: Pass G(L)->seed to lua_newstate() instead of using
luaL_newstate() which generates a new random seed each time.
2025-12-24 19:27:20 +08:00
Weitao Liu
2ecf32ec73 Fix spell error (#2098) 2025-10-16 23:10:14 +08:00
涵曦
754932cef4 feature: add bson_to_lightuserdata api. see #2074 (#2075) 2025-08-09 18:07:43 +08:00
EfveZombie
5eab3d7e22 lua-skynet: lerror 格式符使用 "%*s", 节省一次 strlen (#2051)
* lua-skynet: lerror 格式符使用 "%*s", 节省一次 strlen

* make skynet_strdup/skynet_strndup static, remove skynet_asprintf/skynet_vasprintf

---------

Co-authored-by: efve.zff <efve.zff@alibaba-inc.com>
2025-05-21 17:49:34 +08:00
Tom Lau
93e72a92ac allow t[nil] => nil in table returned by sharedata (#2037) 2025-03-06 12:03:30 +08:00
lcw4u
270ed6e198 fix: 调整一个错误描述 (#1991) 2024-10-24 09:40:49 +08:00
huojicha
839570ce3f 1.提供支持ipv6的udp client和server接口, 可支持ipv6 (#1967)
* 1.提供支持ipv6的udp client和server接口, 可支持ipv6

* remove chinese comments
2024-08-08 02:34:15 +08:00
89372a257d https set extension:server_name (#1960)
Co-authored-by: root <root@DESKTOP-5DF4NN3.localdomain>
2024-07-24 11:55:05 +08:00
华仔
18a6dc5786 typo rename faild to failed (#1901) 2024-04-10 13:51:03 +08:00
shencyx
f7453973f8 避免 sharedata 误用大于32位数字做 key 时,可能导致程序崩溃 (#1820)
Co-authored-by: shencyx <yixin.cen@alibaba-inc.com>
2023-11-07 11:52:58 +08:00
ykxpb
0e6423484f 修复 openssl3 deprecated warning ERR_load_BIO_strings (#1816) 2023-10-30 18:15:27 +08:00
子熏
223bd599ba 修复设置 callback导致的crash问题 (#1726)
* fix set callback in resolve _cb

* 调整注释

* 使用预处理callback 来解决引用问题

* add cb_pre and forward_pre

* delete precb_context

* format tab

---------

Co-authored-by: zixun <lb151450@alibaba-inc.com>
2023-03-29 10:42:31 +08:00
子熏
b9a5cec191 update sproto (#1720)
Co-authored-by: zixun <lb151450@alibaba-inc.com>
2023-03-21 21:37:03 +08:00
Cloud Wu
58b1bda0d9 first key can't can be in hash part, see #1484 2022-11-21 19:26:16 +08:00
Cloud Wu
94a76269aa Fix #1668 2022-10-27 15:30:06 +08:00
ykxpb
182a1a8d56 修复 mongo 编译告警,删除 unused function (#1650)
Co-authored-by: yy151474 <yy151474@alibaba-inc.com>
2022-09-20 22:20:14 +08:00
ykxpb
44e2583dc2 mongodb 交互协议调整为 OP_MSG (#1649)
* mongodb 交互协议调整为 OP_MSG

* Update

Co-authored-by: yy151474 <yy151474@alibaba-inc.com>
2022-09-20 10:56:33 +08:00
Cloud Wu
b61daaccf1 watchdog returns addr,port 2022-09-04 14:22:13 +08:00
Cloud Wu
800a3376d6 Revert "Update the return values of socket.listen, also return the real port bind to zero (#1638)"
This reverts commit c1eeba215d.
2022-09-03 22:03:11 +08:00
Cloud Wu
6dda5f7f98 Revert "udp socket bugfix (#1640)"
This reverts commit 2a8c095e38.
2022-09-03 22:02:45 +08:00
CKT
2a8c095e38 udp socket bugfix (#1640)
Co-authored-by: chenkete <kete.chen@centurygame.com>
2022-09-03 20:51:19 +08:00
zaxbbun
c1eeba215d Update the return values of socket.listen, also return the real port bind to zero (#1638) 2022-09-03 07:19:03 +08:00
yfy
0c1491ba99 修复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名字
2022-08-06 06:05:09 +08:00
云风
e37eb3cba0 Callback (#1571)
* Use independent thread for callback

* bugfix: use new cb_ctx when changing callback
2022-04-12 11:11:08 +08:00
Cloud Wu
0ddd938400 Clear callback function in main thread 2022-04-12 10:08:07 +08:00
Bruce
9fd7a51b34 Compat lua compile as cpp (#1568)
* Compat lua compile as cpp

* Compat lua compile as cpp
2022-04-07 17:22:32 +08:00
Cloud Wu
2660b10442 fix #1567 2022-04-07 15:19:53 +08:00
coder
c84f7354ff 删除多余snlua定义 (#1564) 2022-04-02 16:06:04 +08:00
liaodaiguo123
f72573a2aa base64:To improve compatibility, there may not be enough equal signs (#1561) 2022-03-31 18:57:03 +08:00
Cloud Wu
432b0c07f9 array may hash part only 2021-10-13 23:02:40 +08:00
Cloud Wu
58da8a1a22 Use lua_isinteger instead 2021-10-13 15:41:30 +08:00
Cloud Wu
0e11c78575 avoid string number 2021-10-13 15:36:19 +08:00
Cloud Wu
f80e2cd9b1 bugfix: See #1484 2021-10-13 12:57:55 +08:00
Cloud Wu
0ae839b2dd Check req size , See #1481 2021-09-30 11:24:36 +08:00
colin
6ee8d23ac4 ssl request support sni(Server Name Indication) (#1460)
* ssl support sni(Server Name Indication)

* ssl support sni(Server Name Indication)
2021-08-23 16:54:01 +08:00
子熏
2bfecfceae fix lua-seri rb_read (#1427)
Co-authored-by: zixun <lvzxiun@gmail.com>
2021-06-23 15:52:46 +08:00
colin
c2c585f73a freebsd compile error (#1414) 2021-06-03 19:13:30 +08:00
Cloud Wu
71317d8502 Add socket.resolve, see #1398 2021-05-17 11:16:24 +08:00
蒋祥龙
28d47d96b9 1.修复前一个ssl错误没清,导致后面的正常ssl调用操作 获取到这个错误 (#1401) 2021-05-14 21:07:27 +08:00
Cloud Wu
f61a27ac6b fix #1388 2021-04-19 18:45:56 +08:00
Cloud Wu
ceb278adf6 Add shutdown to client_socket for testing 2021-04-06 16:46:14 +08:00
云风
1a0461a9af Halfclose (#1338)
* post SOCKET_CLOSE when HALFCLOSE_READ, see #1331

* Add closing status

* Add closing stat in info, See #1333
2021-02-03 16:49:40 +08:00
Cloud Wu
649aee1a23 use unsigned long instead of uint32_t to match atomic ulong 2021-01-11 17:32:37 +08:00
Cloud Wu
933dbbd570 lua-bson atomic #1317 2021-01-11 17:30:04 +08:00
Cloud Wu
1e5e8354d7 stm_copy.reference is _Atomic type, #1317 2021-01-11 17:20:16 +08:00
子熏
c0e3421462 bugfix ltls init #1314 (#1318)
* bugfix ltls init #1314

* 修改init失败信息

* fix destructor

Co-authored-by: zixun <lvzxiun@gmail.com>
2021-01-11 15:15:25 +08:00
云风
b164e3a8a9 use stdatomic (#1317) 2021-01-11 10:54:34 +08:00