From 4a3f67dcec7691d3ad0c03751f297eb8d92660ca Mon Sep 17 00:00:00 2001
From: Tyler Wear <twear@codeaurora.org>
Date: Tue, 24 Mar 2015 18:08:28 -0700
Subject: [PATCH 1/1] chunked-data

---
 upnphttp.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/upnphttp.c b/upnphttp.c
index 68a9999..3370f37 100644
--- a/upnphttp.c
+++ b/upnphttp.c
@@ -409,8 +409,13 @@ next_header:
 	{
 		char *endptr;
 		h->req_chunklen = -1;
-		if( h->req_buflen <= h->req_contentoff )
+		if( h->req_buflen < h->req_contentoff )
 			return;
+		if(h->req_buflen == h->req_contentoff)
+		{
+			h->req_chunklen = 1;
+			return;
+		}
 		while( (line < (h->req_buf + h->req_buflen)) &&
 		       (h->req_chunklen = strtol(line, &endptr, 16)) &&
 		       (endptr != line) )
-- 
1.8.2.1

