BUG/MEDIUM: connection: don't store recv() result into trash.data

Cyril Bonté discovered that the proxy protocol randomly fails since
commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields match
the buffer struct"). This is because we used to store recv()'s return
code into trash.data which is now unsigned, so it never compares as
negative against 0. Let's clean this up and test the result itself
without storing it first.

No backport is needed.
diff --git a/src/connection.c b/src/connection.c
index ee80e61..b3ef56e 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -424,6 +424,7 @@
 	const char v2sig[] = PP2_SIGNATURE;
 	int tlv_length = 0;
 	int tlv_offset = 0;
+	int ret;
 
 	/* we might have been called just after an asynchronous shutr */
 	if (conn->flags & CO_FL_SOCK_RD_SH)
@@ -436,9 +437,8 @@
 		return 0;
 
 	do {
-		trash.data = recv(conn->handle.fd, trash.area, trash.size,
-				 MSG_PEEK);
-		if (trash.data < 0) {
+		ret = recv(conn->handle.fd, trash.area, trash.size, MSG_PEEK);
+		if (ret < 0) {
 			if (errno == EINTR)
 				continue;
 			if (errno == EAGAIN) {
@@ -447,6 +447,7 @@
 			}
 			goto recv_abort;
 		}
+		trash.data = ret;
 	} while (0);
 
 	if (!trash.data) {
@@ -738,6 +739,7 @@
 	char *line;
 	uint32_t hdr_len;
 	uint8_t ip_v;
+	int ret;
 
 	/* we might have been called just after an asynchronous shutr */
 	if (conn->flags & CO_FL_SOCK_RD_SH)
@@ -750,9 +752,8 @@
 		return 0;
 
 	do {
-		trash.data = recv(conn->handle.fd, trash.area, trash.size,
-				 MSG_PEEK);
-		if (trash.data < 0) {
+		ret = recv(conn->handle.fd, trash.area, trash.size, MSG_PEEK);
+		if (ret < 0) {
 			if (errno == EINTR)
 				continue;
 			if (errno == EAGAIN) {
@@ -761,6 +762,7 @@
 			}
 			goto recv_abort;
 		}
+		trash.data = ret;
 	} while (0);
 
 	if (!trash.data) {