Skip to content

Commit

Permalink
Prevent 100% CPU usage in HTTP connector [Jean-Denis Girard]
Browse files Browse the repository at this point in the history
  • Loading branch information
davies147 committed Dec 8, 2008
1 parent fb2d251 commit 974c824
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ int _read(struct mansession *s, struct message *m) {
/* for http, don't do get_input forever */
for (;;) {

if (s->inputcomplete && !s->outputcomplete)
if (s->inputcomplete && !s->outputcomplete) {
sleep(1);
continue;
else if (s->inputcomplete && s->outputcomplete)
} else if (s->inputcomplete && s->outputcomplete)
return -1;

memset(line, 0, sizeof line);
Expand Down

0 comments on commit 974c824

Please sign in to comment.