[OPTIM] buffer: new BF_READ_DONTWAIT flag reduces EAGAIN rates

When the reader does not expect to read lots of data, it can
set BF_READ_DONTWAIT on the request buffer. When it is set,
the stream_sock_read callback will not try to perform multiple
reads, it will return after only one, and clear the flag.
That way, we can immediately return when waiting for an HTTP
request without trying to read again.

On pure request/responses schemes such as monitor-uri or
redirects, this has completely eliminated the EAGAIN occurrences
and the epoll_ctl() calls, resulting in a performance increase of
about 10%. Similar effects should be observed once we support
HTTP keep-alive since we'll immediately disable reads once we
get a full request.
diff --git a/src/stream_sock.c b/src/stream_sock.c
index a942d40..83c3c88 100644
--- a/src/stream_sock.c
+++ b/src/stream_sock.c
@@ -421,7 +421,7 @@
 					break;
 			}
 
-			if (--read_poll <= 0)
+			if ((b->flags & BF_READ_DONTWAIT) || --read_poll <= 0)
 				break;
 		}
 		else if (ret == 0) {
@@ -467,13 +467,14 @@
 	/* we have to wake up if there is a special event or if we don't have
 	 * any more data to forward.
 	 */
-	if ((b->flags & (BF_READ_NULL|BF_READ_ERROR|BF_SHUTR)) ||
+	if ((b->flags & (BF_READ_NULL|BF_READ_ERROR|BF_SHUTR|BF_READ_DONTWAIT)) ||
 	    !b->to_forward ||
 	    si->state != SI_ST_EST ||
 	    b->cons->state != SI_ST_EST ||
 	    (si->flags & SI_FL_ERR))
 		task_wakeup(si->owner, TASK_WOKEN_IO);
 	
+	b->flags &= ~BF_READ_DONTWAIT;
 	fdtab[fd].ev &= ~FD_POLL_IN;
 	return retval;