Commit 3ca9cc69fc41aba17f64318183664251557e26d2
- Date: Fri Apr 18 23:28:22 +0000 2008
- Committer: Johan Sørensen (johan@johansorensen.com)
- Author: Johan Sørensen (johan@johansorensen.com)
- Commit SHA1: 3ca9cc69fc41aba17f64318183664251557e26d2
- Tree SHA1: 7f7b9cbe21c5cfb9e6f3c23495d2752c1fd46cf1
actually do the accept nonblockingly
Commit diff
script/git-daemon
| |   |
| 44 | 44 | |
| 45 | 45 | def run |
| 46 | 46 | begin |
| 47 | | while session = @socket.accept |
| 47 | while session = @socket.accept_nonblock |
| 48 | 48 | connections = $children_active - $children_reaped |
| 49 | 49 | if connections > MAX_CHILDREN |
| 50 | 50 | log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") |
| toggle raw diff |
--- a/script/git-daemon
+++ b/script/git-daemon
@@ -44,7 +44,7 @@ module Git
def run
begin
- while session = @socket.accept
+ while session = @socket.accept_nonblock
connections = $children_active - $children_reaped
if connections > MAX_CHILDREN
log(Process.pid, "too many active children #{connections}/#{MAX_CHILDREN}") |