httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corsix <>
Subject mod_wombat and luasocket
Date Fri, 08 Aug 2008 13:05:56 GMT

While using mod_wombat and attempting to use luasocket (with require
"socket"), I get a white screen. Assuming test.lua is:
-- code --
function handle(r)
  r:write "Start\n"
  require "socket"
  r:write "Done\n"
-- end code --
The expected output when requesting this page via a web browser would give:
If "socket" is changed to "lpeg" (assuming you have LPEG installed),
or the require line is commented out, then yes, that is the output.
However, as-is, the response is a blank screen. As far as I can tell,
the cause is this part of luasocket's usocket.c:
/* code */
* Initializes module
int socket_open(void) {
    /* instals a handler to ignore sigpipe or it will crash us */
    signal(SIGPIPE, SIG_IGN);
    return 1;
/* end code */
After commenting out the call to signal and recompiling, the above Lua
code will happily load socket.

Why does commenting out this call cause luasocket to now load, and
what undesired consequences are there of doing this?


View raw message