mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Removed some std::ostringstream.
To be continued. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5109 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9aee68a2a9
commit
b71eeadf95
@ -274,9 +274,7 @@ void convertBdPeerToRsDhtPeer(RsDhtPeer &peer, const bdPeer &int_peer)
|
||||
|
||||
peer.mDhtId = out.str();
|
||||
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_peer.mPeerId.addr.sin_addr) << ":" << ntohs(int_peer.mPeerId.addr.sin_port);
|
||||
peer.mAddr = addr.str();
|
||||
rs_sprintf(peer.mAddr, "%s:%u", rs_inet_ntoa(int_peer.mPeerId.addr.sin_addr).c_str(), ntohs(int_peer.mPeerId.addr.sin_port));
|
||||
|
||||
peer.mLastSendTime = int_peer.mLastSendTime;
|
||||
peer.mLastRecvTime = int_peer.mLastRecvTime;
|
||||
@ -333,23 +331,9 @@ void convertDhtPeerDetailsToRsDhtNetPeer(RsDhtNetPeer &status, const DhtPeerDeta
|
||||
|
||||
void convertUdpRelayEndtoRsDhtRelayEnd(RsDhtRelayEnd &end, const UdpRelayEnd &int_end)
|
||||
{
|
||||
{
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_end.mLocalAddr.sin_addr) << ":" << ntohs(int_end.mLocalAddr.sin_port);
|
||||
end.mLocalAddr = addr.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_end.mProxyAddr.sin_addr) << ":" << ntohs(int_end.mProxyAddr.sin_port);
|
||||
end.mProxyAddr = addr.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_end.mRemoteAddr.sin_addr) << ":" << ntohs(int_end.mRemoteAddr.sin_port);
|
||||
end.mRemoteAddr = addr.str();
|
||||
}
|
||||
rs_sprintf(end.mLocalAddr, "%s:%u", rs_inet_ntoa(int_end.mLocalAddr.sin_addr).c_str(), ntohs(int_end.mLocalAddr.sin_port));
|
||||
rs_sprintf(end.mProxyAddr, "%s:%u", rs_inet_ntoa(int_end.mProxyAddr.sin_addr).c_str(), ntohs(int_end.mProxyAddr.sin_port));
|
||||
rs_sprintf(end.mRemoteAddr, "%s:%u", rs_inet_ntoa(int_end.mRemoteAddr.sin_addr).c_str(), ntohs(int_end.mRemoteAddr.sin_port));
|
||||
|
||||
end.mCreateTS = 0;
|
||||
return;
|
||||
@ -357,26 +341,16 @@ void convertUdpRelayEndtoRsDhtRelayEnd(RsDhtRelayEnd &end, const UdpRelayEnd &in
|
||||
|
||||
void convertUdpRelayProxytoRsDhtRelayProxy(RsDhtRelayProxy &proxy, const UdpRelayProxy &int_proxy)
|
||||
{
|
||||
{
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_proxy.mAddrs.mSrcAddr.sin_addr) << ":" << ntohs(int_proxy.mAddrs.mSrcAddr.sin_port);
|
||||
proxy.mSrcAddr = addr.str();
|
||||
}
|
||||
rs_sprintf(proxy.mSrcAddr, "%s:%u", rs_inet_ntoa(int_proxy.mAddrs.mSrcAddr.sin_addr).c_str(), ntohs(int_proxy.mAddrs.mSrcAddr.sin_port));
|
||||
rs_sprintf(proxy.mDestAddr, "%s:%u", rs_inet_ntoa(int_proxy.mAddrs.mDestAddr.sin_addr).c_str(), ntohs(int_proxy.mAddrs.mDestAddr.sin_port));
|
||||
|
||||
{
|
||||
std::ostringstream addr;
|
||||
addr << rs_inet_ntoa(int_proxy.mAddrs.mDestAddr.sin_addr) << ":" << ntohs(int_proxy.mAddrs.mDestAddr.sin_port);
|
||||
proxy.mDestAddr = addr.str();
|
||||
}
|
||||
|
||||
proxy.mBandwidth = int_proxy.mBandwidth;
|
||||
proxy.mRelayClass = int_proxy.mRelayClass;
|
||||
proxy.mLastTS = int_proxy.mLastTS;
|
||||
proxy.mBandwidth = int_proxy.mBandwidth;
|
||||
proxy.mRelayClass = int_proxy.mRelayClass;
|
||||
proxy.mLastTS = int_proxy.mLastTS;
|
||||
proxy.mCreateTS = 0;
|
||||
|
||||
//proxy.mDataSize = int_proxy.mDataSize;
|
||||
//proxy.mLastBandwidthTS = int_proxy.mLastBandwidthTS;
|
||||
|
||||
//proxy.mDataSize = int_proxy.mDataSize;
|
||||
//proxy.mLastBandwidthTS = int_proxy.mLastBandwidthTS;
|
||||
}
|
||||
|
||||
RsDhtPeer::RsDhtPeer()
|
||||
|
@ -2169,10 +2169,7 @@ void p3BitDht::Feedback_Connected(std::string pid)
|
||||
|
||||
dpd->mConnectLogic.updateCb(CSB_UPDATE_CONNECTED);
|
||||
|
||||
std::ostringstream msg;
|
||||
msg << "Connected in " << dpd->mPeerConnectTS - dpd->mPeerConnectUdpTS;
|
||||
msg << " secs";
|
||||
dpd->mPeerConnectMsg = msg.str();
|
||||
rs_sprintf(dpd->mPeerConnectMsg, "Connected in %ld secs", dpd->mPeerConnectTS - dpd->mPeerConnectUdpTS);
|
||||
|
||||
// Remove the Connection Request.
|
||||
if (dpd->mPeerReqState == RSDHT_PEERREQ_RUNNING)
|
||||
@ -2290,10 +2287,7 @@ void p3BitDht::UdpConnectionFailed_locked(DhtPeerDetails *dpd)
|
||||
|
||||
dpd->mPeerConnectState = RSDHT_PEERCONN_DISCONNECTED;
|
||||
dpd->mPeerConnectClosedTS = time(NULL);
|
||||
std::ostringstream msg;
|
||||
msg << "Closed, Alive for: " << dpd->mPeerConnectClosedTS - dpd->mPeerConnectTS;
|
||||
msg << " secs";
|
||||
dpd->mPeerConnectMsg = msg.str();
|
||||
rs_sprintf(dpd->mPeerConnectMsg, "Closed, Alive for: %ld secs", dpd->mPeerConnectClosedTS - dpd->mPeerConnectTS);
|
||||
}
|
||||
|
||||
|
||||
|
@ -907,17 +907,17 @@ std::string ProcessPGPmeError(gpgme_error_t ERR)
|
||||
gpgme_err_code_t code = gpgme_err_code(ERR);
|
||||
gpgme_err_source_t src = gpgme_err_source(ERR);
|
||||
|
||||
std::ostringstream ss ;
|
||||
std::string s ;
|
||||
|
||||
if(code > 0)
|
||||
{
|
||||
ss << "GPGme ERROR: Code: " << code << " Source: " << src << std::endl;
|
||||
ss << "GPGme ERROR: " << gpgme_strerror(ERR) << std::endl;
|
||||
rs_sprintf(s, "GPGme ERROR: Code: %d Source: %d\n", code, src);
|
||||
rs_sprintf_append(s, "GPGme ERROR: %s\n", gpgme_strerror(ERR));
|
||||
}
|
||||
else
|
||||
return std::string("Unknown error") ;
|
||||
|
||||
return ss.str() ;
|
||||
return s ;
|
||||
}
|
||||
|
||||
void print_pgpme_verify_summary(unsigned int summary)
|
||||
@ -1844,9 +1844,8 @@ int AuthGPGimpl::privateTrustCertificate(const std::string &id, int trustlvl)
|
||||
|
||||
gpgme_key_t trustKey = trustCert.key;
|
||||
std::string trustString;
|
||||
std::ostringstream trustStrOut;
|
||||
trustStrOut << trustlvl;
|
||||
class TrustParams sparams(trustStrOut.str());
|
||||
rs_sprintf(trustString, "%d", trustlvl);
|
||||
class TrustParams sparams(trustString);
|
||||
class EditParams params(TRUST_START, &sparams);
|
||||
gpgme_data_t out;
|
||||
gpg_error_t ERR;
|
||||
@ -1875,11 +1874,10 @@ static std::string setKeyPairParams(bool useRsa, unsigned int blen,
|
||||
std::string name, std::string comment, std::string email,
|
||||
std::string inPassphrase)
|
||||
{
|
||||
std::ostringstream params;
|
||||
params << "<GnupgKeyParms format=\"internal\">"<< std::endl;
|
||||
std::string params = "<GnupgKeyParms format=\"internal\">\n";
|
||||
if (useRsa)
|
||||
{
|
||||
params << "Key-Type: RSA"<< std::endl;
|
||||
params += "Key-Type: RSA\n";
|
||||
if (blen < 1024)
|
||||
{
|
||||
#ifdef GPG_DEBUG
|
||||
@ -1888,23 +1886,23 @@ static std::string setKeyPairParams(bool useRsa, unsigned int blen,
|
||||
blen = 1024;
|
||||
}
|
||||
blen = ((blen / 512) * 512); /* make multiple of 512 */
|
||||
params << "Key-Length: "<< blen << std::endl;
|
||||
rs_sprintf_append(params, "Key-Length: %u\n", blen);
|
||||
}
|
||||
else
|
||||
{
|
||||
params << "Key-Type: DSA"<< std::endl;
|
||||
params << "Key-Length: 1024"<< std::endl;
|
||||
params << "Subkey-Type: ELG-E"<< std::endl;
|
||||
params << "Subkey-Length: 1024"<< std::endl;
|
||||
params += "Key-Type: DSA\n";
|
||||
params += "Key-Length: 1024\n";
|
||||
params += "Subkey-Type: ELG-E\n";
|
||||
params += "Subkey-Length: 1024\n";
|
||||
}
|
||||
params << "Name-Real: "<< name << std::endl;
|
||||
params << "Name-Comment: "<< comment << std::endl;
|
||||
params << "Name-Email: "<< email << std::endl;
|
||||
params << "Expire-Date: 0"<< std::endl;
|
||||
params << "Passphrase: "<< inPassphrase << std::endl;
|
||||
params << "</GnupgKeyParms>"<< std::endl;
|
||||
params += "Name-Real: " + name + "\n";
|
||||
params += "Name-Comment: " + comment + "\n";
|
||||
params += "Name-Email: " + email + "\n";
|
||||
params += "Expire-Date: 0\n";
|
||||
params += "Passphrase: " + inPassphrase + "\n";
|
||||
params += "</GnupgKeyParms>\n";
|
||||
|
||||
return params.str();
|
||||
return params;
|
||||
}
|
||||
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "serialiser/rsbaseserial.h"
|
||||
#include "serialiser/rsserial.h"
|
||||
#include "util/rsthreads.h"
|
||||
#include "util/rsstring.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <map>
|
||||
@ -292,11 +293,11 @@ uint32_t RsSerialiser::size(RsItem *item)
|
||||
#ifdef RSSERIAL_ERROR_DEBUG
|
||||
std::cerr << "RsSerialiser::size() ERROR serialiser missing!";
|
||||
|
||||
std::ostringstream out;
|
||||
out << std::hex << item->PacketId() << std::dec;
|
||||
std::string out;
|
||||
rs_sprintf(out, "%x", item->PacketId());
|
||||
|
||||
std::cerr << "RsSerialiser::size() PacketId: ";
|
||||
std::cerr << out.str();
|
||||
std::cerr << out;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
@ -305,10 +306,9 @@ uint32_t RsSerialiser::size(RsItem *item)
|
||||
}
|
||||
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::ostringstream out;
|
||||
out << std::hex << "RsSerialiser::size() Item->PacketId(): " << item->PacketId();
|
||||
out << " matched to Serialiser Type: " << type;
|
||||
std::cerr << out.str() << std::endl;
|
||||
std::string out;
|
||||
rs_sprintf(out, "RsSerialiser::size() Item->PacketId(): %x matched to Serialiser Type: %lu", item->PacketId(), type);
|
||||
std::cerr << out << std::endl;
|
||||
#endif
|
||||
|
||||
return (it->second)->size(item);
|
||||
@ -333,11 +333,11 @@ bool RsSerialiser::serialise (RsItem *item, void *data, uint32_t *size)
|
||||
|
||||
#ifdef RSSERIAL_ERROR_DEBUG
|
||||
std::cerr << "RsSerialiser::serialise() ERROR serialiser missing!";
|
||||
std::ostringstream out;
|
||||
out << std::hex << item->PacketId() << std::dec;
|
||||
std::string out;
|
||||
rs_sprintf(out, "%x", item->PacketId());
|
||||
|
||||
std::cerr << "RsSerialiser::serialise() PacketId: ";
|
||||
std::cerr << out.str();
|
||||
std::cerr << out;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
return false;
|
||||
@ -346,10 +346,9 @@ bool RsSerialiser::serialise (RsItem *item, void *data, uint32_t *size)
|
||||
}
|
||||
|
||||
#ifdef RSSERIAL_DEBUG
|
||||
std::ostringstream out;
|
||||
out << std::hex << "RsSerialiser::serialise() Item->PacketId(): " << item->PacketId();
|
||||
out << " matched to Serialiser Type: " << type;
|
||||
std::cerr << out.str() << std::endl;
|
||||
std::string out;
|
||||
rs_sprintf(out, "RsSerialiser::serialise() Item->PacketId(): %x matched to Serialiser Type: %lu", item->PacketId(), type);
|
||||
std::cerr << out << std::endl;
|
||||
#endif
|
||||
|
||||
return (it->second)->serialise(item, data, size);
|
||||
@ -401,12 +400,11 @@ RsItem * RsSerialiser::deserialise(void *data, uint32_t *size)
|
||||
|
||||
#ifdef RSSERIAL_ERROR_DEBUG
|
||||
std::cerr << "RsSerialiser::deserialise() ERROR deserialiser missing!";
|
||||
std::ostringstream out;
|
||||
out << std::hex << getRsItemId(data) << std::dec;
|
||||
std::string out;
|
||||
rs_sprintf(out, "%x", getRsItemId(data));
|
||||
|
||||
std::cerr << "RsSerialiser::deserialise() PacketId: ";
|
||||
std::cerr << out.str();
|
||||
std::cerr << std::endl;
|
||||
std::cerr << out << std::endl;
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
@ -34,32 +34,30 @@
|
||||
/* print out a packet */
|
||||
#include <stdlib.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <vector>
|
||||
|
||||
#include "serialiser/rstlvbase.h"
|
||||
#include "serialiser/rstlvtypes.h"
|
||||
#include "util/utest.h"
|
||||
#include "util/rsstring.h"
|
||||
|
||||
void displayRawPacket(std::ostream &out, void *data, uint32_t size)
|
||||
{
|
||||
uint32_t i;
|
||||
std::ostringstream sout;
|
||||
sout << "DisplayRawPacket: Size: " << size;
|
||||
sout << std::hex;
|
||||
std::string sout;
|
||||
rs_sprintf(sout, "DisplayRawPacket: Size: %ld", size);
|
||||
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
if (i % 16 == 0)
|
||||
{
|
||||
sout << std::endl;
|
||||
sout += "\n";
|
||||
}
|
||||
sout << std::setw(2) << std::setfill('0')
|
||||
<< (int) (((unsigned char *) data)[i]) << ":";
|
||||
rs_sprintf_append(sout, "%02x:", (int) (((unsigned char *) data)[i]));
|
||||
}
|
||||
sout << std::endl;
|
||||
|
||||
out << sout.str();
|
||||
out << sout << std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
#include "rstunnelitems.h"
|
||||
#include "util/rsstring.h"
|
||||
|
||||
// -----------------------------------------------------------------------------------//
|
||||
// -------------------------------- Serialization. --------------------------------- //
|
||||
@ -184,21 +184,19 @@ bool RsTunnelHandshakeItem::serialize(void *data,uint32_t& pktsize)
|
||||
void displayRawPacket(std::ostream &out, void *data, uint32_t size)
|
||||
{
|
||||
uint32_t i;
|
||||
std::ostringstream sout;
|
||||
sout << "DisplayRawPacket: Size: " << size;
|
||||
sout << std::hex;
|
||||
std::string sout;
|
||||
rs_sprintf(sout, "DisplayRawPacket: Size: %ld", size);
|
||||
|
||||
for(i = 0; i < size; i++)
|
||||
{
|
||||
if (i % 16 == 0)
|
||||
{
|
||||
sout << std::endl;
|
||||
sout += "\n";
|
||||
}
|
||||
sout << std::setw(2) << std::setfill('0')
|
||||
<< (int) (((unsigned char *) data)[i]) << ":";
|
||||
rs_sprintf_append(sout, "%02x:", (int) (((unsigned char *) data)[i]));
|
||||
}
|
||||
sout << std::endl;
|
||||
|
||||
out << sout.str();
|
||||
out << sout << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -29,9 +29,10 @@
|
||||
#include "UPnPBase.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sstream> // for std::istringstream
|
||||
|
||||
#include <algorithm> // For transform()
|
||||
|
||||
#include "util/rsstring.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ >= 4
|
||||
@ -71,12 +72,8 @@ m_enabled(enabled ? "1" : "0"),
|
||||
m_description(description),
|
||||
m_key()
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << ex_port;
|
||||
m_ex_port = oss.str();
|
||||
std::ostringstream oss2;
|
||||
oss2 << in_port;
|
||||
m_in_port = oss2.str();
|
||||
rs_sprintf(m_ex_port, "%d", ex_port);
|
||||
rs_sprintf(m_in_port, "%d", in_port);
|
||||
m_key = m_protocol + m_ex_port;
|
||||
}
|
||||
|
||||
@ -128,7 +125,7 @@ std::string CUPnPLib::processUPnPErrorMessage(
|
||||
(void) errorString;
|
||||
(void) doc;
|
||||
|
||||
std::ostringstream msg;
|
||||
std::string msg;
|
||||
#ifdef UPNP_DEBUG
|
||||
if (errorString == NULL || *errorString == 0) {
|
||||
errorString = "Not available";
|
||||
@ -159,7 +156,7 @@ std::string CUPnPLib::processUPnPErrorMessage(
|
||||
std::cerr << std::endl;
|
||||
}
|
||||
#endif
|
||||
return msg.str();
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@ -170,8 +167,6 @@ void CUPnPLib::ProcessActionResponse(
|
||||
/* remove unused parameter warnings */
|
||||
(void) actionName;
|
||||
|
||||
std::ostringstream msg;
|
||||
msg << "Response: ";
|
||||
IXML_Element *root = Element_GetRootElement(RespDoc);
|
||||
IXML_Element *child = Element_GetFirstChild(root);
|
||||
if (child) {
|
||||
@ -491,7 +486,6 @@ m_eventSubURL(upnpLib.Element_GetChildValueByTag(service, "eventSubURL")),
|
||||
m_timeout(1801),
|
||||
m_SCPD(NULL)
|
||||
{
|
||||
std::ostringstream msg;
|
||||
int errcode;
|
||||
|
||||
std::vector<char> vscpdURL(URLBase.length() + m_SCPDURL.length() + 1);
|
||||
@ -576,7 +570,6 @@ m_SCPD(NULL)
|
||||
//#warning Delete this code when m_WanService is no longer used.
|
||||
upnpLib.m_ctrlPoint.SetWanService(this);
|
||||
// Log it
|
||||
msg.str("");
|
||||
#ifdef UPNP_DEBUG
|
||||
std::cerr << "CUPnPService::CUPnPService() WAN Service Detected: '" <<
|
||||
m_serviceType << "'.";
|
||||
@ -587,7 +580,6 @@ m_SCPD(NULL)
|
||||
#if 0
|
||||
//#warning Delete this code on release.
|
||||
} else {
|
||||
msg.str("");
|
||||
#ifdef UPNP_DEBUG
|
||||
std::cerr << "WAN service detected again: '" <<
|
||||
m_serviceType <<
|
||||
@ -597,7 +589,6 @@ m_SCPD(NULL)
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
msg.str("");
|
||||
#ifdef UPNP_DEBUG
|
||||
std::cerr << "CUPnPService::CUPnPService() Uninteresting service detected: '" <<
|
||||
m_serviceType << "'. Ignoring.";
|
||||
@ -844,7 +835,6 @@ m_UDN (upnpLib.Element_GetChildValueByTag(device, "UDN")),
|
||||
m_UPC (upnpLib.Element_GetChildValueByTag(device, "UPC")),
|
||||
m_presentationURL (upnpLib.Element_GetChildValueByTag(device, "presentationURL"))
|
||||
{
|
||||
std::ostringstream msg;
|
||||
int presURLlen = strlen(URLBase.c_str()) +
|
||||
strlen(m_presentationURL.c_str()) + 2;
|
||||
std::vector<char> vpresURL(presURLlen);
|
||||
@ -864,7 +854,6 @@ m_presentationURL (upnpLib.Element_GetChildValueByTag(device, "presentationURL"
|
||||
m_presentationURL = presURL;
|
||||
}
|
||||
|
||||
msg.str("");
|
||||
#ifdef UPNP_DEBUG
|
||||
std::cerr << "CUPnPDevice::CUPnPDevice() \n Device: " <<
|
||||
"\n friendlyName: " << m_friendlyName <<
|
||||
@ -1310,8 +1299,8 @@ bool CUPnPControlPoint::PrivateGetExternalIpAdress()
|
||||
// This function is static
|
||||
int CUPnPControlPoint::Callback(Upnp_EventType EventType, void *Event, void * /*Cookie*/)
|
||||
{
|
||||
std::ostringstream msg;
|
||||
std::ostringstream msg2;
|
||||
std::string msg;
|
||||
std::string msg2;
|
||||
// Somehow, this is unreliable. UPNP_DISCOVERY_ADVERTISEMENT_ALIVE events
|
||||
// happen with a wrong cookie and... boom!
|
||||
// CUPnPControlPoint *upnpCP = static_cast<CUPnPControlPoint *>(Cookie);
|
||||
@ -1444,22 +1433,22 @@ upnpDiscovery:
|
||||
}
|
||||
case UPNP_EVENT_SUBSCRIBE_COMPLETE:
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_SUBSCRIBE_COMPLETE\n");
|
||||
msg << "error(UPNP_EVENT_SUBSCRIBE_COMPLETE): ";
|
||||
msg += "error(UPNP_EVENT_SUBSCRIBE_COMPLETE): ";
|
||||
goto upnpEventRenewalComplete;
|
||||
case UPNP_EVENT_UNSUBSCRIBE_COMPLETE:
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_UNSUBSCRIBE_COMPLETE\n");
|
||||
msg << "error(UPNP_EVENT_UNSUBSCRIBE_COMPLETE): ";
|
||||
msg += "error(UPNP_EVENT_UNSUBSCRIBE_COMPLETE): ";
|
||||
goto upnpEventRenewalComplete;
|
||||
case UPNP_EVENT_RENEWAL_COMPLETE: {
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_RENEWAL_COMPLETE\n");
|
||||
msg << "error(UPNP_EVENT_RENEWAL_COMPLETE): ";
|
||||
msg += "error(UPNP_EVENT_RENEWAL_COMPLETE): ";
|
||||
upnpEventRenewalComplete:
|
||||
struct Upnp_Event_Subscribe *es_event =
|
||||
(struct Upnp_Event_Subscribe *)Event;
|
||||
if (es_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
msg << "Error in Event Subscribe Callback";
|
||||
msg += "Error in Event Subscribe Callback";
|
||||
upnpCP->m_upnpLib.processUPnPErrorMessage(
|
||||
msg.str(), es_event->ErrCode, NULL, NULL);
|
||||
msg, es_event->ErrCode, NULL, NULL);
|
||||
} else {
|
||||
#if 0
|
||||
TvCtrlPointHandleSubscribeUpdate(
|
||||
@ -1474,13 +1463,13 @@ upnpEventRenewalComplete:
|
||||
|
||||
case UPNP_EVENT_AUTORENEWAL_FAILED:
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_AUTORENEWAL_FAILED\n");
|
||||
msg << "CUPnPControlPoint::Callback() error(UPNP_EVENT_AUTORENEWAL_FAILED): ";
|
||||
msg2 << "UPNP_EVENT_AUTORENEWAL_FAILED: ";
|
||||
msg += "CUPnPControlPoint::Callback() error(UPNP_EVENT_AUTORENEWAL_FAILED): ";
|
||||
msg2 += "UPNP_EVENT_AUTORENEWAL_FAILED: ";
|
||||
goto upnpEventSubscriptionExpired;
|
||||
case UPNP_EVENT_SUBSCRIPTION_EXPIRED: {
|
||||
//fprintf(stderr, "Callback: UPNP_EVENT_SUBSCRIPTION_EXPIRED\n");
|
||||
msg << "CUPnPControlPoint::Callback() error(UPNP_EVENT_SUBSCRIPTION_EXPIRED): ";
|
||||
msg2 << "UPNP_EVENT_SUBSCRIPTION_EXPIRED: ";
|
||||
msg += "CUPnPControlPoint::Callback() error(UPNP_EVENT_SUBSCRIPTION_EXPIRED): ";
|
||||
msg2 += "UPNP_EVENT_SUBSCRIPTION_EXPIRED: ";
|
||||
upnpEventSubscriptionExpired:
|
||||
struct Upnp_Event_Subscribe *es_event =
|
||||
(struct Upnp_Event_Subscribe *)Event;
|
||||
@ -1492,9 +1481,9 @@ upnpEventSubscriptionExpired:
|
||||
&TimeOut,
|
||||
newSID);
|
||||
if (ret != UPNP_E_SUCCESS) {
|
||||
msg << "Error Subscribing to EventURL";
|
||||
msg += "Error Subscribing to EventURL";
|
||||
upnpCP->m_upnpLib.processUPnPErrorMessage(
|
||||
msg.str(), es_event->ErrCode, NULL, NULL);
|
||||
msg, es_event->ErrCode, NULL, NULL);
|
||||
} else {
|
||||
ServiceMap::iterator it =
|
||||
upnpCP->m_ServiceMap.find(es_event->PublisherUrl);
|
||||
@ -1546,13 +1535,13 @@ upnpEventSubscriptionExpired:
|
||||
#ifdef UPNP_DEBUG
|
||||
fprintf(stderr, "CUPnPControlPoint::Callback() Callback: UPNP_CONTROL_GET_VAR_COMPLETE\n");
|
||||
#endif
|
||||
msg << "CUPnPControlPoint::Callback() error(UPNP_CONTROL_GET_VAR_COMPLETE): ";
|
||||
msg += "CUPnPControlPoint::Callback() error(UPNP_CONTROL_GET_VAR_COMPLETE): ";
|
||||
struct Upnp_State_Var_Complete *sv_event =
|
||||
(struct Upnp_State_Var_Complete *)Event;
|
||||
if (sv_event->ErrCode != UPNP_E_SUCCESS) {
|
||||
msg << "m_UpnpGetServiceVarStatusAsync";
|
||||
msg += "m_UpnpGetServiceVarStatusAsync";
|
||||
upnpCP->m_upnpLib.processUPnPErrorMessage(
|
||||
msg.str(), sv_event->ErrCode, NULL, NULL);
|
||||
msg, sv_event->ErrCode, NULL, NULL);
|
||||
} else {
|
||||
//add the variable to the wanservice property map
|
||||
(upnpCP->m_WanService->propertyMap)[std::string(sv_event->StateVarName)] = std::string(sv_event->CurrentVal);
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
@ -194,10 +193,8 @@ CXML_List<T, XML_ELEMENT_NAME, XML_LIST_NAME>::CXML_List(
|
||||
(*this)[upnpElement->GetKey()] = upnpElement;
|
||||
++i;
|
||||
}
|
||||
std::ostringstream msg;
|
||||
msg << "\n " << XML_LIST_NAME << ": " <<
|
||||
std::cerr << "\n " << XML_LIST_NAME << ": " <<
|
||||
i << " " << XML_ELEMENT_NAME << "s.";
|
||||
std::cerr << msg;
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include "zeroconf/p3zeroconf.h"
|
||||
#include <openssl/sha.h>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
#include "pqi/authgpg.h"
|
||||
@ -126,14 +125,9 @@ bool p3ZeroConf::getNetworkStats(uint32_t &netsize, uint32_t &localnetsize)
|
||||
void p3ZeroConf::createTxtRecord()
|
||||
{
|
||||
RsStackMutex stack(mZcMtx); /****** STACK LOCK MUTEX *******/
|
||||
std::ostringstream gpgidout;
|
||||
std::ostringstream sslidout;
|
||||
|
||||
gpgidout << "gpgid=" << mOwnGpgId;
|
||||
sslidout << "sslid=" << mOwnSslId;
|
||||
|
||||
std::string gpgid = gpgidout.str();
|
||||
std::string sslid = sslidout.str();
|
||||
std::string gpgid = "gpgid=" + mOwnGpgId;
|
||||
std::string sslid = "sslid=" + mOwnSslId;
|
||||
|
||||
mTextRecord += (char) gpgid.length();
|
||||
mTextRecord += gpgid;
|
||||
@ -1248,110 +1242,110 @@ int p3ZeroConf::locked_stopQueryIp()
|
||||
|
||||
std::string displayDNSServiceError(DNSServiceErrorType errcode)
|
||||
{
|
||||
std::ostringstream str;
|
||||
std::string str;
|
||||
switch(errcode)
|
||||
{
|
||||
default:
|
||||
str << "kDNSServiceErr_??? UNKNOWN-CODE";
|
||||
str = "kDNSServiceErr_??? UNKNOWN-CODE";
|
||||
break;
|
||||
case kDNSServiceErr_NoError:
|
||||
str << "kDNSServiceErr_NoError";
|
||||
str = "kDNSServiceErr_NoError";
|
||||
break;
|
||||
case kDNSServiceErr_Unknown:
|
||||
str << "kDNSServiceErr_Unknown";
|
||||
str = "kDNSServiceErr_Unknown";
|
||||
break;
|
||||
case kDNSServiceErr_NoSuchName:
|
||||
str << "kDNSServiceErr_NoSuchName";
|
||||
str = "kDNSServiceErr_NoSuchName";
|
||||
break;
|
||||
case kDNSServiceErr_NoMemory:
|
||||
str << "kDNSServiceErr_NoMemory";
|
||||
str = "kDNSServiceErr_NoMemory";
|
||||
break;
|
||||
case kDNSServiceErr_BadParam:
|
||||
str << "kDNSServiceErr_BadParam";
|
||||
str = "kDNSServiceErr_BadParam";
|
||||
break;
|
||||
case kDNSServiceErr_BadReference:
|
||||
str << "kDNSServiceErr_BadReference";
|
||||
str = "kDNSServiceErr_BadReference";
|
||||
break;
|
||||
case kDNSServiceErr_BadState:
|
||||
str << "kDNSServiceErr_BadState";
|
||||
str = "kDNSServiceErr_BadState";
|
||||
break;
|
||||
case kDNSServiceErr_BadFlags:
|
||||
str << "kDNSServiceErr_BadFlags";
|
||||
str = "kDNSServiceErr_BadFlags";
|
||||
break;
|
||||
case kDNSServiceErr_Unsupported:
|
||||
str << "kDNSServiceErr_Unsupported";
|
||||
str = "kDNSServiceErr_Unsupported";
|
||||
break;
|
||||
case kDNSServiceErr_NotInitialized:
|
||||
str << "kDNSServiceErr_NotInitialized";
|
||||
str = "kDNSServiceErr_NotInitialized";
|
||||
break;
|
||||
case kDNSServiceErr_AlreadyRegistered:
|
||||
str << "kDNSServiceErr_AlreadyRegistered";
|
||||
str = "kDNSServiceErr_AlreadyRegistered";
|
||||
break;
|
||||
case kDNSServiceErr_NameConflict:
|
||||
str << "kDNSServiceErr_NameConflict";
|
||||
str = "kDNSServiceErr_NameConflict";
|
||||
break;
|
||||
case kDNSServiceErr_Invalid:
|
||||
str << "kDNSServiceErr_Invalid";
|
||||
str = "kDNSServiceErr_Invalid";
|
||||
break;
|
||||
case kDNSServiceErr_Firewall:
|
||||
str << "kDNSServiceErr_Firewall";
|
||||
str = "kDNSServiceErr_Firewall";
|
||||
break;
|
||||
case kDNSServiceErr_Incompatible:
|
||||
str << "kDNSServiceErr_Incompatible";
|
||||
str = "kDNSServiceErr_Incompatible";
|
||||
break;
|
||||
case kDNSServiceErr_BadInterfaceIndex:
|
||||
str << "kDNSServiceErr_BadInterfaceIndex";
|
||||
str = "kDNSServiceErr_BadInterfaceIndex";
|
||||
break;
|
||||
case kDNSServiceErr_Refused:
|
||||
str << "kDNSServiceErr_Refused";
|
||||
str = "kDNSServiceErr_Refused";
|
||||
break;
|
||||
case kDNSServiceErr_NoSuchRecord:
|
||||
str << "kDNSServiceErr_NoSuchRecord";
|
||||
str = "kDNSServiceErr_NoSuchRecord";
|
||||
break;
|
||||
case kDNSServiceErr_NoAuth:
|
||||
str << "kDNSServiceErr_NoAuth";
|
||||
str = "kDNSServiceErr_NoAuth";
|
||||
break;
|
||||
case kDNSServiceErr_NoSuchKey:
|
||||
str << "kDNSServiceErr_NoSuchKey";
|
||||
str = "kDNSServiceErr_NoSuchKey";
|
||||
break;
|
||||
case kDNSServiceErr_NATTraversal:
|
||||
str << "kDNSServiceErr_NATTraversal";
|
||||
str = "kDNSServiceErr_NATTraversal";
|
||||
break;
|
||||
case kDNSServiceErr_DoubleNAT:
|
||||
str << "kDNSServiceErr_DoubleNAT";
|
||||
str = "kDNSServiceErr_DoubleNAT";
|
||||
break;
|
||||
case kDNSServiceErr_BadTime:
|
||||
str << "kDNSServiceErr_BadTime";
|
||||
str = "kDNSServiceErr_BadTime";
|
||||
break;
|
||||
case kDNSServiceErr_BadSig:
|
||||
str << "kDNSServiceErr_BadSig";
|
||||
str = "kDNSServiceErr_BadSig";
|
||||
break;
|
||||
case kDNSServiceErr_BadKey:
|
||||
str << "kDNSServiceErr_BadKey";
|
||||
str = "kDNSServiceErr_BadKey";
|
||||
break;
|
||||
case kDNSServiceErr_Transient:
|
||||
str << "kDNSServiceErr_Transient";
|
||||
str = "kDNSServiceErr_Transient";
|
||||
break;
|
||||
case kDNSServiceErr_ServiceNotRunning:
|
||||
str << "kDNSServiceErr_ServiceNotRunning";
|
||||
str = "kDNSServiceErr_ServiceNotRunning";
|
||||
break;
|
||||
case kDNSServiceErr_NATPortMappingUnsupported:
|
||||
str << "kDNSServiceErr_NATPortMappingUnsupported";
|
||||
str = "kDNSServiceErr_NATPortMappingUnsupported";
|
||||
break;
|
||||
case kDNSServiceErr_NATPortMappingDisabled:
|
||||
str << "kDNSServiceErr_NATPortMappingDisabled";
|
||||
str = "kDNSServiceErr_NATPortMappingDisabled";
|
||||
break;
|
||||
#if 0
|
||||
case kDNSServiceErr_NoRouter:
|
||||
str << "kDNSServiceErr_NoRouter";
|
||||
str = "kDNSServiceErr_NoRouter";
|
||||
break;
|
||||
case kDNSServiceErr_PollingMode:
|
||||
str << "kDNSServiceErr_PollingMode";
|
||||
str = "kDNSServiceErr_PollingMode";
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
return str.str();
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user