On Sunday, June 3, 2012 3:48:28 AM UTC+2, Russ Cox wrote:
On Tue, May 29, 2012 at 10:24 PM, Peter Varga wrote:
When fcgi.Serve passed a nil net.Listener, line 250
src/pkg/net/http/fcgi/child.go, it will call net.FileListener(os.Stdin). see
line 95 in src/pgk/net/file.go, first line after the entry,
newFileFd(os.Stdin) is called, line 14, then the syscall.Dup is called with
f.Fd, here f is os.Stdin. On line 20 src/pkg/net/file.go, in func
this new fd passed to syscall.Getsockopt(fd, syscall.SOL_SOCKET,
syscall.SO_TYPE) and the getsockopt: socket operation on none socket error
happens at runtime. [1]
It sounds like stdin is not actually a socket, in which case the error
is correct. Are you running your fcgi program by hand or are you
letting the web server run it? Only when the web server invokes it
will os.Stdin be a valid argument to net.FileListener.

I got hit by this just now. And this thread proved for me to be quite hard
to google up. So thanks for the clarification.

This error can also occur when the web server runs my fcgi program as an
cgi. In my configuration that happens when the fcgi file does not have
suffix '.fcgi'

Maybe we should
make the fcgi package detect this case and issue a clearer error.

I think that would be helpful.


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
postedNov 29, '12 at 12:28p
activeNov 29, '12 at 12:28p

1 user in discussion

Jirkadanek7: 1 post



site design / logo © 2022 Grokbase