diff options
author | Johan Sørensen <johan@johansorensen.com> | 2008-04-19 01:32:56 +0200 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2008-04-19 01:32:56 +0200 |
commit | d3001d52b84fe0bdde5a5d9829e49f6ce54ddec6 (patch) | |
tree | 00f9159f398bd07da4dc4805d6058533764035f5 /script/git-daemon | |
parent | 3ca9cc69fc41aba17f64318183664251557e26d2 (diff) | |
download | gitorious-mainline-outdated-d3001d52b84fe0bdde5a5d9829e49f6ce54ddec6.zip gitorious-mainline-outdated-d3001d52b84fe0bdde5a5d9829e49f6ce54ddec6.tar.gz gitorious-mainline-outdated-d3001d52b84fe0bdde5a5d9829e49f6ce54ddec6.tar.bz2 |
back out of non-blocking Socket#accept
Diffstat (limited to 'script/git-daemon')
-rwxr-xr-x | script/git-daemon | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/script/git-daemon b/script/git-daemon index b9482d5..74d789a 100755 --- a/script/git-daemon +++ b/script/git-daemon @@ -43,20 +43,15 @@ module Git end def run - begin - while session = @socket.accept_nonblock - connections = $children_active - $children_reaped - if connections > MAX_CHILDREN - log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") - session.close - next - end - - run_service(session) + while session = @socket.accept + connections = $children_active - $children_reaped + if connections > MAX_CHILDREN + log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") + session.close + next end - rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR - IO.select([@socket]) - retry + + run_service(session) end end |