mail[Wesnoth-commits] r28345 - in /trunk/src: campaign_server/campaign_server.cpp network.hpp network_worker.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by paniemin on August 07, 2008 - 07:43:
Author: suokko
Date: Wed Aug  6 17:11:06 2008
New Revision: 28345

URL: http://svn.gna.org/viewcvs/wesnoth?rev=28345&view=rev
Log:
Added size output for campaign list too

Modified:
    trunk/src/campaign_server/campaign_server.cpp
    trunk/src/network.hpp
    trunk/src/network_worker.hpp

Modified: trunk/src/campaign_server/campaign_server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/campaign_server/campaign_server.cpp?rev=28345&r1=28344&r2=28345&view=diff
==============================================================================
--- trunk/src/campaign_server/campaign_server.cpp (original)
+++ trunk/src/campaign_server/campaign_server.cpp Wed Aug  6 17:11:06 2008
@@ -319,7 +319,7 @@
                                config data;
                                while((sock = network::receive_data(data, 0, 
&gzipped)) != network::null_connection) {
                                        if(const config* req = 
data.child("request_campaign_list")) {
-                                               LOG_CS << "sending campaign 
list to " << network::ip_address(sock) << (gzipped?" using gzip":"") << "\n";
+                                               LOG_CS << "sending campaign 
list to " << network::ip_address(sock) << (gzipped?" using gzip":"");
                                                time_t epoch = time(NULL);
                                                config campaign_list;
                                                (campaign_list)["timestamp"] 
= lexical_cast<std::string>(epoch);
@@ -374,7 +374,7 @@
 
                                                config response;
                                                
response.add_child("campaigns",campaign_list);
-                                               network::send_data(response, 
sock, gzipped);
+                                               std::cerr << " size: " << 
(network::send_data(response, sock, gzipped)/1024) << "kb\n";
                                        } else if(const config* req = 
data.child("request_campaign")) {
                                                LOG_CS << "sending campaign 
'" << (*req)["name"] << "' to " << network::ip_address(sock)  << (gzipped?" 
using gzip":"");
                                                config* const campaign = 
campaigns().find_child("campaign","name",(*req)["name"]);

Modified: trunk/src/network.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network.hpp?rev=28345&r1=28344&r2=28345&view=diff
==============================================================================
--- trunk/src/network.hpp (original)
+++ trunk/src/network.hpp Wed Aug  6 17:11:06 2008
@@ -139,7 +139,7 @@
 //! Function to send data down a given connection,
 //! or broadcast to all peers if connection_num is 0.
 //! Throws error.
-void send_data(const config& cfg, connection connection_num /*= 0*/, const 
bool gzipped);
+size_t send_data(const config& cfg, connection connection_num /*= 0*/, const 
bool gzipped);
 
 void send_raw_data(const char* buf, int len, connection connection_num);
 

Modified: trunk/src/network_worker.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/network_worker.hpp?rev=28345&r1=28344&r2=28345&view=diff
==============================================================================
--- trunk/src/network_worker.hpp (original)
+++ trunk/src/network_worker.hpp Wed Aug  6 17:11:06 2008
@@ -59,7 +59,7 @@
 void queue_file(TCPsocket sock, const std::string&);
 
 void queue_raw_data(TCPsocket sock, const char* buf, int len);
-void queue_data(TCPsocket sock, const config& buf, const bool gzipped);
+size_t queue_data(TCPsocket sock, const config& buf, const bool gzipped);
 bool is_locked(const TCPsocket sock);
 bool close_socket(TCPsocket sock, bool force=false);
 TCPsocket detect_error();




Related Messages


Powered by MHonArc, Updated Thu Aug 07 08:41:00 2008