[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: socket.http returns "No such file or directory" instead of http code on Solaris while running in Lane
- From: Petr Man <petr@...>
- Date: Tue, 8 Mar 2011 10:56:20 +0100
On Tue, Mar 8, 2011 at 09:13, Peter Odding <peter@peterodding.com> wrote:
> Coming from Linux my first instinct would be to run your script under
> strace [1] to see where the error code occurs. I'm not sure if strace is
> available on Solaris, but if it's not maybe similar tools exist? Looking
> at Wikipedia it mentions Truss and DTrace, maybe give one of those a
> try? Good luck!
Good morning,
I didn't think of strace, thanks. But I still don't know what is going on.
Without the lane, the relevant part of the truss output looks like this:
/1: connect(3, 0xFFBFF020, 16, SOV_DEFAULT) = 0
/1: send(3, 0x0006C378, 16, 0) = 16
/1: G E T / H T T P / 1 . 1\r\n
/1: send(3, 0x0006C470, 81, 0) = 81
/1: h o s t : o l l i e\r\n t e : t r a i l e r s\r\n c o n n e
/1: c t i o n : c l o s e , T E\r\n u s e r - a g e n t : L u
/1: a S o c k e t 2 . 0 . 2\r\n\r\n
/1: recv(3, 0x00068200, 8192, 0) Err#11 EAGAIN
/1: pollsys(0xFFBFE920, 1, 0xFFBFE9A8, 0x00000000) = 1
/1: recv(3, 0x00068200, 8192, 0) = 238
<snip> page content
/1: recv(3, 0x00068200, 8192, 0) Err#11 EAGAIN
/1: pollsys(0xFFBFE920, 1, 0xFFBFE9A8, 0x00000000) = 1
/1: recv(3, 0x00068200, 8192, 0) = 132
<snip> page content
/1: recv(3, 0x00068200, 8192, 0) Err#11 EAGAIN
/1: pollsys(0xFFBFE920, 1, 0xFFBFE9A8, 0x00000000) = 1
/1: recv(3, " 0\r\n\r\n", 8192, 0) = 5
/1: fcntl(3, F_GETFL) = 130
/1: fcntl(3, F_SETFL, FWRITE) = 0
/1: close(3) = 0
With the request in the lane, it looks pretty much the same, except
the pollsys() call doesn't come anymore.
/3: connect(3, 0xFED7B7F8, 16, SOV_DEFAULT) = 0
/3: send(3, 0x000851E0, 16, 0) = 16
/3: G E T / H T T P / 1 . 1\r\n
/3: send(3, 0x000852D8, 81, 0) = 81
/3: h o s t : o l l i e\r\n t e : t r a i l e r s\r\n c o n n e
/3: c t i o n : c l o s e , T E\r\n u s e r - a g e n t : L u
/3: a S o c k e t 2 . 0 . 2\r\n\r\n
/3: recv(3, 0x00081068, 8192, 0) Err#11 EAGAIN
/3: fcntl(3, F_GETFL) = 130
/3: fcntl(3, F_SETFL, FWRITE) = 0
/3: close(3) = 0
Could anyone try for me the following code for me on some other
platform then Windows/Solaris? I would like to know if it is Solaris
specific problem.
require("lanes")
local worker = lanes.gen("*",
function(uri)
local http = require("socket.http")
page, code, headers = http.request {
method = "GET",
url = uri
}
return {code}
end
)
local mylane = worker("http://example.com")
print(mylane[1][1])
Thanks,
Petr