rejetto forum

Negative File size...

0 Members and 1 Guest are viewing this topic.

Offline mWaltari

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
Hello,

I have situation where coming file is marked :

1 941 903 702 / -1 206 321 567 received .. -16:-19:-51 (Time left)

Maybe overflow of some kind???

-Tommi Prami-

[attachment deleted by admin]


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
hi tommi
i currently use 64bit for that thing, so it should never overflow (but maybe it does somewhere in operations).
can you tell me the HFS version your using?


Offline mWaltari

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
hi tommi
i currently use 64bit for that thing, so it should never overflow (but maybe it does somewhere in operations).
can you tell me the HFS version your using?

I am using build 088

The it should not Overflow, on real world files :)

Person who send me those files, thought that it might be related that he send two 1gb+ files simultaneously. Just an hunch...

-Tommi-


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
the time left is negative because of the negative total, for sure.

here is where i get that value
Code: [Select]
  try post.length:=strToInt64(getHeader('Content-Length'))
  except end;

strToInt64 is a standard delphi function.
as you can see (google tells me you are a programmer), the bug is probably in the browser, furnishing a negative value in "content-length".

i could put a workaround: if a negative value is read, add 2GB.
what do you think of it?


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
actually, this is the workaround i just added
Code: [Select]
    if post.length < 0 then inc(post.length, int64(2) shl 31);


Offline mWaltari

  • Occasional poster
  • *
    • Posts: 3
    • View Profile
That might do...

Do you use some Socket component(s) like Indy?? or raw sockets "by hand" :)

-TP-


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i use ICS,
very different from indy because it uses an asynchronous paradigm.