Commit b615502b2b68571a2574568fa838d82b173f6c24

Con Kolivas 2013-04-24T21:14:20

Add more debugging to recv_line parse failure.

diff --git a/util.c b/util.c
index ddbff5f..b00417e 100644
--- a/util.c
+++ b/util.c
@@ -1085,10 +1085,10 @@ char *recv_line(struct pool *pool)
 {
 	ssize_t len, buflen;
 	char *tok, *sret = NULL;
+	struct timeval rstart, now;
 
 	if (!strstr(pool->sockbuf, "\n")) {
 		enum recv_ret ret = RECV_OK;
-		struct timeval rstart, now;
 
 		cgtime(&rstart);
 		if (!socket_full(pool, true)) {
@@ -1138,6 +1138,9 @@ char *recv_line(struct pool *pool)
 	tok = strtok(pool->sockbuf, "\n");
 	if (!tok) {
 		applog(LOG_DEBUG, "Failed to parse a \\n terminated string in recv_line");
+		applog(LOG_DEBUG, "sockbuf: %s", pool->sockbuf);
+		applog(LOG_DEBUG, "Receive start time %d  end time %d",
+		       rstart.tv_sec, now.tv_sec);
 		goto out;
 	}
 	sret = strdup(tok);