Changeset - 346e24d182b1
[Not reviewed]
1 2 0
Jan Kaluza - 13 years ago 2012-03-06 11:00:57
hanzz.k@gmail.com
Fixed header corruption on 64bit windows
3 files changed with 4 insertions and 141 deletions:
0 comments (0 inline, 0 general)
plugin/src/networkplugin.cpp
Show inline comments
 
@@ -556,14 +556,14 @@ void NetworkPlugin::handleDataRead(std::string &data) {
 
				return;
 
		}
 
	}
 
}
 

	
 
void NetworkPlugin::send(const std::string &data) {
 
	char header[4];
 
	*((int*)(header)) = htonl(data.size());
 
	uint32_t size = htonl(data.size());
 
	char *header = (char *) &size;
 
	sendData(std::string(header, 4) + data);
 
}
 

	
 
void NetworkPlugin::checkPing() {
 
	if (m_pingReceived == false) {
 
		handleExitRequest();
plugin/src/pbnetwork.proto
Show inline comments
 
deleted file
src/networkpluginserver.cpp
Show inline comments
 
@@ -801,14 +801,14 @@ void NetworkPluginServer::handleDataRead(Backend *c, boost::shared_ptr<Swift::Sa
 
		}
 
	}
 
}
 

	
 
void NetworkPluginServer::send(boost::shared_ptr<Swift::Connection> &c, const std::string &data) {
 
	// generate header - size of wrapper message
 
	char header[4];
 
	*((int*)(header)) = htonl(data.size());
 
	uint32_t size = htonl(data.size());
 
	char *header = (char *) &size;
 

	
 
	// send header together with wrapper message
 
	c->write(Swift::createSafeByteArray(std::string(header, 4) + data));
 
}
 

	
 
void NetworkPluginServer::pingTimeout() {
0 comments (0 inline, 0 general)