View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0001269 | Spring engine | Unit Scripting | public | 2009-01-16 10:44 | 2009-01-16 13:20 | ||||
Reporter | Evil4Zerggin | ||||||||
Assigned To | imbaczek | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | resolved | Resolution | fixed | ||||||
Product Version | 0.77b5 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0001269: Null Characters Break LuaMsg | ||||||||
Description | If you send a string containing null characters (which does not terminate the string in Lua) via LuaMsg, anything after the first null character gets received as garbage. This poses problems for transmission of binary data. I'm not sure how easy or hard it is to fix this. Demo widget to come. | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | |||||||||
Attached Files |
|
![]() |
|
Evil4Zerggin (reporter) 2009-01-16 10:53 |
Warning: This will spam you. ---------------------------------------------------------------- function widget:GetInfo() return { name = "Test", desc = "NT", author = "E4Z", date = "NA", license = "PD", layer = 1, enabled = false -- loaded by default? } end function widget:Update(dt) local msg = "abc\000abc" Spring.SendLuaUIMsg(msg, "a") Spring.Echo("Sent", string.byte(msg, 1, string.len(msg))) end function widget:RecvLuaMsg(msg) Spring.Echo("Recv", string.byte(msg, 1, string.len(msg))) end ---------------------------------------------------------------- Output: [ 0] Sent, 97, 98, 99, 0, 97, 98, 99 [ 0] Recv, 97, 98, 99, 0, 0, 144, 4 [ 0] Sent, 97, 98, 99, 0, 97, 98, 99 [ 0] Sent, 97, 98, 99, 0, 97, 98, 99 [ 0] Recv, 97, 98, 99, 0, 255, 118, 0 [ 0] Recv, 97, 98, 99, 0, 0, 200, 37 and so on. |
imbaczek (reporter) 2009-01-16 13:12 |
RecvLuaMsg is null-proof, but send isn't. fix on the way. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2009-01-16 10:44 | Evil4Zerggin | New Issue | |
2009-01-16 10:53 | Evil4Zerggin | Note Added: 0003181 | |
2009-01-16 13:12 | imbaczek | Note Added: 0003182 | |
2009-01-16 13:20 | imbaczek | Status | new => resolved |
2009-01-16 13:20 | imbaczek | Resolution | open => fixed |
2009-01-16 13:20 | imbaczek | Assigned To | => imbaczek |