diff options
author | Johan Sørensen <johan@johansorensen.com> | 2008-04-19 01:19:40 +0200 |
---|---|---|
committer | Johan Sørensen <johan@johansorensen.com> | 2008-04-19 01:19:40 +0200 |
commit | 6f12bdb4a54a1f397d6183f5d92580db537a447f (patch) | |
tree | d0c51ec61a380cc77cd49c0642a26b86ca21d251 /script/git-daemon | |
parent | c5070c6a6ea3d148047fc6bc4b4ce1ce6fad43c0 (diff) | |
download | gitorious-mainline-outdated-6f12bdb4a54a1f397d6183f5d92580db537a447f.zip gitorious-mainline-outdated-6f12bdb4a54a1f397d6183f5d92580db537a447f.tar.gz gitorious-mainline-outdated-6f12bdb4a54a1f397d6183f5d92580db537a447f.tar.bz2 |
accept nonblocking
Diffstat (limited to 'script/git-daemon')
-rwxr-xr-x | script/git-daemon | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/script/git-daemon b/script/git-daemon index c0e7d4f..c579b0a 100755 --- a/script/git-daemon +++ b/script/git-daemon @@ -43,15 +43,20 @@ module Git end def run - 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 + begin + 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 + + run_service(session) end - - run_service(session) + rescue Errno::EAGAIN, Errno::ECONNABORTED, Errno::EPROTO, Errno::EINTR + IO.select([@socket]) + retry end end |