2009-02-04 20:02 |
vieuxtech
Sam Roberts < <vieuxtech at gmail.com>
When I run xavante sputnik.ws (following the directions at
http://spu.tnik.org/en/Installation) and attempt to edit and save a
wiki page, I get a stack trace.
I believe that wsapi is not correctly read-looping on the tcp stream -
it appears to only read the POST data from the first two TCP segments.
That this happens for me, and not some others is consistent with it
being TCP timing related. I'm a long way away from the server, if you
are closer all the segments might arrive closer together.
Also, the parser is fragile, in fields(), if read_field_contents()
doesn't find a mime multipart delimiter, state.pos will be nil, and
read_field_header's string.sub() will get a pos of nil, and error.
Anyhow, the problem starts higher up, though, in wsapi's request.lua
(I added the assert):
local function parse_post_data(wsapi_env, tab)
...
elseif string.find(input_type, "multipart/form-data", 1, true) then
local length = tonumber(wsapi_env.CONTENT_LENGTH) or 0
if length > 0 then
local input = wsapi_env.input:read(length) or ""
assert(#input == length, string.format("attempted to read
content-length %d, got %d", length, #input))
parse_multipart_data(input, input_type, tab)
end
else
...
The mime Content-Length is 3709, but request.lua seems to consistently
only read 2261 bytes from the wsapi_env.input.
I wiresharked the connection, and Safari is sending a correctly formed
POST request, with all 3709 bytes of the data.
However, the data arrives in 4 TCP segments, and the first two
segments are 813 + 1448 = 2261 bytes.
That's exactly how many bytes input:read() is returning. Could be a
coincidence, but anyhow, its erroring because its not getting all the
POST data.
Cheers,
Sam
_______________________________________________
Sputnik-list mailing list
Sputnik-list@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-02-04 20:02 |
yuri
Yuri Takhteyev < <yuri at sims.berkeley.edu>
> I believe that wsapi is not correctly read-looping on the tcp stream - > it appears to only read the POST data from the first two TCP segments. Sam, thanks for the investigative work! I posted a reply to your message to the Kepler list (http://www.keplerproject.org/en/Mailing_List), so that we could get input from the larger Kepler community. Those on the Sputnik list who want to follow the issue and are not on the Kepler list could do that on the web: http://lists.luaforge.net/pipermail/kepler-project/2009-February/003095.html I'll report back to the Sputnik list with a summary, once we work something out. - yuri -- http://spu.tnik.org/ _______________________________________________ Sputnik-list mailing list Sputnik-list@lists.luaforge.net http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list
2009-02-04 20:02 |
yuri
Yuri Takhteyev < <yuri at sims.berkeley.edu>
> I'll report back to the Sputnik list with a summary, once we work something out.
Here is the promised summary. The issue turned out to be with copas
and was fixed in cvs. One should be able to install the updated
version with
luarocks --from=http://luarocks.luaforge.net/rocks-cvs/ install copas cvs
Once a new version of Kepler is out (hopefully soon now), I'll update
Sputnik installer to use it.
- yuri
--
http://spu.tnik.org/
_______________________________________________
Sputnik-list mailing list
Sputnik-list@lists.luaforge.net
http://lists.luaforge.net/cgi-bin/mailman/listinfo/sputnik-list