| View previous topic :: View next topic |
| Author |
Message |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Fri Feb 25, 2005 11:59 am Post subject: Another Bug in Dreadnet.dll |
|
|
Hi again dread, it seems I have found another bug in your dll
Using the following code:
| Code: |
%%value = @dnet(genstats,inbytes)
|
Works fine until you hit about 2GB of downloaded data then starts reporting a minus value. I havent checked outbytes as well, uploading more than 2GB is a bit of a chore infmat works ok, but I changed my program to work with bytes rather than the formatted value and came across this bug.
Hippo |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Feb 25, 2005 1:10 pm Post subject: |
|
|
Could make sense. As far as I remember the function works with values that are 32-bit integers.
The equivalent in bytes of 2GB is exactly the upper limit of this type of integer. I will see if I can change into
a 64-bit integer instead.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Feb 25, 2005 1:12 pm Post subject: |
|
|
BTW, you're downloading way too much
go get some fresh air
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Feb 25, 2005 2:03 pm Post subject: |
|
|
Have checked the code - kinda bad news. It was not integers but cardinals. That basically means that
I probably cannot squeeze it past 4294967295 bytes = 4 GB. I will do that of course.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Fri Feb 25, 2005 2:17 pm Post subject: |
|
|
Thanks for having a look at it dread. You wouldnt believe how many different distros of linux I have on my machine now from testing this out!
4 gigabyte limit is bad news for me Im afraid I started using the inbytes and outbytes since I needed to perform some mathematical calculations on the totals. Its possible that people could download hundreds of gigabytes of data in one session.
A possible way to solve this would be to have a similar command to infmat/outfmat but with the information returned Value|Suffix i.e 100|GB. That way you would parse it, run mathematical calculations on it, whilst knowing the wether it was KB/MB/GB.
Unfortunatly that would still involve me re-writing huge chunks of code, but I should have realised this would have been a problem. |
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Fri Feb 25, 2005 3:20 pm Post subject: |
|
|
I've realised that I can do in the VDS script what I suggested for the DLL, but its a lot of code when a simple call to the DLL would be easier.
| Code: |
%%value = @dnet(genstats,infmat)
%%position = @POS(.,@dnet(genstats,infmat))
%%value2 = @strdel(%%value,@fadd(%%position,3),@fadd(%%position,3))
%%formatted = @strins(%%value2,@fadd(%%position,3),|)
parse "%%number;%%suffix",%%formatted
|
|
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Fri Feb 25, 2005 6:09 pm Post subject: |
|
|
One other thing while I've got your attention dread
Is it possible to add an adapter parameter to @Dnet(MacAddr) so it will return the Mac Address of one of the adapters found using @Dnet(Adapters) ? |
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Fri Feb 25, 2005 8:56 pm Post subject: |
|
|
Well I've just looked at my code and I've come to a standstill.
My Program needs to calculate several values including:
Bytes Download during the Current Program Session
Bytes Downloaded Today
Bytes Downloaded Overall
I have realised that I can only do this using the value in bytes since I need to check things such as how many bytes have been downloaded since the program started etc. I cant do this calculations using infmat since I can then only report the downloaded amount in the current multiple (MB/GB etc).
If there is nothing you can do regarding the reporting of inbytes then my program looses 90% of its functionality and I may as well drop the project
The only thing I can suggest as a work around is maybe having a function that returns the number of kilobytes downloaded instead of bytes. I will then be able to do my calculations on this value and the upper limit will be 1024 times greater than the current limit. This should make it 4048GB which is a much better value. Is this feasible? |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Feb 25, 2005 11:23 pm Post subject: |
|
|
Unless things have change in VDS5, I think the largest
number VDS can handle (math-wise) is approx 2 gigs.
It's actually a 4 gig range, but half are negative numbers.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Hippo Contributor


Joined: 08 Feb 2005 Posts: 53
|
Posted: Sat Feb 26, 2005 12:19 am Post subject: |
|
|
VDS 5 Is fine with handling big numbers,
| Code: |
%%answer = @fadd(2147483648000,5368709120000)
|
That is the equivalent,in bytes, of adding 2000 GB to 5000 GB |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 26, 2005 12:22 am Post subject: |
|
|
Good to know - thanks.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Sat Feb 26, 2005 12:42 am Post subject: |
|
|
Hmmm...
Apparently it was something specific I hit a 2 gig
limit on - VDS 3 does the big numbers too.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sat Feb 26, 2005 9:49 am Post subject: |
|
|
| Hippo wrote: | VDS 5 Is fine with handling big numbers,
| Code: |
%%answer = @fadd(2147483648000,5368709120000)
|
That is the equivalent,in bytes, of adding 2000 GB to 5000 GB |
That's because you're using floating point numbers. If you tried it with @sum() it wouldn't work. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Sat Feb 26, 2005 11:49 am Post subject: |
|
|
Hi again!
When I was talking about the 4GB limit, this limit is not within my DLL as such coz then I could probably fix it fairly
easily - the limit is imposed by the Win MIB structure which is working with cardinals.
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
|