Fixes Bugs item #2816541 - http download stops at 0.3GB (mingw32)
authorLee <ler762@users.sourceforge.net>
Sun, 5 Jul 2009 20:43:14 +0000 (20:43 +0000)
committerLee <ler762@users.sourceforge.net>
Sun, 5 Jul 2009 20:43:14 +0000 (20:43 +0000)
  Microsoft has their own way - %I64U instead of %llu for long long unsigned.

parsers.c

index 27e3db6..bb45a7b 100644 (file)
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.188 2009/07/05 12:02:54 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.189 2009/07/05 12:04:46 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -2163,7 +2163,11 @@ static jb_err server_save_content_length(struct client_state *csp, char **header
 
    assert(*(*header+14) == ':');
 
 
    assert(*(*header+14) == ':');
 
+#ifdef _WIN32
+   if (1 != sscanf(*header+14, ": %I64u", &content_length))
+#else
    if (1 != sscanf(*header+14, ": %llu", &content_length))
    if (1 != sscanf(*header+14, ": %llu", &content_length))
+#endif
    {
       log_error(LOG_LEVEL_ERROR, "Crunching invalid header: %s", *header);
       freez(*header);
    {
       log_error(LOG_LEVEL_ERROR, "Crunching invalid header: %s", *header);
       freez(*header);