Even More Rugby Fixes

The first bug fix went not as deep as I thought it should. The fix made it possible to evaluate Rugby shared functions where the first argument is a word.

Let's say that we have a Rugby shared function test-func in a net context and it returns the first argument:

net/test-func 'a
== a

But having multiple arguments where just one of them is a word, caused the same bug to appear again. test-func2 here accepts two arguments:

net/test-func2 5 'a
** Script Error: a has no value

The new fix, fixes this bug by asking whether the argument is of type any-word and converts it to a lit-word! before evaluating the function server side.
This happens inside Rugby's function to parse and collect function refinements and arguments. The change looks like this:

Before:
p2: [set w word!
(if ref-mode [append/only statement get bind to-word w 'comm])]

After:

p2: [set w word!
(if ref-mode [
w: get bind to-word w 'comm
append/only statement either any-word? w [to lit-word! w][w]]
)
]

I'm still troubled that this is not a truly elegant solution to the problem, treating the symptoms like this rather than going for the cause. It works for now though, and you can download the latest version 5.0.4 here.
The source file now also contains a history of changes made by me.
|

More Rugby Fixes

I finally found the "mirror" of a bug to an older MOLD bug, which prevented sending objects unharmed (e.g. properly MOLD'ed) from the server to the client. The mirror of that bug would not let objects go through from the client to the server, but that works now by changing the MOLD to MOLD/ALL in COMPOSE-MSG on both server and client.

CHECK-MSG in both the client and the server part of Rugby were broken and did not calculate the checksum of the message according to how the checksum is built in COMPOSE-MSG. This has also been fixed.

You can get the latest rugby.r here.

To compare, the older version without this fix is here.
|