Author: suokko
Date: Sun May 18 20:35:43 2008
New Revision: 26710
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26710&view=rev
Log:
Improved wesnothd performace: Removed transfer stats from server
Modified:
branches/1.4/src/network_worker.cpp
Modified: branches/1.4/src/network_worker.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/branches/1.4/src/network_worker.cpp?rev=26710&r1=26709&r2=26710&view=diff
==============================================================================
--- branches/1.4/src/network_worker.cpp (original)
+++ branches/1.4/src/network_worker.cpp Sun May 18 20:35:43 2008
@@ -237,7 +237,7 @@
} else {
buf += bytes_read;
- if(update_stats) {
+ if(update_stats && !raw_data_only) {
const threading::lock lock(*stats_mutex);
transfer_stats[s].second.transfer(static_cast<size_t>(bytes_read));
}
@@ -285,6 +285,7 @@
size_t upto = 0;
size_t size = buf.size();
+ if (!raw_data_only)
{
const threading::lock lock(*stats_mutex);
transfer_stats[sock].first.fresh_current(size);
@@ -303,7 +304,7 @@
}
const int res = SDLNet_TCP_Send(sock, &buf[upto],
static_cast<int>(size - upto));
- if(res == static_cast<int>(size - upto)) {
+ if(!raw_data_only && res == static_cast<int>(size - upto)) {
{
const threading::lock lock(*stats_mutex);
transfer_stats[sock].first.transfer(static_cast<size_t>(res));
@@ -318,6 +319,7 @@
{
// update how far we are
upto += static_cast<size_t>(res);
+ if (!raw_data_only)
{
const threading::lock lock(*stats_mutex);
transfer_stats[sock].first.transfer(static_cast<size_t>(res));
@@ -391,6 +393,7 @@
char* beg = &buf[0];
const char* const end = beg + len;
+ if (!raw_data_only)
{
const threading::lock lock(*stats_mutex);
transfer_stats[sock].second.fresh_current(len);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits