Index: http_api.c
===================================================================
--- http_api.c	(revision 284546)
+++ http_api.c	(working copy)
@@ -357,6 +357,9 @@
 			memcpy(*body + *length, buf, len);
 			*length += len;
 			(*body)[*length] = '\0';
+            if (len < sizeof(buf)) {
+                break;
+            }
 		}
 		
 		/* check for error */

