2012-06-26 84 views
1

我一直在試圖讓PCP LibJingle例子現在工作好幾天。在編制完所有編譯和運行錯誤之後,我現在遇到了一個我以前沒有經歷過的錯誤。LibJingle pcp_main.cc 503錯誤

當作爲發送者或接收者運行該程序時,程序得到503「服務不可用」錯誤,並終止程序,但運行時服務器工作正常。我知道標準是5xx意味着服務器端的錯誤,所以我逐行查看了程序輸出(在最後提供)。從我的服務器和設的Libjingle,接近零的經驗,我可以計算最好的是,要麼(或兩者)都導致以下503:

  1. 谷歌已經關閉了必要的服務,爲設的Libjingle PCP例子。
  2. 優先級狀態= -1(根據我的數字,意味着客戶端不可用)。

我已經登錄到兩個Google帳戶,以便它們不脫機/不可用,並且LibJingle程序反映了這一點。但是,只要PCP示例運行,優先級就會重新設置爲-1。我也注意到,大多數,如果不是全部,在程序輸出的谷歌鏈接的是404

我的問題:

  • 難道這些理論望其項背也許什麼/是怎麼回事?
  • 我需要做些什麼來解決這個問題?
  • 我聽說可以使用服務器(除了Google的服務器)來運行程序。這是真的?如果是這樣,我會去哪裏看看這個?

非常感謝您的幫助。 - KMC

P.S.在提供的程序輸出中,我試圖發送僞造文件... [email protected]僞造... [email protected]。我審查了一些事情,並試圖削減其他一些東西。但是,不知道可能或不相關的內容,我沒有做太多的工作。如果一個國防部或其他人知道什麼可能是相關的,並想編輯它,請隨時這樣做。

[email protected]:~/Desktop$ ./LibJingle_Install/libjingle-0.6.13/talk/build/dbg/staging/pcp [email protected] call_main.pdf [email protected]/pcp8B13E6B8:outputmainadobe.pdf 
Directory: /home/forgefour/Desktop 
Password: 
connecting... 
[002:406] OpenSSLAdapter::OnConnectEvent 
[002:406] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012 
[002:406] <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
logging in... 
[002:446] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012 
[002:446] <stream:stream from="gmail.com" id="00B7404A40B94AA0" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
[002:447] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012 
[002:447] <stream:features> 
[002:447]  <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"> 
[002:447]  <required/> 
[002:447]  </starttls> 
[002:447]  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> 
[002:447]  <mechanism> 
[002:447]   X-GOOGLE-TOKEN 
[002:447]  </mechanism> 
[002:447]  <mechanism> 
[002:447]   X-OAUTH2 
[002:447]  </mechanism> 
[002:447]  </mechanisms> 
[002:447] </stream:features> 
[002:447] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012 
[002:447] <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/> 
[002:488] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:17 2012 
[002:488] <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/> 
[002:488] BeginSSL: gmail.com 
[002:488] ContinueSSL 
[002:488] SSL_connect:before/connect initialization 
[002:489] SSL_connect:SSLv3 write client hello A 
[002:489] SSL_connect:error in SSLv3 read server hello A 
[002:489] -- error want read 
[002:489] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:17 2012 
[002:489] <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
[002:530] ContinueSSL 
[002:530] SSL_connect:error in SSLv3 read server hello A 
[002:530] -- error want read 
[002:531] ContinueSSL 
[002:531] SSL_connect:SSLv3 read server hello A 
[002:531] SSL_connect:SSLv3 read server certificate A 
[002:531] SSL_connect:SSLv3 read server done A 
[002:531] SSL_connect:SSLv3 write client key exchange A 
[002:532] SSL_connect:SSLv3 write change cipher spec A 
[002:532] SSL_connect:SSLv3 write finished A 
[002:532] SSL_connect:SSLv3 flush data 
[002:532] SSL_connect:error in SSLv3 read finished A 
[002:532] -- error want read 
[002:575] ContinueSSL 
[002:575] SSL_connect:SSLv3 read finished A 
[002:575] -- success 
[002:575] Certificate from server: 
[002:575]   Version: 3 (0x2) 
     Serial Number:31:fa:c7:51:00:00:00:00:5b:30 
    Signature Algorithm: sha1WithRSAEncryption 
     Issuer: C=US, O=Google Inc, CN=Google Internet Authority 
     Validity 
      Not Before: Jun 5 00:52:14 2012 GMT 
      Not After : Jun 5 01:02:14 2013 GMT 
     Subject: C=US, ST=California, L=Mountain View, O=Google Inc, CN=gmail.com 
     Subject Public Key Info: 
      Public Key Algorithm: rsaEncryption 
       Public-Key: (1024 bit) 
       Modulus:... 
       Exponent: 65537 (0x10001) 
     X509v3 extensions: 
      X509v3 Extended Key Usage: 
       TLS Web Server Authentication, TLS Web Client Authentication 
      X509v3 Subject Key Identifier: 
       E1:73:4D:BB:F5:22:C3:57:06:EA:BF:18:73:1F:91:29:EE:54:2A:17 
      X509v3 Authority Key Identifier: 
       keyid:BF:C0:30:EB:F5:43:11:3E:67:BA:9E:91:FB:FC:6A:DA:E3:6B:12:24 
      X509v3 CRL Distribution Points: 
       Full Name:URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crl 
      Authority Information Access: 
       CA Issuers - URI:http://www.gstatic.com/GoogleInternetAuthority/GoogleInternetAuthority.crt 
      X509v3 Subject Alternative Name: DNS:gmail.com 
    Signature Algorithm: sha1WithRSAEncryption... 
[002:575] Cipher: AES128-SHA SSLv3 Kx=RSA Au=RSA Enc=AES(128) Mac=SHA1 
[002:616] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:616] <stream:stream from="gmail.com" id="F585A9BF4936FE0D" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
[002:616] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:616] <stream:features> 
[002:616]  <mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"> 
[002:616]  <mechanism> 
[002:616]   PLAIN 
[002:616]  </mechanism> 
[002:616]  <mechanism> 
[002:616]   X-GOOGLE-TOKEN 
[002:616]  </mechanism> 
[002:616]  <mechanism> 
[002:616]   X-OAUTH2 
[002:616]  </mechanism> 
[002:616]  </mechanisms> 
[002:616] </stream:features> 
[002:617] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:617] <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN" auth:allow-non-google-login="true" auth:client-uses-full-bind-result="true" xmlns:auth="http://www.google.com/talk/protocol/auth"> 
[002:617]  ## TEXT REMOVED ## 
[002:617] </auth> 
[002:696] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:696] <success xmlns="urn:ietf:params:xml:ns:xmpp-sasl"/> 
[002:697] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:697] <stream:stream to="gmail.com" xml:lang="*" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
[002:737] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:737] <stream:stream from="gmail.com" id="A554FE81E66DED32" version="1.0" xmlns:stream="http://etherx.jabber.org/streams" xmlns="jabber:client"> 
[002:737] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:737] <stream:features> 
[002:737]  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"/> 
[002:737]  <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> 
[002:737] </stream:features> 
[002:737] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:737] <iq type="set" id="0"> 
[002:737]  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"> 
[002:737]  <resource> 
[002:737]   pcp 
[002:737]  </resource> 
[002:737]  </bind> 
[002:737] </iq> 
[002:777] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:777] <iq id="0" type="result"> 
[002:777]  <bind xmlns="urn:ietf:params:xml:ns:xmpp-bind"> 
[002:777]  <jid> 
[002:777]   [email protected]/pcp7B23909E 
[002:777]  </jid> 
[002:777]  </bind> 
[002:777] </iq> 
[002:777] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:777] <iq type="set" id="1"> 
[002:777]  <session xmlns="urn:ietf:params:xml:ns:xmpp-session"/> 
[002:777] </iq> 
[002:778] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:817] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:817] <iq type="result" id="1"/> 
logged in... 
[002:817] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:817] <presence> 
[002:817]  <priority> 
[002:817]  -1 
[002:817]  </priority> 
[002:817] </presence> 
Logged in as [email protected]/pcp7B23909E 
[002:817] Making key pair 
[002:822] Returning key pair 
[002:822] Making certificate for [email protected]/pcp7B23909E 
[002:823] Returning certificate 
[002:823] TunnelSessionClientBase::OnSessionCreate: received=0 
[002:823] Session:2481285798 Old state:STATE_INIT New state:STATE_SENTINITIATE Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p 
[002:823] TunnelSession::OnSessionState(Session::STATE_SENTINITIATE) 
[002:823] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:823] <iq type="get" id="3"> 
[002:823]  <query xmlns="google:jingleinfo"/> 
[002:823] </iq> 
[002:823] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:823] <iq to="[email protected]/pcp8B13E6B8" type="set" id="5"> 
[002:823]  <jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="2481285798" initiator="[email protected]/pcp7B23909E"> 
[002:823]  <content name="securetunnel" creator="initiator"> 
[002:823]   <description xmlns="http://www.google.com/talk/securetunnel"> 
[002:823]   <type> 
[002:823]    recv:outputmainadobe.pdf 
[002:823]   </type> 
[002:823]   <client-cert> 
[002:823]    -----BEGIN CERTIFICATE-----...-----END CERTIFICATE----- 
[002:823]   </client-cert> 
[002:823]   </description> 
[002:823]   <transport xmlns="http://www.google.com/transport/p2p"/> 
[002:823]  </content> 
[002:823]  </jingle> 
[002:823]  <session xmlns="http://www.google.com/session" type="initiate" id="2481285798" initiator="[email protected]/pcp7B23909E"> 
[002:823]  <description xmlns="http://www.google.com/talk/securetunnel"> 
[002:823]   <type> 
[002:823]   recv:outputmainadobe.pdf 
[002:823]   </type> 
[002:823]   <client-cert> 
[002:823]   -----BEGIN CERTIFICATE-----...-----END CERTIFICATE----- 
[002:823]   </client-cert> 
[002:823]  </description> 
[002:823]  </session> 
[002:823] </iq> 
[002:867] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:867] <iq to="[email protected]/pcp7B23909E" id="3" type="result"> 
[002:867]  <query xmlns="google:jingleinfo"> 
[002:867]  <stun> 
[002:867]   <server host="stun.l.google.com" udp="19302"/> 
[002:867]   <server host="alt3.stun.l.google.com" udp="19302"/> 
[002:867]   <server host="alt2.stun.l.google.com" udp="19302"/> 
[002:867]   <server host="alt4.stun.l.google.com" udp="19302"/> 
[002:867]   <server host="alt1.stun.l.google.com" udp="19302"/> 
[002:867]  </stun> 
[002:867]  <relay> 
[002:867]   <token> 
[002:867]   CAESHgoVZm9yZ2Vjb21tczFAZ21haWwuY29tEJXfqb2CJxoQy4rGyFRtv1QQGHf8AQWC0A== 
[002:867]   </token> 
[002:867]   <server host="relay.google.com" udp="19295" tcp="19294" tcpssl="443"/> 
[002:867]  </relay> 
[002:867]  </query> 
[002:867] </iq> 
[002:880] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:880] <presence from="[email protected]/pcp0C32AC91" to="[email protected]/pcp7B23909E"> 
[002:880]  <priority> 
[002:880]  -1 
[002:880]  </priority> 
[002:880]  <x xmlns="vcard-temp:x:update"/> 
[002:880] </presence> 
[002:880] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:882] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:882] <presence from="[email protected]/gmail.17841843" to="[email protected]/pcp7B23909E"> 
[002:882]  <status/> 
[002:882]  <priority> 
[002:882]  24 
[002:882]  </priority> 
[002:882]  <caps:c node="http://mail.google.com/xmpp/client/caps" ver="1.1" ext="pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1" xmlns:caps="http://jabber.org/protocol/caps"/> 
[002:882]  <x xmlns="vcard-temp:x:update"> 
[002:882]  <photo> 
[002:882]   c632207e8c5c202147ccbd6c431334234750f966 
[002:882]  </photo> 
[002:882]  </x> 
[002:882] </presence> 
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:956] <iq to="[email protected]/pcp7B23909E" type="error" id="5" from="forg[email protected]/pcp8B13E6B8"> 
[002:956]  <jingle action="session-initiate" sid="2481285798" initiator="[email protected]/pcp7B23909E" xmlns="urn:xmpp:jingle:1"> 
[002:956]  <content name="securetunnel" creator="initiator"> 
[002:956]   <description xmlns="http://www.google.com/talk/securetunnel"> 
[002:956]   <type> 
[002:956]    recv:outputmainadobe.pdf 
[002:956]   </type> 
[002:956]   <client-cert> 
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:956] -----BEGIN CERTIFICATE-----...-----END CERTIFICATE----- 
[002:956] </client-cert> 
[002:956] </description> 
[002:956] <transport xmlns="http://www.google.com/transport/p2p"/> 
[002:956] </content> 
[002:956] </jingle> 
[002:956] <session type="initiate" id="2481285798" initiator="[email protected]/pcp7B23909E" xmlns="http://www.google.com/session"> 
[002:956] <description xmlns="http://www.google.com/talk/securetunnel"> 
[002:956] <type> 
[002:956] recv:outputmainadobe.pdf 
[002:956] </type> 
[002:956] <client-cert> 
[002:956] RECV <<<<<<<<<<<<<<<<<<<<<<<<< : Mon Jun 25 17:09:18 2012 
[002:956] -----BEGIN CERTIFICATE-----...-----END CERTIFICATE----- 
[002:956] </client-cert> 
[002:956] </description> 
[002:956] </session> 
[002:956] <error code="503" type="cancel"> 
[002:956] <service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/> 
[002:956] </error> 
[002:956] </iq> 
[002:957] Error(session.cc:858): Session error: 
<cli:error code="503" type="cancel" xmlns:cli="jabber:client"><service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></cli:error> 
in response to: 
<cli:iq to="[email protected]/pcp8B13E6B8" type="set" id="5" xmlns:cli="jabber:client"><jingle xmlns="urn:xmpp:jingle:1" action="session-initiate" sid="2481285798" initiator="[email protected]/pcp7B23909E"><content name="securetunnel" creator="initiator"><description xmlns="http://www.google.com/talk/securetunnel"><type>recv:outputmainadobe.pdf</type><client-cert>-----BEGIN CERTIFICATE-----...-----END CERTIFICATE----- 
</client-cert></description><transport xmlns="http://www.google.com/transport/p2p"/></content></jingle><session xmlns="http://www.google.com/session" type="initiate" id="2481285798" initiator="[email protected]/pcp7B23909E"><description xmlns="http://www.google.com/talk/securetunnel"><type>recv:outputmainadobe.pdf</type><client-cert>-----BEGIN CERTIFICATE-----...----END CERTIFICATE----- 
</client-cert></description></session></cli:iq> 
[002:957] Session:2481285798 Old state:STATE_SENTINITIATE New state:STATE_SENTTERMINATE Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p 
[002:957] TunnelSession::OnSessionState(Session::STATE_SENTTERMINATE) 
[002:957] Destroying unconnected PseudoTcpChannel 
[002:957] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:957] <iq to="[email protected]/pcp8B13E6B8" type="set" id="6"> 
[002:957]  <jingle xmlns="urn:xmpp:jingle:1" action="session-terminate" sid="2481285798"> 
[002:957]  <reason> 
[002:957]   <general-error/> 
[002:957]  </reason> 
[002:957]  </jingle> 
[002:957]  <session xmlns="http://www.google.com/session" type="terminate" id="2481285798" initiator="[email protected]/pcp7B23909E"> 
[002:957]  <general-error/> 
[002:957]  </session> 
[002:957] </iq> 
[002:957] OpenSSLStreamAdapter::OnEvent(SE_CLOSE, -1) 
[002:957] Cleanup 
Tunnel closed with error: -1 
[002:957] Cleanup 
[002:957] TunnelSessionClientBase::OnSessionDestroy 
[002:957] Session:2481285798 Old state:STATE_SENTTERMINATE New state:STATE_DEINIT Type:http://www.google.com/talk/securetunnel Transport:http://www.google.com/transport/p2p 
[002:957] virtual void cricket::PseudoTcpChannel::OnMessage(talk_base::Message*): (MSG_SI_DESTROY) 
[002:957] SEND >>>>>>>>>>>>>>>>>>>>>>>>> : Mon Jun 25 17:09:18 2012 
[002:957] </stream:stream> 
logged out... 
[002:957] Cleanup 

編輯:根據要求我包括一些代碼(我將包括所有的,但主要的文件是723線)。我仍然直接使用谷歌的LibJingle代碼,未修改,因爲我還沒有能夠得到這個工作。該文件的完整代碼可以在here找到。

int main(int argc, char **argv) { 
    talk_base::LogMessage::LogThreads(); 
    talk_base::LogMessage::LogTimestamps(); 

    // Parse the arguments. 
    int index = 1; 
    while (index < argc) { 
    std::string name, value; 
    if (!ParseArg(argv[index], &name, &value)) 
     break; 

    if (name == "help") { 
     Usage(); 
    } else if (name == "verbose") { 
     talk_base::LogMessage::LogToDebug(talk_base::LS_VERBOSE); 
    } else if (name == "xmpp-host") { 
     gXmppHost = value; 
    } else if (name == "xmpp-port") { 
     gXmppPort = ParseIntArg(name, value); 
    } else if (name == "xmpp-use-tls") { 
     gXmppUseTls = ParseBoolArg(name, value)? 
      buzz::TLS_REQUIRED : buzz::TLS_DISABLED; 
    } else { 
     Error(std::string("unknown option: ") + name); 
    } 
    index += 1; 
    } 

    if (index >= argc) 
    Error("bad arguments"); 
    gUserJid = buzz::Jid(argv[index++]); 
    if (!gUserJid.IsValid()) 
    Error("bad arguments"); 

    char path[MAX_PATH]; 
#if WIN32 
    GetCurrentDirectoryA(MAX_PATH, path); 
#else 
    if (NULL == getcwd(path, MAX_PATH)) 
    Error("Unable to get current path"); 
#endif 

    std::cout << "Directory: " << std::string(path) << std::endl; 

    buzz::Jid gSrcJid; 
    buzz::Jid gDstJid; 
    std::string gSrcFile; 
    std::string gDstFile; 

    bool as_server = true; 
    if (index + 2 == argc) { 
    ParseFileArg(argv[index], &gSrcJid, &gSrcFile); 
    ParseFileArg(argv[index+1], &gDstJid, &gDstFile); 
    if(gSrcJid.Str().empty() == gDstJid.Str().empty()) 
     Error("Exactly one of source JID or destination JID must be empty."); 
    as_server = false; 
    } else if (index != argc) { 
    Error("bad arguments"); 
    } 

    std::cout << "Password: "; 
    SetConsoleEcho(false); 
    std::cin >> gUserPass.password(); 
    SetConsoleEcho(true); 
    std::cout << std::endl; 

    talk_base::InitializeSSL(); 
    CustomXmppPump pump;// Log in. 
    pump.client()->SignalLogInput.connect(&debug_log_, &DebugLog::Input); 
    pump.client()->SignalLogOutput.connect(&debug_log_, &DebugLog::Output); 
    pump.DoLogin(LoginSettings(), new XmppSocket(gXmppUseTls), 0); 

    // Wait until login succeeds. 
    std::vector<uint32> ids; 
    ids.push_back(MSG_LOGIN_COMPLETE); 
    ids.push_back(MSG_LOGIN_FAILED); 
    if (MSG_LOGIN_FAILED == Loop(ids)) 
    FatalError("Failed to connect");{ 
    talk_base::scoped_ptr<buzz::XmlElement> presence(
     new buzz::XmlElement(buzz::QN_PRESENCE)); 
    presence->AddElement(new buzz::XmlElement(buzz::QN_PRIORITY)); 
    presence->AddText("-1", 1); 
    pump.SendStanza(presence.get()); 
    } 

    std::string user_jid_str = pump.client()->jid().Str(); 
    std::cout << "Logged in as " << user_jid_str << std::endl; 

    // Prepare the random number generator. 
    talk_base::InitRandom(user_jid_str.c_str(), user_jid_str.size()); 

    // Create the P2P session manager. 
    talk_base::BasicNetworkManager network_manager; 
    AutoPortAllocator allocator(&network_manager, "pcp_agent"); 
    allocator.SetXmppClient(pump.client()); 
    cricket::SessionManager session_manager(&allocator); 
#ifdef USE_SSL_TUNNEL 
    cricket::SecureTunnelSessionClient session_client(pump.client()->jid(), 
                &session_manager); 
    if (!session_client.GenerateIdentity()) 
    FatalError("Failed to generate SSL identity"); 
#else // !USE_SSL_TUNNEL 
    cricket::TunnelSessionClient session_client(pump.client()->jid(), 
               &session_manager); 
#endif // USE_SSL_TUNNEL 
    cricket::SessionManagerTask *receiver = 
     new cricket::SessionManagerTask(pump.client(), &session_manager); 
    receiver->EnableOutgoingMessages(); 
    receiver->Start(); 

    bool success = true; 

    if (as_server) {// Establish the appropriate connection. 
    pump.Serve(&session_client); 
    } else { 
    talk_base::StreamInterface* stream = NULL; 
    std::string filename; 
    bool sending; 
    if (gSrcJid.Str().empty()) { 
     std::string message("recv:"); 
     message.append(gDstFile); 
     stream = session_client.CreateTunnel(gDstJid, message); 
     filename = gSrcFile; 
     sending = true; 
    } else { 
     std::string message("send:"); 
     message.append(gSrcFile); 
     stream = session_client.CreateTunnel(gSrcJid, message); 
     filename = gDstFile; 
     sending = false; 
    } 
    success = pump.ProcessStream(stream, filename, sending); 
    } 

    if (success) { 
    // Wait until the copy is done. 
    ids.clear(); 
    ids.push_back(MSG_DONE); 
    ids.push_back(MSG_LOGIN_FAILED); 
    Loop(ids); 
    } 

    pump.DoDisconnect();// Log out. 

    return 0; 
} 
+1

嗨AeroBuffalo和歡迎堆棧溢出! 堆棧溢出社區可能是能夠幫助您找出問題 但無法獲得具體數據 幫助我們通過分享您現在使用的代碼來爲您提供幫助 適應您的問題t如果你使用它,也可以包括一些樣本數據,你一定會得到一個有用的答案。感謝您的考慮。 :) –

回答

2

好的,所以這個錯誤是因爲錯誤的完整的JID和錯誤的代碼執行。 PCP應按照提供的順序運行:

  1. 運行「./pcp [email protected]」並提供帳戶密碼。
  2. 讀取代碼輸出中提供的[email protected]帳戶的完整JID。如果可能,最簡單的方法是在輸出中搜索:「登錄爲」。將用戶帳戶信息中的「.com /」後的所有內容全部取出。
  3. 運行「./pcp [email protected] send_file_name.extension [email protected]/(完整JID):received_file_name。擴展名「

發生此錯誤是因爲使用的代碼執行方法阻止帳戶被視爲可用。這與服務器錯誤或缺少Google服務無關(抱歉有懷疑你的谷歌),至於優先級爲-1,這也沒有任何關係的錯誤(在XMPP閱讀後得知)