projects
/
yazproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WRBUF updates
[yazproxy-moved-to-github.git]
/
src
/
yaz-bw.cpp
diff --git
a/src/yaz-bw.cpp
b/src/yaz-bw.cpp
index
25f5658
..
5b7b4a2
100644
(file)
--- a/
src/yaz-bw.cpp
+++ b/
src/yaz-bw.cpp
@@
-1,7
+1,7
@@
-/* $Id: yaz-bw.cpp,v 1.6 2004-12-13 20:52:33 adam Exp $
- Copyright (c) 1998-2004, Index Data.
+/* $Id: yaz-bw.cpp,v 1.8 2006-03-30 10:32:42 adam Exp $
+ Copyright (c) 1998-2006, Index Data.
-This file is part of the yaz-proxy.
+This file is part of the yazproxy.
YAZ proxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
YAZ proxy is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
@@
-42,7
+42,7
@@
int Yaz_bw::get_total()
int bw = 0;
int i;
for (i = 0; i<m_size; i++)
int bw = 0;
int i;
for (i = 0; i<m_size; i++)
- bw += m_bucket[i];
+ bw += m_bucket[i];
return bw;
}
return bw;
}
@@
-52,14
+52,22
@@
void Yaz_bw::add_bytes(int b)
int d = now - m_sec;
if (d > m_size)
int d = now - m_sec;
if (d > m_size)
- d = m_size;
+ d = m_size;
while (--d >= 0)
{
while (--d >= 0)
{
- if (++m_ptr == m_size)
- m_ptr = 0;
- m_bucket[m_ptr] = 0;
+ if (++m_ptr == m_size)
+ m_ptr = 0;
+ m_bucket[m_ptr] = 0;
}
m_bucket[m_ptr] += b;
m_sec = now;
}
}
m_bucket[m_ptr] += b;
m_sec = now;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+