You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* punch an allow list in for Lua functions
* implement lua function allow listing
* test to make sure we're exporting exactly what Redis does by default, and we can configure it reasonably; implements a number of workarounds to accomplish this, as the 5.1 <-> 5.4 Lua version difference also had some library changes
* implement cjson.encode and decode
* implement bit.xxx operations in Lua scripts; the rules around these are pretty sloppy, so ran tests against Redis first to verify matching behavior
* fix typo in AllowedFunctions
* implement message pack support (cmsgpack.pack and cmsgpack.unpack)
* implement struct.pack/unpack/size; these are provided by Lua and are a superset of what Redis wants; technically we allow more than Redis does, but I think that's a reasonable tradeoff for implementation complexity
* allow redis functions to be allowed/denied rather than unconditionally included
* fix formatting
* Move intermediate binary blobs onto ScratchBufferManager
* formatting
* strange this doesn't error locally; removing preview use of params ReadOnlySpan<T>
* test for #1079, fails in main and passes here
* tests (and fixes) for math.frexp and math.ldexp
* tests for table.maxn and loadstring
* prevent LuaAllowedFunctions from importing functions not on the default import list
* enforce maximum depth for cjson functions
* enforce maximum encoding depth for cmsgpack.pack
* hey, a reliable-ish repro for the linux longjmp issue; disable these exception tests on Linux until that refactor happens
* condition more exception tests on 'we're on Windows' until the refactor comes in
* knock out a missing TODO; remove List<byte> and use scratch buffer instead
* Update test/Garnet.test/LuaScriptRunnerTests.cs
Co-authored-by: Copilot <[email protected]>
* add more conditions to skip exceptions in .NET 9 or non-Windows builds; consolidate condition checks; restore non-error-y parts of tests in .NET 9 and non-Windows builds
---------
Co-authored-by: Copilot <[email protected]>
// If that fails, figure out exactly how much space we need
128
+
varneededBytes=Encoding.UTF8.GetByteCount(str);
129
+
ExpandScratchBufferIfNeeded(neededBytes);
130
+
131
+
space=FullBuffer()[scratchBufferOffset..];
132
+
written=Encoding.UTF8.GetBytes(str,space);
133
+
}
134
+
135
+
returnspace[..written];
136
+
}
137
+
117
138
/// <summary>
118
139
/// Create an ArgSlice that includes a header of specified size, followed by RESP Bulk-String formatted versions of the specified ArgSlice values (arg1 and arg2)
0 commit comments