Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for Issue #105 - Build errors under Solaris 11 #106

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CumulusLib/sources/AMFWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ void AMFWriter::writePropertyName(const string& value) {

void AMFWriter::writeString(const string& value) {
if(!value.empty()) {
map<string,UInt32>::iterator it = _stringReferences.lower_bound(value);
std::map<string,UInt32>::iterator it =
_stringReferences.lower_bound(value);
if(it!=_stringReferences.end() && it->first==value) {
writer.write7BitValue(it->second<<1);
return;
Expand Down
14 changes: 9 additions & 5 deletions CumulusLib/sources/Flow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void Flow::complete() {
DEBUG("Flow %s consumed",NumberFormatter::format(id).c_str());

// delete fragments
map<UInt64,Fragment*>::const_iterator it;
std::map<UInt64,Fragment*>::const_iterator it;
for(it=_fragments.begin();it!=_fragments.end();++it)
delete it->second;
_fragments.clear();
Expand Down Expand Up @@ -150,7 +150,8 @@ void Flow::commit() {
list<UInt64> lost;
UInt64 current=stage;
UInt32 count=0;
map<UInt64,Fragment*>::const_iterator it=_fragments.begin();
std::map<UInt64,Fragment*>::const_iterator
it=_fragments.begin();
while(it!=_fragments.end()) {
current = it->first-current-2;
size += Util::Get7BitValueSize(current);
Expand Down Expand Up @@ -201,7 +202,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,
}

if(this->stage < (stage-deltaNAck)) {
map<UInt64,Fragment*>::iterator it=_fragments.begin();
std::map<UInt64,Fragment*>::iterator
it=_fragments.begin();
while(it!=_fragments.end()) {
if( it->first > stage)
break;
Expand All @@ -221,7 +223,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,

if(stage>nextStage) {
// not following stage, bufferizes the stage
map<UInt64,Fragment*>::iterator it = _fragments.lower_bound(stage);
std::map<UInt64,Fragment*>::iterator it =
_fragments.lower_bound(stage);
if(it==_fragments.end() || it->first!=stage) {
if(it!=_fragments.begin())
--it;
Expand All @@ -234,7 +237,8 @@ void Flow::fragmentHandler(UInt64 stage,UInt64 deltaNAck,PacketReader& fragment,
fragmentSortedHandler(nextStage++,fragment,flags);
if(flags&MESSAGE_END)
complete();
map<UInt64,Fragment*>::iterator it=_fragments.begin();
std::map<UInt64,Fragment*>::iterator
it=_fragments.begin();
while(it!=_fragments.end()) {
if( it->first > nextStage)
break;
Expand Down
6 changes: 4 additions & 2 deletions CumulusLib/sources/FlowWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ void FlowWriter::acknowledgment(PacketReader& reader) {
continue;
}

map<UInt32,UInt64>::iterator itFrag=message.fragments.begin();
std::map<UInt32,UInt64>::iterator
itFrag=message.fragments.begin();
while(message.fragments.end()!=itFrag) {

// ACK
Expand Down Expand Up @@ -386,7 +387,8 @@ void FlowWriter::raiseMessage() {
stop = false;
}

map<UInt32,UInt64>::const_iterator itFrag=message.fragments.begin();
std::map<UInt32,UInt64>::const_iterator
itFrag=message.fragments.begin();
UInt32 available;
BinaryReader& content = message.reader(available);

Expand Down
21 changes: 14 additions & 7 deletions CumulusLib/sources/Handshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ Handshake::~Handshake() {

void Handshake::manage() {
// delete obsolete cookie
map<const UInt8*,Cookie*,CompareCookies>::iterator it=_cookies.begin();
std::map<const UInt8*,Cookie*,CompareCookies>::iterator
it=_cookies.begin();
while(it!=_cookies.end()) {
if(it->second->obsolete()) {
eraseHelloAttempt(it->second->tag);
Expand All @@ -60,7 +61,8 @@ void Handshake::manage() {
}

void Handshake::commitCookie(const UInt8* value) {
map<const UInt8*,Cookie*,CompareCookies>::iterator it = _cookies.find(value);
std::map<const UInt8*,Cookie*,CompareCookies>::iterator it =
_cookies.find(value);
if(it==_cookies.end()) {
WARN("Cookie %s not found, maybe becoming obsolete before commiting (congestion?)",Util::FormatHex(value,COOKIE_SIZE).c_str());
return;
Expand All @@ -73,7 +75,8 @@ void Handshake::commitCookie(const UInt8* value) {

void Handshake::clear() {
// delete cookies
map<const UInt8*,Cookie*,CompareCookies>::const_iterator it;
std::map<const UInt8*,Cookie*,CompareCookies>::const_iterator
it;
for(it=_cookies.begin();it!=_cookies.end();++it) {
eraseHelloAttempt(it->second->tag);
delete it->second;
Expand Down Expand Up @@ -125,7 +128,8 @@ void Handshake::packetHandler(PacketReader& packet) {
}

Session* Handshake::createSession(const UInt8* cookieValue) {
map<const UInt8*,Cookie*,CompareCookies>::iterator itCookie = _cookies.find(cookieValue);
std::map<const UInt8*,Cookie*,CompareCookies>::iterator itCookie
= _cookies.find(cookieValue);
if(itCookie==_cookies.end()) {
WARN("Creating session for an unknown cookie '%s' (CPU congestion?)",Util::FormatHex(cookieValue,COOKIE_SIZE).c_str());
return NULL;
Expand All @@ -135,7 +139,8 @@ Session* Handshake::createSession(const UInt8* cookieValue) {

// Fill peer infos
memcpy((void*)peer.id,cookie.peerId,ID_SIZE);
Util::UnpackUrl(cookie.queryUrl,(string&)peer.path,(map<string,string>&)peer.properties);

Util::UnpackUrl(cookie.queryUrl,(string&)peer.path,(std::map<string,string>&)peer.properties);
(UInt32&)farId = cookie.farId;
(SocketAddress&)peer.address = cookie.peerAddress;

Expand Down Expand Up @@ -190,7 +195,8 @@ UInt8 Handshake::handshakeHandler(UInt8 id,PacketReader& request,PacketWriter& r
// Fill peer infos
UInt16 port;
string host;
Util::UnpackUrl(epd,host,port,(string&)peer.path,(map<string,string>&)peer.properties);

Util::UnpackUrl(epd,host,port,(string&)peer.path,(std::map<string,string>&)peer.properties);
set<string> addresses;
peer.onHandshake(attempt.count+1,addresses);
if(!addresses.empty()) {
Expand Down Expand Up @@ -226,7 +232,8 @@ UInt8 Handshake::handshakeHandler(UInt8 id,PacketReader& request,PacketWriter& r
return 0;
}

map<const UInt8*,Cookie*,CompareCookies>::iterator itCookie = _cookies.find(request.current());
std::map<const
UInt8*,Cookie*,CompareCookies>::iterator itCookie = _cookies.find(request.current());
if(itCookie==_cookies.end()) {
WARN("Cookie %s unknown, maybe already connected (udpBuffer congested?)",Util::FormatHex(request.current(),COOKIE_SIZE).c_str());
return 0;
Expand Down
2 changes: 1 addition & 1 deletion CumulusLib/sources/Message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Message::~Message() {
}

BinaryReader& Message::reader(UInt32& size) {
map<UInt32,UInt64>::const_iterator it = fragments.begin();
std::map<UInt32,UInt64>::const_iterator it = fragments.begin();
size = init(it==fragments.end() ? 0 : it->first);
return _reader;
}
Expand Down
11 changes: 8 additions & 3 deletions CumulusLib/sources/Middle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Middle::Middle(UInt32 id,
Target& target) : ServerSession(id,farId,peer,decryptKey,encryptKey,(Invoker&)handler),_pMiddleAesDecrypt(NULL),_pMiddleAesEncrypt(NULL),_isPeer(target.isPeer),
_middleId(0),_sessions(sessions),_firstResponse(false),_queryUrl("rtmfp://"+target.address.toString()+peer.path),_middlePeer(peer),_target(target) {

Util::UnpackUrl(_queryUrl,(string&)_middlePeer.path,(map<string,string>&)_middlePeer.properties);

Util::UnpackUrl(_queryUrl,(string&)_middlePeer.path,(std::map<string,string>&)_middlePeer.properties);

// connection to target
_socket.setReceiveBufferSize(invoker.udpBufferSize);_socket.setSendBufferSize(invoker.udpBufferSize);
Expand Down Expand Up @@ -289,7 +290,9 @@ void Middle::packetHandler(PacketReader& packet) {
UInt16 netGroupHeader = content.read16();out.write16(netGroupHeader);
if(netGroupHeader==0x4752) {

map<string,string>::const_iterator it = peer.properties.find("groupspec");

std::map<string,string>::const_iterator it =
peer.properties.find("groupspec");
if(it!=peer.properties.end()) {
out.writeRaw(content.current(),71);content.next(71);
UInt8 result1[AES_KEY_SIZE];
Expand Down Expand Up @@ -442,7 +445,9 @@ void Middle::targetPacketHandler(PacketReader& packet) {

} else if(flagType == 0x01) {

map<string,string>::const_iterator it = peer.properties.find("groupspec");

std::map<string,string>::const_iterator it =
peer.properties.find("groupspec");
if(it!=peer.properties.end()) {
packetOut.writeRaw(content.current(),68);content.next(68);
UInt8 result1[AES_KEY_SIZE];
Expand Down
18 changes: 11 additions & 7 deletions CumulusLib/sources/Peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ bool Peer::writeId(Group& group,Peer& peer,FlowWriter* pWriter) {
response.write8(0x0b); // unknown
response.writeRaw(peer.id,ID_SIZE);
} else {
map<Group*,Member*>::const_iterator it = peer._groups.find(&group);
std::map<Group*,Member*>::const_iterator it =
peer._groups.find(&group);
if(it==peer._groups.end()) {
CRITIC("A peer in a group without have its _groups collection associated")
return false;
Expand Down Expand Up @@ -99,7 +100,8 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) {
}
}

map<Group*,Member*>::iterator it = _groups.lower_bound(&group);
std::map<Group*,Member*>::iterator it =
_groups.lower_bound(&group);
if(it!=_groups.end() && it->first==&group)
return;

Expand All @@ -112,7 +114,7 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) {
if(index<group._peers.rbegin()->first) {
// max index reached, rewritten index!
index=0;
map<UInt32,Peer*>::iterator it1;
std::map<UInt32,Peer*>::iterator it1;
for(it1=group._peers.begin();it1!=group._peers.end();++it1)
(UInt32&)it1->first = index++;
}
Expand All @@ -124,14 +126,15 @@ void Peer::joinGroup(Group& group,FlowWriter* pWriter) {


void Peer::unjoinGroup(Group& group) {
map<Group*,Member*>::iterator it = _groups.lower_bound(&group);
std::map<Group*,Member*>::iterator it =
_groups.lower_bound(&group);
if(it==_groups.end() || it->first!=&group)
return;
onUnjoinGroup(it);
}

void Peer::unsubscribeGroups() {
map<Group*,Member*>::iterator it=_groups.begin();
std::map<Group*,Member*>::iterator it=_groups.begin();
while(it!=_groups.end())
onUnjoinGroup(it++);
}
Expand Down Expand Up @@ -190,9 +193,10 @@ void Peer::onJoinGroup(Group& group) {
_handler.onJoinGroup(*this,group);
}

void Peer::onUnjoinGroup(map<Group*,Member*>::iterator it) {
void Peer::onUnjoinGroup(std::map<Group*,Member*>::iterator it) {
Group& group = *it->first;
map<UInt32,Peer*>::iterator itPeer = group._peers.find(it->second->index);
std::map<UInt32,Peer*>::iterator itPeer =
group._peers.find(it->second->index);
group._peers.erase(itPeer++);
delete it->second;
_groups.erase(it);
Expand Down
19 changes: 10 additions & 9 deletions CumulusLib/sources/Publication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Publication::Publication(const string& name):_publisherId(0),_name(name),_firstK

Publication::~Publication() {
// delete _listeners!
map<UInt32,Listener*>::iterator it;
std::map<UInt32,Listener*>::iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it)
delete it->second;

Expand All @@ -40,7 +40,8 @@ Publication::~Publication() {


Listener& Publication::addListener(Peer& peer,UInt32 id,FlowWriter& writer,bool unbuffered) {
map<UInt32,Listener*>::iterator it = _listeners.lower_bound(id);
std::map<UInt32,Listener*>::iterator it =
_listeners.lower_bound(id);
if(it!=_listeners.end() && it->first==id) {
WARN("Listener %u is already subscribed for publication %u",id,_publisherId);
return *it->second;
Expand All @@ -64,7 +65,7 @@ Listener& Publication::addListener(Peer& peer,UInt32 id,FlowWriter& writer,bool
}

void Publication::removeListener(Peer& peer,UInt32 id) {
map<UInt32,Listener*>::iterator it = _listeners.find(id);
std::map<UInt32,Listener*>::iterator it = _listeners.find(id);
if(it==_listeners.end()) {
WARN("Listener %u is already unsubscribed of publication %u",id,_publisherId);
return;
Expand Down Expand Up @@ -109,7 +110,7 @@ void Publication::start(Peer& peer,UInt32 publisherId,FlowWriter* pController) {
_pPublisher=&peer;
_pController=pController;
_firstKeyFrame=false;
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it)
it->second->startPublishing(_name);
flush();
Expand All @@ -124,7 +125,7 @@ void Publication::stop(Peer& peer,UInt32 publisherId) {
WARN("Unpublish '%s' operation with a %u id different than its publisher %u id",_name.c_str(),publisherId,_publisherId);
return;
}
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it)
it->second->stopPublishing(_name);
flush();
Expand All @@ -138,7 +139,7 @@ void Publication::stop(Peer& peer,UInt32 publisherId) {
}

void Publication::flush() {
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it)
it->second->flush();
}
Expand All @@ -149,7 +150,7 @@ void Publication::pushDataPacket(const string& name,PacketReader& packet) {
return;
}
int pos = packet.position();
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it) {
it->second->pushDataPacket(name,packet);
packet.reset(pos);
Expand All @@ -167,7 +168,7 @@ void Publication::pushAudioPacket(UInt32 time,PacketReader& packet,UInt32 number
if(numberLostFragments>0)
INFO("%u audio fragments lost on publication %u",numberLostFragments,_publisherId);
_audioQOS.add(time,packet.fragments,numberLostFragments,packet.available()+5,_pPublisher ? _pPublisher->ping : 0);
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it) {
it->second->pushAudioPacket(time,packet);
packet.reset(pos);
Expand Down Expand Up @@ -201,7 +202,7 @@ void Publication::pushVideoPacket(UInt32 time,PacketReader& packet,UInt32 number
}

int pos = packet.position();
map<UInt32,Listener*>::const_iterator it;
std::map<UInt32,Listener*>::const_iterator it;
for(it=_listeners.begin();it!=_listeners.end();++it) {
it->second->pushVideoPacket(time,packet);
packet.reset(pos);
Expand Down
3 changes: 2 additions & 1 deletion CumulusLib/sources/Publications.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ using namespace Poco;

namespace Cumulus {

Publications::Publications(map<string,Publication*>& publications) : _publications(publications) {
Publications::Publications(std::map<string,Publication*>& publications)
: _publications(publications) {

}

Expand Down
Loading