Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

%llu -> NumberFormatter::format(id), to fix warning pb on 64 bits env…

…ironment
  • Loading branch information...
commit 6d1981422ec1f0359ec60a303c925482080960c1 1 parent 969202b
@cumulusdev cumulusdev authored
View
24 CumulusLib/sources/Flow.cpp
@@ -88,7 +88,7 @@ void Flow::complete() {
return;
if(!writer.signature.empty()) // writer.signature.empty() == FlowNull instance, not display the message in FullNull case
- DEBUG("Flow %llu consumed",id);
+ DEBUG("Flow %s consumed",NumberFormatter::format(id).c_str());
// delete fragments
map<UInt64,Fragment*>::const_iterator it;
@@ -106,7 +106,7 @@ void Flow::complete() {
}
void Flow::fail(const string& error) {
- ERROR("Flow %llu failed : %s",id,error.c_str());
+ ERROR("Flow %s failed : %s",NumberFormatter::format(id).c_str(),error.c_str());
if(!_completed) {
BinaryWriter& writer = _band.writeMessage(0x5e,Util::Get7BitValueSize(id)+1);
writer.write7BitLongValue(id);
@@ -185,17 +185,17 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,
if(_completed)
return;
-// TRACE("Flow %llu stage %llu",id,stage);
+// TRACE("Flow %s stage %s",NumberFormatter::format(id).c_str(),NumberFormatter::format(stage).c_str());
UInt64 nextStage = this->stage+1;
if(stage < nextStage) {
- DEBUG("Stage %llu on flow %llu has already been received",stage,id);
+ DEBUG("Stage %s on flow %s has already been received",NumberFormatter::format(stage).c_str(),NumberFormatter::format(id).c_str());
return;
}
if(deltaNAck>stage) {
- WARN("DeltaNAck %llu superior to stage %llu on flow %llu",deltaNAck,stage,id);
+ WARN("DeltaNAck %s superior to stage %s on flow %s",NumberFormatter::format(deltaNAck).c_str(),NumberFormatter::format(stage).c_str(),NumberFormatter::format(id).c_str());
deltaNAck=stage;
}
@@ -228,7 +228,7 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,
if(_fragments.size()>100)
DEBUG("_fragments.size()=%lu",_fragments.size());
} else
- DEBUG("Stage %llu on flow %llu has already been received",stage,id);
+ DEBUG("Stage %s on flow %s has already been received",NumberFormatter::format(stage).c_str(),NumberFormatter::format(id).c_str());
} else {
fragmentSortedHandler(nextStage++,fragment,flags);
if(flags&MESSAGE_END)
@@ -252,7 +252,7 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,
void Flow::fragmentSortedHandler(UInt64 stage,PacketReader& fragment,UInt8 flags) {
if(stage<=this->stage) {
- ERROR("Stage %llu not sorted on flow %llu",stage,id);
+ ERROR("Stage %s not sorted on flow %s",NumberFormatter::format(stage).c_str(),NumberFormatter::format(id).c_str());
return;
}
if(stage>(this->stage+1)) {
@@ -354,19 +354,19 @@ void Flow::fragmentSortedHandler(UInt64 stage,PacketReader& fragment,UInt8 flags
}
void Flow::messageHandler(const std::string& name,AMFReader& message) {
- ERROR("Message '%s' unknown for flow %llu",name.c_str(),id);
+ ERROR("Message '%s' unknown for flow %s",name.c_str(),NumberFormatter::format(id).c_str());
}
void Flow::rawHandler(UInt8 type,PacketReader& data) {
- ERROR("Raw message %s unknown for flow %llu",Util::FormatHex(data.current(),data.available()).c_str(),id);
+ ERROR("Raw message %s unknown for flow %s",Util::FormatHex(data.current(),data.available()).c_str(),NumberFormatter::format(id).c_str());
}
void Flow::audioHandler(PacketReader& packet) {
- ERROR("Audio packet untreated for flow %llu",id);
+ ERROR("Audio packet untreated for flow %s",NumberFormatter::format(id).c_str());
}
void Flow::videoHandler(PacketReader& packet) {
- ERROR("Video packet untreated for flow %llu",id);
+ ERROR("Video packet untreated for flow %s",NumberFormatter::format(id).c_str());
}
void Flow::lostFragmentsHandler(UInt32 count) {
- INFO("%u fragments lost on flow %llu",count,id);
+ INFO("%u fragments lost on flow %s",count,NumberFormatter::format(id).c_str());
}
View
2  CumulusLib/sources/FlowStream.cpp
@@ -81,7 +81,7 @@ void FlowStream::rawHandler(UInt8 type,PacketReader& data) {
//TRACE("Bound %u : %u %u",id,data.read32(),data.read32());
return;
}
- ERROR("Unknown raw flag %u on FlowStream %llu",flag,id);
+ ERROR("Unknown raw flag %u on FlowStream %s",flag,NumberFormatter::format(id).c_str());
Flow::rawHandler(type,data);
}
View
27 CumulusLib/sources/FlowWriter.cpp
@@ -18,6 +18,7 @@
#include "FlowWriter.h"
#include "Util.h"
#include "Logs.h"
+#include "Poco/NumberFormatter.h"
#include "string.h"
using namespace std;
@@ -45,7 +46,7 @@ FlowWriter::~FlowWriter() {
_closed=true;
clear();
if(!signature.empty())
- DEBUG("FlowWriter %llu consumed",id);
+ DEBUG("FlowWriter %s consumed",NumberFormatter::format(id).c_str());
}
void FlowWriter::clear() {
@@ -75,7 +76,7 @@ void FlowWriter::clear() {
void FlowWriter::fail(const string& error) {
if(_closed)
return;
- WARN("FlowWriter %llu has failed : %s",id,error.c_str());
+ WARN("FlowWriter %s has failed : %s",NumberFormatter::format(id).c_str(),error.c_str());
clear();
_stage=_stageAck=_lostCount=_ackCount=0;
_band.resetFlowWriter(*new FlowWriter(*this));
@@ -111,12 +112,12 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
UInt64 stage = _stageAck+1;
if(stageReaden>_stage) {
- ERROR("Acknowledgment received %llu superior than the current sending stage %llu on flowWriter %llu",stageReaden,_stage,id);
+ ERROR("Acknowledgment received %s superior than the current sending stage %s on flowWriter %s",NumberFormatter::format(stageReaden).c_str(),NumberFormatter::format(_stage).c_str(),NumberFormatter::format(id).c_str());
_stageAck = _stage;
} else if(stageReaden<=_stageAck) {
// already acked
if(reader.available()==0)
- DEBUG("Acknowledgment %llu obsolete on flowWriter %llu",stageReaden,id);
+ DEBUG("Acknowledgment %s obsolete on flowWriter %s",NumberFormatter::format(stageReaden).c_str(),NumberFormatter::format(id).c_str());
} else
_stageAck = stageReaden;
@@ -141,7 +142,7 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
Message& message(**it);
if(message.fragments.empty()) {
- CRITIC("Message %llu is bad formatted on fowWriter %llu",stage+1,id);
+ CRITIC("Message %s is bad formatted on fowWriter %s",NumberFormatter::format(stage+1).c_str(),NumberFormatter::format(id).c_str());
++it;
continue;
}
@@ -173,7 +174,7 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
// check the range
if(lostStage>_stage) {
// Not yet sent
- ERROR("Lost information received %llu have not been yet sent on flowWriter %llu",lostStage,id);
+ ERROR("Lost information received %s have not been yet sent on flowWriter %s",NumberFormatter::format(lostStage).c_str(),NumberFormatter::format(id).c_str());
stop=true;
} else if(lostStage<=_stageAck) {
// already acked
@@ -205,7 +206,7 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
++stage;
header=true;
} else {
- INFO("FlowWriter %llu : message %llu lost",id,stage);
+ INFO("FlowWriter %s : message %s lost",NumberFormatter::format(id).c_str(),NumberFormatter::format(stage).c_str());
--_ackCount;
++_lostCount;
_stageAck = stage;
@@ -228,7 +229,7 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
// Repeat message
- DEBUG("FlowWriter %llu : stage %llu repeated",id,stage);
+ DEBUG("FlowWriter %s : stage %s repeated",NumberFormatter::format(id).c_str(),NumberFormatter::format(stage).c_str());
UInt32 available;
UInt32 fragment(itFrag->first);
BinaryReader& content = message.reader(fragment,available);
@@ -286,7 +287,7 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
}
if(lostCount>0 && reader.available()>0)
- ERROR("Some lost information received have not been yet sent on flowWriter %llu",id);
+ ERROR("Some lost information received have not been yet sent on flowWriter %s",NumberFormatter::format(id).c_str());
// rest messages repeatable?
@@ -315,7 +316,7 @@ UInt32 FlowWriter::headerSize(UInt64 stage) { // max size header = 50
UInt32 size= Util::Get7BitValueSize(id);
size+= Util::Get7BitValueSize(stage);
if(_stageAck>stage)
- CRITIC("stageAck %llu superior to stage %llu on flowWriter %llu",_stageAck,stage,id);
+ CRITIC("stageAck %s superior to stage %s on flowWriter %s",NumberFormatter::format(_stageAck).c_str(),NumberFormatter::format(stage).c_str(),NumberFormatter::format(id).c_str());
size+= Util::Get7BitValueSize(stage-_stageAck);
size+= _stageAck>0 ? 0 : (signature.size()+(flowId==0?2:(4+Util::Get7BitValueSize(flowId))));
return size;
@@ -412,8 +413,8 @@ void FlowWriter::raiseMessage() {
// Actual sending packet is enough large? Here we send just one packet!
if(size>_band.writer().available()) {
if(!sent)
- ERROR("Raise messages on flowWriter %llu without sending!",id);
- DEBUG("Raise message on flowWriter %llu finishs on stage %llu",id,stage);
+ ERROR("Raise messages on flowWriter %s without sending!",NumberFormatter::format(id).c_str());
+ DEBUG("Raise message on flowWriter %s finishs on stage %s",NumberFormatter::format(id).c_str(),NumberFormatter::format(stage).c_str());
return;
}
sent=true;
@@ -507,7 +508,7 @@ void FlowWriter::flush(bool full) {
void FlowWriter::cancel(UInt32 index) {
if(index>=queue()) {
- ERROR("Impossible to cancel %u message on flowWriter %llu",index,id);
+ ERROR("Impossible to cancel %u message on flowWriter %s",index,NumberFormatter::format(id).c_str());
return;
}
list<Message*>::iterator it = _messages.begin();
View
2  CumulusLib/sources/Listener.cpp
@@ -149,7 +149,7 @@ UInt32 Listener::computeTime(UInt32 time) {
}
void Listener::writeBound(FlowWriter& writer) {
- DEBUG("Writing bound %u on flow writer %llu",_boundId,writer.id);
+ DEBUG("Writing bound %u on flow writer %s",_boundId,NumberFormatter::format(writer.id).c_str());
BinaryWriter& data = writer.writeRawMessage();
data.write16(0x22);
data.write32(_boundId);
View
18 CumulusLib/sources/ServerSession.cpp
@@ -425,7 +425,7 @@ void ServerSession::packetHandler(PacketReader& packet) {
if(pFlowWriter)
pFlowWriter->fail(format("flowWriter rejected on session %u",this->id));
else
- WARN("FlowWriter %llu unfound for failed signal on session %u",id,this->id);
+ WARN("FlowWriter %s unfound for failed signal on session %u",NumberFormatter::format(id).c_str(),this->id);
break;
}
@@ -451,7 +451,7 @@ void ServerSession::packetHandler(PacketReader& packet) {
if(pFlowWriter)
pFlowWriter->acknowledgment(message);
else
- WARN("FlowWriter %llu unfound for acknowledgment on session %u",id,this->id);
+ WARN("FlowWriter %s unfound for acknowledgment on session %u",NumberFormatter::format(id).c_str(),this->id);
break;
}
/// Request
@@ -481,14 +481,14 @@ void ServerSession::packetHandler(PacketReader& packet) {
// Fullduplex header part
if(message.read8()!=0x0A)
- WARN("Unknown fullduplex header part for the flow %llu",idFlow)
+ WARN("Unknown fullduplex header part for the flow %s",NumberFormatter::format(idFlow).c_str())
else
message.read7BitLongValue(); // Fullduplex useless here! Because we are creating a new Flow!
// Useless header part
UInt8 length=message.read8();
while(length>0 && message.available()) {
- WARN("Unknown message part on flow %llu",idFlow);
+ WARN("Unknown message part on flow %s",NumberFormatter::format(idFlow).c_str());
message.next(length);
length=message.read8();
}
@@ -499,7 +499,7 @@ void ServerSession::packetHandler(PacketReader& packet) {
}
if(!pFlow) {
- WARN("Flow %llu unfound",idFlow);
+ WARN("Flow %s unfound",NumberFormatter::format(idFlow).c_str());
((UInt64&)_pFlowNull->id) = idFlow;
pFlow = _pFlowNull;
}
@@ -556,7 +556,7 @@ FlowWriter* ServerSession::flowWriter(Poco::UInt64 id) {
Flow& ServerSession::flow(Poco::UInt64 id) {
map<UInt64,Flow*>::const_iterator it = _flows.find(id);
if(it==_flows.end()) {
- WARN("Flow %llu unfound",id);
+ WARN("Flow %s unfound",NumberFormatter::format(id).c_str());
((UInt64&)_pFlowNull->id) = id;
return *_pFlowNull;
}
@@ -570,7 +570,7 @@ Flow* ServerSession::createFlow(UInt64 id,const string& signature) {
}
map<UInt64,Flow*>::const_iterator it = _flows.find(id);
if(it!=_flows.end()) {
- WARN("Flow %llu has already been created",id);
+ WARN("Flow %s has already been created",NumberFormatter::format(id).c_str());
return it->second;
}
@@ -585,7 +585,7 @@ Flow* ServerSession::createFlow(UInt64 id,const string& signature) {
else
ERROR("New unknown flow '%s' on session %u",Util::FormatHex((const UInt8*)signature.c_str(),signature.size()).c_str(),this->id);
if(pFlow) {
- DEBUG("New flow %llu on session %u",id,this->id);
+ DEBUG("New flow %s on session %u",NumberFormatter::format(id).c_str(),this->id);
_flows[id] = pFlow;
}
return pFlow;
@@ -598,7 +598,7 @@ void ServerSession::initFlowWriter(FlowWriter& flowWriter) {
(UInt64&)flowWriter.flowId = _flows.begin()->second->id;
_flowWriters[_nextFlowWriterId] = &flowWriter;
if(!flowWriter.signature.empty())
- DEBUG("New flowWriter %llu on session %u",flowWriter.id,this->id);
+ DEBUG("New flowWriter %s on session %u",NumberFormatter::format(flowWriter.id).c_str(),this->id);
}
void ServerSession::resetFlowWriter(FlowWriter& flowWriter) {
Please sign in to comment.
Something went wrong with that request. Please try again.