• R/O
  • HTTP
  • SSH
  • HTTPS

PeerCastIM: Commit


Commit MetaInfo

Revisãob6465a8de620c4101af4788faef06f9a7918e9a6 (tree)
Hora2008-06-28 22:51:59
Autoreru <eru01@user...>
Commitereru

Mensagem de Log

転送量カウンタのオーバーフロー修正

Mudança Sumário

Diff

--- a/PeerCast.root/PeerCast/core/common/stats.cpp
+++ b/PeerCast.root/PeerCast/core/common/stats.cpp
@@ -52,7 +52,7 @@ void Stats::update()
5252
5353 for(int i=0; i<Stats::MAX; i++)
5454 {
55- perSec[i] = (current[i]-last[i])/diff;
55+ perSec[i] = (unsigned)(current[i]-last[i])/diff;
5656 last[i] = current[i];
5757 }
5858
--- a/PeerCast.root/PeerCast/core/common/stats.h
+++ b/PeerCast.root/PeerCast/core/common/stats.h
@@ -74,9 +74,10 @@ public:
7474 void clear(STAT s) {current[s]=0;}
7575 void add(STAT s,int n=1) {current[s]+=n;}
7676 unsigned int getPerSecond(STAT s) {return perSec[s];}
77- unsigned int getCurrent(STAT s) {return current[s];}
77+ unsigned long long int getCurrent(STAT s) {return current[s];}
7878
79- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
79+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
80+ unsigned int perSec[Stats::MAX];
8081 unsigned int lastUpdate;
8182 };
8283
--- a/PeerCast.root/PeerCast/core/common/version2.h
+++ b/PeerCast.root/PeerCast/core/common/version2.h
@@ -45,8 +45,8 @@ extern int version_ex; // PP
4545 //#define VERSION_EX 1
4646 static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
4747 static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
48-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
49-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
48+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
49+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
5050 #endif
5151
5252 // ------------------------------------------------
--- a/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@ -1564,8 +1564,8 @@ LRESULT CALLBACK TrafficDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
15641564 char suffix[][3] = { "B", "KB", "MB", "GB" };
15651565 const int bufsize = 60;
15661566 char szUp[bufsize], szDown[bufsize];
1567- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
1568- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
1567+ unsigned long long int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
1568+ unsigned long long int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
15691569
15701570 // up
15711571 for (int i=GB; i>0; --i)
--- a/c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
+++ b/c:/Git/PeerCast.root/PeerCast/core/common/stats.cpp
@@ -52,7 +52,7 @@ void Stats::update()
5252
5353 for(int i=0; i<Stats::MAX; i++)
5454 {
55- perSec[i] = (current[i]-last[i])/diff;
55+ perSec[i] = (unsigned)(current[i]-last[i])/diff;
5656 last[i] = current[i];
5757 }
5858
--- a/c:/Git/PeerCast.root/PeerCast/core/common/stats.h
+++ b/c:/Git/PeerCast.root/PeerCast/core/common/stats.h
@@ -74,9 +74,10 @@ public:
7474 void clear(STAT s) {current[s]=0;}
7575 void add(STAT s,int n=1) {current[s]+=n;}
7676 unsigned int getPerSecond(STAT s) {return perSec[s];}
77- unsigned int getCurrent(STAT s) {return current[s];}
77+ unsigned long long int getCurrent(STAT s) {return current[s];}
7878
79- unsigned int current[Stats::MAX],last[Stats::MAX],perSec[Stats::MAX];
79+ unsigned long long int current[Stats::MAX],last[Stats::MAX];
80+ unsigned int perSec[Stats::MAX];
8081 unsigned int lastUpdate;
8182 };
8283
--- a/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
+++ b/c:/Git/PeerCast.root/PeerCast/core/common/version2.h
@@ -45,8 +45,8 @@ extern int version_ex; // PP
4545 //#define VERSION_EX 1
4646 static const char *PCP_CLIENT_VERSION_EX_PREFIX = "IM"; // 2bytes only
4747 static const int PCP_CLIENT_VERSION_EX_NUMBER = 27;
48-static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5)";
49-static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5)";
48+static const char *PCX_AGENTEX = "PeerCast/0.1218(IM0027-5-2)";
49+static const char *PCX_VERSTRING_EX = "v0.1218(IM0027-5-2)";
5050 #endif
5151
5252 // ------------------------------------------------
--- a/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
+++ b/c:/Git/PeerCast.root/PeerCast/ui/win32/simple/Simple.cpp
@@ -1564,8 +1564,8 @@ LRESULT CALLBACK TrafficDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
15641564 char suffix[][3] = { "B", "KB", "MB", "GB" };
15651565 const int bufsize = 60;
15661566 char szUp[bufsize], szDown[bufsize];
1567- unsigned int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
1568- unsigned int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
1567+ unsigned long long int totalDown = stats.getCurrent(Stats::BYTESIN) - stats.getCurrent(Stats::LOCALBYTESIN);
1568+ unsigned long long int totalUp = stats.getCurrent(Stats::BYTESOUT) - stats.getCurrent(Stats::LOCALBYTESOUT);
15691569
15701570 // up
15711571 for (int i=GB; i>0; --i)
Show on old repository browser