Skip to content

Commit

Permalink
read_binary_size return value
Browse files Browse the repository at this point in the history
  • Loading branch information
ksherlock committed Sep 25, 2013
1 parent 09ebb6c commit fad3fc4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ int read_response(Word ipid, FILE *file, Handle dict)

int haveTime = 0;


contentSize = 0;
transferEncoding = -1;
value = DictionaryGet(dict, "Content-Length", 14, &valueSize);
Expand Down Expand Up @@ -467,8 +468,7 @@ int read_response(Word ipid, FILE *file, Handle dict)
dcb.requestCount = contentSize;
ok = read_binary_size(ipid, file, &dcb);

if (!ok) return -1;
if (dcb.transferCount != dcb.requestCount)
if (ok < 0 || dcb.transferCount != dcb.requestCount)
{
fprintf(stderr, "Read error - requested %ld, received %ld\n",
dcb.requestCount, dcb.transferCount);
Expand Down

0 comments on commit fad3fc4

Please sign in to comment.