1Only in libjingle-0.4.0: Makefile.in 2diff -r libjingle-0.4.0/README libjingle/files/README 31,39c1,39 4< Libjingle 5< 6< Libjingle is a set of components provided by Google to interoperate with Google 7< Talk's peer-to-peer and voice capabilities. This package will create several 8< static libraries you may link to your project as needed. 9< 10< -talk - No source files in talk/, just these subdirectories 11< |-base - Contains basic low-level portable utility functions for 12< | things like threads and sockets 13< |-p2p - The P2P stack 14< |-base - Base p2p functionality 15< |-client - Hooks to tie it into XMPP 16< |-session - Signaling 17< |-phone - Signaling code specific to making phone calls 18< |-third_party - Components that aren't ours 19< |-mediastreamer - Media components for dealing with sound hardware and 20< | voice codecs 21< |-xmllite - XML parser 22< |-xmpp - XMPP engine 23< 24< In addition, this package contains two examples in talk/examples which 25< illustrate the basic concepts of how the provided classes work. 26< 27< The xmllite component of libjingle depends on expat. You can download expat 28< from http://expat.sourceforge.net/. 29< 30< mediastreamer, the media components used by the example applications depend on 31< the oRTP and iLBC components from linphone, which can be found at 32< http://www.linphone.org. Linphone, in turn depends on GLib, which can be found 33< at http://www.gtk.org. This GLib dependency should be removed in future 34< releases. 35< 36< Building Libjingle 37< 38< Once the dependencies are installed, run ./configure. ./configure will return 39< an error if it failed to locate the proper dependencies. If ./configure 40< succeeds, run 'make' to build the components and examples. 41< 42< When the build is complete, you can run the call example from 43--- 44> Libjingle 45> 46> Libjingle is a set of components provided by Google to interoperate with Google 47> Talk's peer-to-peer and voice capabilities. This package will create several 48> static libraries you may link to your project as needed. 49> 50> -talk - No source files in talk/, just these subdirectories 51> |-base - Contains basic low-level portable utility functions for 52> | things like threads and sockets 53> |-p2p - The P2P stack 54> |-base - Base p2p functionality 55> |-client - Hooks to tie it into XMPP 56> |-session - Signaling 57> |-phone - Signaling code specific to making phone calls 58> |-third_party - Components that aren't ours 59> |-mediastreamer - Media components for dealing with sound hardware and 60> | voice codecs 61> |-xmllite - XML parser 62> |-xmpp - XMPP engine 63> 64> In addition, this package contains two examples in talk/examples which 65> illustrate the basic concepts of how the provided classes work. 66> 67> The xmllite component of libjingle depends on expat. You can download expat 68> from http://expat.sourceforge.net/. 69> 70> mediastreamer, the media components used by the example applications depend on 71> the oRTP and iLBC components from linphone, which can be found at 72> http://www.linphone.org. Linphone, in turn depends on GLib, which can be found 73> at http://www.gtk.org. This GLib dependency should be removed in future 74> releases. 75> 76> Building Libjingle 77> 78> Once the dependencies are installed, run ./configure. ./configure will return 79> an error if it failed to locate the proper dependencies. If ./configure 80> succeeds, run 'make' to build the components and examples. 81> 82> When the build is complete, you can run the call example from 8341,57c41,57 84< 85< Relay Server 86< 87< Libjingle will also build a relay server that may be used to relay traffic 88< when a direct peer-to-peer connection could not be established. The relay 89< server will build in talk/p2p/base/relayserver and will listen on UDP 90< ports 5000 and 5001. See the Libjingle Developer Guide at 91< http://code.google.com/apis/talk/index.html for information about configuring 92< a client to use this relay server. 93< 94< STUN Server 95< 96< Lastly, Libjingle builds a STUN server which implements the STUN protocol for 97< Simple Traversal of UDP over NAT. The STUN server is built as 98< talk/p2p/base/stunserver and listens on UDP port 7000. See the Libjingle 99< Developer Guide at http://code.google.com/apis/talk/index.html for information 100< about configuring a client to use this STUN server. 101--- 102> 103> Relay Server 104> 105> Libjingle will also build a relay server that may be used to relay traffic 106> when a direct peer-to-peer connection could not be established. The relay 107> server will build in talk/p2p/base/relayserver and will listen on UDP 108> ports 5000 and 5001. See the Libjingle Developer Guide at 109> http://code.google.com/apis/talk/index.html for information about configuring 110> a client to use this relay server. 111> 112> STUN Server 113> 114> Lastly, Libjingle builds a STUN server which implements the STUN protocol for 115> Simple Traversal of UDP over NAT. The STUN server is built as 116> talk/p2p/base/stunserver and listens on UDP port 7000. See the Libjingle 117> Developer Guide at http://code.google.com/apis/talk/index.html for information 118> about configuring a client to use this STUN server. 119diff -r libjingle-0.4.0/README.win libjingle/files/README.win 1201,24c1,24 121< 1. Install Visual C++ Express 2005. It is free from this link: 122< http://msdn.microsoft.com/vstudio/express/visualc/ 123< 124< 2. Install the platform SDK and integrate it into VC++ express 125< http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ 126< 127< 3. Download and install binary package for expat: 128< http://sourceforge.net/project/showfiles.php?group_id=10127&package_id=11277 129< 130< 4. Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box 131< Library files: C:\expat-VERSION\StaticLibs 132< Include files: C:\expat-VERSION\Source\Lib 133< where VERSION is the version of expat you've downoaded 134< 135< 5. Unzip the libjingle files and open the solution. 136< 137< 6. If you wish to build the call example with GIPS Voice Engine Lite, download Voice Engine Lite from http://developer.globalipsound.com 138< 139< 7. Extract the Interface and Library directories from the Voice Engine Lite zip file into talk\third_party\gips 140< 141< 8. Open talk\third_party\gips\expiration.h and set the GIPS_EXPIRATION #defines to the expiration date provided by GIPS and remove the #error directive 142< 143< 9. Build the solution 144< 145--- 146> 1. Install Visual C++ Express 2005. It is free from this link: 147> http://msdn.microsoft.com/vstudio/express/visualc/ 148> 149> 2. Install the platform SDK and integrate it into VC++ express 150> http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ 151> 152> 3. Download and install binary package for expat: 153> http://sourceforge.net/project/showfiles.php?group_id=10127&package_id=11277 154> 155> 4. Update the Visual C++ directories in the Projects and Solutions section in the Options dialog box 156> Library files: C:\expat-VERSION\StaticLibs 157> Include files: C:\expat-VERSION\Source\Lib 158> where VERSION is the version of expat you've downoaded 159> 160> 5. Unzip the libjingle files and open the solution. 161> 162> 6. If you wish to build the call example with GIPS Voice Engine Lite, download Voice Engine Lite from http://developer.globalipsound.com 163> 164> 7. Extract the Interface and Library directories from the Voice Engine Lite zip file into talk\third_party\gips 165> 166> 8. Open talk\third_party\gips\expiration.h and set the GIPS_EXPIRATION #defines to the expiration date provided by GIPS and remove the #error directive 167> 168> 9. Build the solution 169> 170Only in libjingle-0.4.0: aclocal.m4 171Only in libjingle-0.4.0: config.guess 172diff -r libjingle-0.4.0/config.h libjingle/files/config.h 17314c14 174< #define HAVE_ALSA_ASOUNDLIB_H 1 175--- 176> /* #undef HAVE_ALSA_ASOUNDLIB_H */ 17723c23 178< #define HAVE_GLIB 1 179--- 180> /* #undef HAVE_GLIB */ 18138c38 182< #define HAVE_ORTP 1 183--- 184> /* #undef HAVE_ORTP */ 18541c41 186< #define HAVE_SPEEX 1 187--- 188> /* #undef HAVE_SPEEX */ 18947c47 190< #define HAVE_SPEEX_SPEEX_H 1 191--- 192> /* #undef HAVE_SPEEX_SPEEX_H */ 19371c71 194< #define LINUX 1 195--- 196> /* #undef LINUX */ 197113c113 198< #define __ALSA_ENABLED__ 1 199--- 200> /* #undef __ALSA_ENABLED__ */ 201Only in libjingle-0.4.0: config.h.in 202Only in libjingle-0.4.0: config.sub 203Only in libjingle-0.4.0: configure 204Only in libjingle-0.4.0: depcomp 205Only in libjingle-0.4.0: install-sh 206Only in libjingle-0.4.0: ltmain.sh 207Only in libjingle-0.4.0: missing 208Only in libjingle-0.4.0/talk: Makefile.in 209Only in libjingle-0.4.0/talk/base: Makefile.in 210diff -r libjingle-0.4.0/talk/base/asynchttprequest.cc libjingle/files/talk/base/asynchttprequest.cc 21173c73 212< talk_base::SSLAdapter * ssl_adapter = talk_base::SSLAdapter::Create(socket); 213--- 214> talk_base::SSLAdapter * ssl_adapter = factory_->CreateSSLAdapter(socket); 21575c75,81 216< ssl_adapter->StartSSL(hostname_.c_str(), true); 217--- 218> int error = ssl_adapter->StartSSL(hostname_.c_str(), 219> use_restartable_ssl_sockets_); 220> if (error != 0) { 221> LOG(LS_WARNING) << "Could not start SSL; error = " << error; 222> delete ssl_adapter; 223> return 0; 224> } 225diff -r libjingle-0.4.0/talk/base/asynchttprequest.h libjingle/files/talk/base/asynchttprequest.h 22623,24c23 227< public SignalThread, 228< public sigslot::has_slots<> { 229--- 230> public SignalThread { 231106c105,106 232< binary_mode_(false), agent_(user_agent) { } 233--- 234> binary_mode_(false), agent_(user_agent), 235> ignore_bad_cert_(false), use_restartable_ssl_sockets_(false) { } 236114a115,120 237> bool use_restartable_ssl_sockets() const { 238> return use_restartable_ssl_sockets_; 239> } 240> void SetUseRestartableSSLSockets(bool use_restartable_ssl_sockets) { 241> use_restartable_ssl_sockets_ = use_restartable_ssl_sockets; 242> } 243133a140 244> bool use_restartable_ssl_sockets_; 245diff -r libjingle-0.4.0/talk/base/asynctcpsocket.cc libjingle/files/talk/base/asynctcpsocket.cc 24631a32,33 247> #include <cstring> 248> 249diff -r libjingle-0.4.0/talk/base/autodetectproxy.cc libjingle/files/talk/base/autodetectproxy.cc 25029c29 251< #include "talk/base/httpcommon.h" 252--- 253> #include "talk/base/httpcommon-inl.h" 254114c114 255< Thread::Current()->MessageQueue::Stop(); 256--- 257> Thread::Current()->Quit(); 258diff -r libjingle-0.4.0/talk/base/autodetectproxy.h libjingle/files/talk/base/autodetectproxy.h 25922c22 260< class AutoDetectProxy : public SignalThread, public sigslot::has_slots<> { 261--- 262> class AutoDetectProxy : public SignalThread { 263diff -r libjingle-0.4.0/talk/base/base64.h libjingle/files/talk/base/base64.h 26426,27c26,27 265< static const std::string Base64::Base64Table; 266< static const std::string::size_type Base64::DecodeTable[]; 267--- 268> static const std::string Base64Table; 269> static const std::string::size_type DecodeTable[]; 270diff -r libjingle-0.4.0/talk/base/common.h libjingle/files/talk/base/common.h 27154c54 272< #define stdmax(x,y) max(x,y) 273--- 274> #define stdmax(x,y) _max(x,y) 275114,119d113 276< // A macro to disallow the evil copy constructor and operator= functions 277< // This should be used in the private: declarations for a class 278< #define DISALLOW_EVIL_CONSTRUCTORS(TypeName) \ 279< TypeName(const TypeName&); \ 280< void operator=(const TypeName&) 281< 282diff -r libjingle-0.4.0/talk/base/criticalsection.h libjingle/files/talk/base/criticalsection.h 28339c39 284< #ifdef _DEBUG 285--- 286> #if !defined(NDEBUG) 28741c41 288< #endif // _DEBUG 289--- 290> #endif // !defined(NDEBUG) 29183c83 292< public: 293--- 294> public: 29585a86 296> pthread_mutexattr_init(&mutex_attribute); 29787a89,90 298> pthread_mutexattr_destroy(&mutex_attribute); 299> TRACK_OWNER(thread_ = 0); 30093a97 301> TRACK_OWNER(thread_ = pthread_self()); 30295a100 303> TRACK_OWNER(thread_ = 0); 30498c103,110 305< private: 306--- 307> 308> #if CS_TRACK_OWNER 309> bool CurrentThreadIsOwner() const { 310> return pthread_equal(thread_, pthread_self()); 311> } 312> #endif // CS_TRACK_OWNER 313> 314> private: 31599a112 316> TRACK_OWNER(pthread_t thread_); 317diff -r libjingle-0.4.0/talk/base/cryptstring.h libjingle/files/talk/base/cryptstring.h 31830a31 319> #include <string.h> 320diff -r libjingle-0.4.0/talk/base/diskcache.cc libjingle/files/talk/base/diskcache.cc 32143c43 322< #ifdef _DEBUG 323--- 324> #if !defined(NDEBUG) 32545c45 326< #else // !_DEBUG 327--- 328> #else // defined(NDEBUG) 32947c47 330< #endif // !_DEBUG 331--- 332> #endif // !defined(NDEBUG) 333231c231 334< #ifdef _DEBUG 335--- 336> #if !defined(NDEBUG) 337238c238 338< #endif // _DEBUG 339--- 340> #endif // !defined(NDEBUG) 341diff -r libjingle-0.4.0/talk/base/diskcache_win32.cc libjingle/files/talk/base/diskcache_win32.cc 34238c38 343< entry->streams = max(entry->streams, index + 1); 344--- 345> entry->streams = _max(entry->streams, index + 1); 346diff -r libjingle-0.4.0/talk/base/helpers.cc libjingle/files/talk/base/helpers.cc 34738a39 348> #include <wincrypt.h> 349diff -r libjingle-0.4.0/talk/base/host.cc libjingle/files/talk/base/host.cc 35030a31 351> #include <cstdlib> 352diff -r libjingle-0.4.0/talk/base/httpclient.cc libjingle/files/talk/base/httpclient.cc 353670a671 354> HttpAuthContext *context = context_.get(); 355676c677,678 356< *context_.use(), response, auth_method); 357--- 358> context, response, auth_method); 359> context_.reset(context); 360diff -r libjingle-0.4.0/talk/base/httpcommon.h libjingle/files/talk/base/httpcommon.h 361172c172 362< inline const uint16 UrlDefaultPort(bool secure) { 363--- 364> inline uint16 UrlDefaultPort(bool secure) { 365diff -r libjingle-0.4.0/talk/base/logging.cc libjingle/files/talk/base/logging.cc 36627a28 367> #include <stdio.h> 36876c77 369< #if _DEBUG 370--- 371> #if LOGGING 37278c79 373< #else // !_DEBUG 374--- 375> #else 37680c81 377< #endif // !_DEBUG 378--- 379> #endif 380diff -r libjingle-0.4.0/talk/base/logging.h libjingle/files/talk/base/logging.h 38167a68,69 382> 383> #if defined(SAFE_TO_DEFINE_TALK_BASE_LOGGING_MACROS) 38470a73 385> #endif // defined(SAFE_TO_DEFINE_TALK_BASE_LOGGING_MACROS) 386195a199 387> #if defined(SAFE_TO_DEFINE_TALK_BASE_LOGGING_MACROS) 388197c201 389< #if defined(_DEBUG) && !defined(NDEBUG) 390--- 391> #if !defined(NDEBUG) 392290a295 393> #endif // defined(SAFE_TO_DEFINE_TALK_BASE_LOGGING_MACROS) 394diff -r libjingle-0.4.0/talk/base/messagequeue.cc libjingle/files/talk/base/messagequeue.cc 39598,99c98,99 396< new_ss = true; 397< ss_ = new PhysicalSocketServer(); 398--- 399> default_ss_.reset(new PhysicalSocketServer()); 400> ss_ = default_ss_.get(); 401103a104,107 402> // The signal is done from here to ensure 403> // that it always gets called when the queue 404> // is going away. 405> SignalQueueDestroyed(); 406108,109d111 407< if (new_ss) 408< delete ss_; 409113,115d114 410< if (new_ss) 411< delete ss_; 412< new_ss = false; 413119c118 414< void MessageQueue::Stop() { 415--- 416> void MessageQueue::Quit() { 417124c123 418< bool MessageQueue::IsStopping() { 419--- 420> bool MessageQueue::IsQuitting() { 421diff -r libjingle-0.4.0/talk/base/messagequeue.h libjingle/files/talk/base/messagequeue.h 42235a36 423> #include "talk/base/scoped_ptr.h" 424162,164c163,164 425< 426< virtual void Stop(); 427< virtual bool IsStopping(); 428--- 429> virtual void Quit(); 430> virtual bool IsQuitting(); 431188a189,192 432> // When this signal is sent out, any references to this queue should 433> // no longer be used. 434> sigslot::signal0<> SignalQueueDestroyed; 435> 436192a197,198 437> // If a server isn't supplied in the constructor, use this one. 438> scoped_ptr<SocketServer> default_ss_; 439diff -r libjingle-0.4.0/talk/base/natserver.cc libjingle/files/talk/base/natserver.cc 44028a29 441> #include <cstring> 442diff -r libjingle-0.4.0/talk/base/natsocketfactory.cc libjingle/files/talk/base/natsocketfactory.cc 44329a30 444> #include <cstring> 445diff -r libjingle-0.4.0/talk/base/openssladapter.cc libjingle/files/talk/base/openssladapter.cc 446619c619 447< #ifdef _DEBUG 448--- 449> #if !defined(NDEBUG) 450707c707 451< #if _DEBUG 452--- 453> #if !defined(NDEBUG) 454736c736 455< #endif // _DEBUG 456--- 457> #endif // !defined(NDEBUG) 458740c740 459< #if _DEBUG 460--- 461> #if !defined(NDEBUG) 462798c798 463< #ifdef _DEBUG 464--- 465> #if !defined(NDEBUG) 466diff -r libjingle-0.4.0/talk/base/openssladapter.h libjingle/files/talk/base/openssladapter.h 46772c72 468< #if _DEBUG 469--- 470> #if !defined(NDEBUG) 47174c74 472< #endif // !_DEBUG 473--- 474> #endif // !defined(NDEBUG) 475diff -r libjingle-0.4.0/talk/base/physicalsocketserver.cc libjingle/files/talk/base/physicalsocketserver.cc 47661a62 477> #include "talk/base/winsock_initializer.h" 47867,86d67 479< #ifdef WIN32 480< class WinsockInitializer { 481< public: 482< WinsockInitializer() { 483< WSADATA wsaData; 484< WORD wVersionRequested = MAKEWORD(1, 0); 485< err_ = WSAStartup(wVersionRequested, &wsaData); 486< } 487< ~WinsockInitializer() { 488< WSACleanup(); 489< } 490< int error() { 491< return err_; 492< } 493< private: 494< int err_; 495< }; 496< WinsockInitializer g_winsockinit; 497< #endif 498< 499124a106,108 500> #ifdef WIN32 501> EnsureWinsockInit(); 502> #endif 503187c171,177 504< addr2.Resolve(); // TODO: Do this async later? 505--- 506> // TODO: Do this async later? 507> if (!addr2.Resolve()) { 508> LOG(LS_ERROR) << "Resolving addr failed"; 509> UpdateLastError(); 510> Close(); 511> return SOCKET_ERROR; 512> } 513265a256,259 514> LOG(LS_WARNING) << "EOF from socket; deferring close event"; 515> // Must turn this back on so that the select() loop will notice the close 516> // event. 517> enabled_events_ |= kfRead; 518402a397 519> virtual bool IsDescriptorClosed() = 0; 520452a448,451 521> virtual bool IsDescriptorClosed() { 522> return false; 523> } 524> 525490a490,497 526> virtual bool IsDescriptorClosed() { 527> // We don't have a reliable way of distinguishing end-of-stream 528> // from readability. So test on each readable call. Is this 529> // inefficient? Probably. 530> char ch; 531> return (0 == ::recv(s_, &ch, 1, MSG_PEEK)); 532> } 533> 534546a554,557 535> virtual bool IsDescriptorClosed() { 536> return false; 537> } 538> 539916c927,931 540< ff |= kfRead; 541--- 542> if (pdispatcher->IsDescriptorClosed()) { 543> ff |= kfClose; 544> } else { 545> ff |= kfRead; 546> } 547diff -r libjingle-0.4.0/talk/base/proxydetect.cc libjingle/files/talk/base/proxydetect.cc 548205,206c205,206 549< const char* list = slist.c_str(); 550< while (*list) { 551--- 552> const char* clist = slist.c_str(); 553> while (*clist) { 554208,209c208,209 555< if (isspace(*list)) { 556< ++list; 557--- 558> if (isspace(*clist)) { 559> ++clist; 560214,217c214,217 561< const char * start = list; 562< if (const char * end = strchr(list, sep)) { 563< len = (end - list); 564< list += len + 1; 565--- 566> const char * start = clist; 567> if (const char * end = strchr(clist, sep)) { 568> len = (end - clist); 569> clist += len + 1; 570219,220c219,220 571< len = strlen(list); 572< list += len; 573--- 574> len = strlen(clist); 575> clist += len; 576diff -r libjingle-0.4.0/talk/base/schanneladapter.cc libjingle/files/talk/base/schanneladapter.cc 577607c607 578< size_t read = min(cb, readable.size()); 579--- 580> size_t read = _min(cb, readable.size()); 581diff -r libjingle-0.4.0/talk/base/scoped_ptr.h libjingle/files/talk/base/scoped_ptr.h 58236,257c36 583< namespace talk_base { 584< 585< template <typename T> 586< class scoped_ptr { 587< private: 588< 589< T* ptr; 590< 591< scoped_ptr(scoped_ptr const &); 592< scoped_ptr & operator=(scoped_ptr const &); 593< 594< public: 595< 596< typedef T element_type; 597< 598< explicit scoped_ptr(T* p = 0): ptr(p) {} 599< 600< ~scoped_ptr() { 601< typedef char type_must_be_complete[sizeof(T)]; 602< delete ptr; 603< } 604< 605< void reset(T* p = 0) { 606< typedef char type_must_be_complete[sizeof(T)]; 607< 608< if (ptr != p) { 609< delete ptr; 610< ptr = p; 611< } 612< } 613< 614< T& operator*() const { 615< assert(ptr != 0); 616< return *ptr; 617< } 618< 619< T* operator->() const { 620< assert(ptr != 0); 621< return ptr; 622< } 623< 624< T* get() const { 625< return ptr; 626< } 627< 628< void swap(scoped_ptr & b) { 629< T* tmp = b.ptr; 630< b.ptr = ptr; 631< ptr = tmp; 632< } 633< 634< T* release() { 635< T* tmp = ptr; 636< ptr = 0; 637< return tmp; 638< } 639< 640< T** accept() { 641< if (ptr) { 642< delete ptr; 643< ptr = 0; 644< } 645< return &ptr; 646< } 647< 648< T** use() { 649< return &ptr; 650< } 651< }; 652< 653< template<typename T> inline 654< void swap(scoped_ptr<T>& a, scoped_ptr<T>& b) { 655< a.swap(b); 656< } 657< 658< 659< 660< 661< // scoped_array extends scoped_ptr to arrays. Deletion of the array pointed to 662< // is guaranteed, either on destruction of the scoped_array or via an explicit 663< // reset(). Use shared_array or std::vector if your needs are more complex. 664< 665< template<typename T> 666< class scoped_array { 667< private: 668< 669< T* ptr; 670< 671< scoped_array(scoped_array const &); 672< scoped_array & operator=(scoped_array const &); 673< 674< public: 675< 676< typedef T element_type; 677< 678< explicit scoped_array(T* p = 0) : ptr(p) {} 679< 680< ~scoped_array() { 681< typedef char type_must_be_complete[sizeof(T)]; 682< delete[] ptr; 683< } 684< 685< void reset(T* p = 0) { 686< typedef char type_must_be_complete[sizeof(T)]; 687< 688< if (ptr != p) { 689< delete [] ptr; 690< ptr = p; 691< } 692< } 693< 694< T& operator[](std::ptrdiff_t i) const { 695< assert(ptr != 0); 696< assert(i >= 0); 697< return ptr[i]; 698< } 699< 700< T* get() const { 701< return ptr; 702< } 703< 704< void swap(scoped_array & b) { 705< T* tmp = b.ptr; 706< b.ptr = ptr; 707< ptr = tmp; 708< } 709< 710< T* release() { 711< T* tmp = ptr; 712< ptr = 0; 713< return tmp; 714< } 715< 716< T** accept() { 717< if (ptr) { 718< delete [] ptr; 719< ptr = 0; 720< } 721< return &ptr; 722< } 723< }; 724< 725< template<class T> inline 726< void swap(scoped_array<T>& a, scoped_array<T>& b) { 727< a.swap(b); 728< } 729< 730< // scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a 731< // second template argument, the function used to free the object. 732< 733< template<typename T, void (*FF)(void*) = free> class scoped_ptr_malloc { 734< private: 735< 736< T* ptr; 737< 738< scoped_ptr_malloc(scoped_ptr_malloc const &); 739< scoped_ptr_malloc & operator=(scoped_ptr_malloc const &); 740< 741< public: 742< 743< typedef T element_type; 744< 745< explicit scoped_ptr_malloc(T* p = 0): ptr(p) {} 746< 747< ~scoped_ptr_malloc() { 748< typedef char type_must_be_complete[sizeof(T)]; 749< FF(static_cast<void*>(ptr)); 750< } 751< 752< void reset(T* p = 0) { 753< typedef char type_must_be_complete[sizeof(T)]; 754< 755< if (ptr != p) { 756< FF(static_cast<void*>(ptr)); 757< ptr = p; 758< } 759< } 760< 761< T& operator*() const { 762< assert(ptr != 0); 763< return *ptr; 764< } 765< 766< T* operator->() const { 767< assert(ptr != 0); 768< return ptr; 769< } 770< 771< T* get() const { 772< return ptr; 773< } 774< 775< void swap(scoped_ptr_malloc & b) { 776< T* tmp = b.ptr; 777< b.ptr = ptr; 778< ptr = tmp; 779< } 780< 781< T* release() { 782< T* tmp = ptr; 783< ptr = 0; 784< return tmp; 785< } 786< 787< T** accept() { 788< if (ptr) { 789< FF(static_cast<void*>(ptr)); 790< ptr = 0; 791< } 792< return &ptr; 793< } 794< }; 795< 796< template<typename T, void (*FF)(void*)> inline 797< void swap(scoped_ptr_malloc<T,FF>& a, scoped_ptr_malloc<T,FF>& b) { 798< a.swap(b); 799< } 800< 801< } // namespace talk_base 802< 803< // TODO: get rid of this global using 804< using talk_base::scoped_ptr; 805--- 806> #include "base/scoped_ptr.h" 807diff -r libjingle-0.4.0/talk/base/signalthread.cc libjingle/files/talk/base/signalthread.cc 80812a13,15 809> main_->SignalQueueDestroyed.connect(this, 810> &SignalThread::OnMainThreadDestroyed); 811> refcount_ = 1; 81215a19,23 813> void SignalThread::OnMainThreadDestroyed() { 814> EnterExit ee(this); 815> main_ = NULL; 816> } 817> 81819a28 819> EnterExit ee(this); 82025a35 821> EnterExit ee(this); 82227c37 823< if (kInit == state_) { 824--- 825> if (kInit == state_ || kComplete == state_) { 82636c46,47 827< void SignalThread::Destroy() { 828--- 829> void SignalThread::Destroy(bool wait) { 830> EnterExit ee(this); 83139,40c50,51 832< delete this; 833< } else if (kRunning == state_) { 834--- 835> refcount_--; 836> } else if (kRunning == state_ || kReleasing == state_) { 83742,47c53,63 838< // A couple tricky issues here: 839< // 1) Thread::Stop() calls Join(), which we don't want... we just want 840< // to stop the MessageQueue, which causes ContinueWork() to return false. 841< // 2) OnWorkStop() must follow Stop(), so that when the thread wakes up 842< // due to OWS(), ContinueWork() will return false. 843< worker_.MessageQueue::Stop(); 844--- 845> // OnWorkStop() must follow Quit(), so that when the thread wakes up due to 846> // OWS(), ContinueWork() will return false. 847> if (wait) { 848> // Release the thread's lock so that it can return from ::Run. 849> cs_.Leave(); 850> worker_.Stop(); 851> cs_.Enter(); 852> refcount_--; 853> } else { 854> worker_.Quit(); 855> } 85654a71 857> EnterExit ee(this); 85857c74 859< delete this; 860--- 861> refcount_--; 86266a84 863> EnterExit ee(this); 86471a90 865> EnterExit ee(this); 86681a101,111 867> // Before signaling that the work is done, make sure that the worker 868> // thread actually is done. We got here because DoWork() finished and 869> // Run() posted the ST_MSG_WORKER_DONE message. This means the worker 870> // thread is about to go away anyway, but sometimes it doesn't actually 871> // finish before SignalWorkDone is processed, and for a reusable 872> // SignalThread this makes an assert in thread.cc fire. 873> // 874> // Calling Stop() on the worker ensures that the OS thread that underlies 875> // the worker will finish, and will be set to NULL, enabling us to call 876> // Start() again. 877> worker_.Stop(); 87885c115 879< delete this; 880--- 881> refcount_--; 88292c122,127 883< main_->Post(this, ST_MSG_WORKER_DONE); 884--- 885> { 886> EnterExit ee(this); 887> if (main_) { 888> main_->Post(this, ST_MSG_WORKER_DONE); 889> } 890> } 891diff -r libjingle-0.4.0/talk/base/signalthread.h libjingle/files/talk/base/signalthread.h 89215a16,19 893> // Periodic tasks: Wait for SignalWorkDone, then eventually call Start() 894> // again to repeat the task. When the instance isn't needed anymore, 895> // call Release. DoWork, OnWorkStart and OnWorkStop are called again, 896> // on a new thread. 89722c26 898< class SignalThread : protected MessageHandler { 899--- 900> class SignalThread : public sigslot::has_slots<>, protected MessageHandler { 90135,36c39,41 902< // SignalWorkDone will not be signalled. 903< void Destroy(); 904--- 905> // SignalWorkDone will not be signalled. If wait is true, does not return 906> // until the thread is deleted. 907> void Destroy(bool wait); 90853c58 909< 910--- 911> 91257c62 913< // Context: Worker Thread. Subclass should call periodically to 914--- 915> // Context: Worker Thread. Subclass should call periodically to 91667c72 917< 918--- 919> 92079a85,106 921> class EnterExit { 922> friend class SignalThread; 923> 924> SignalThread * t_; 925> 926> EnterExit(SignalThread * t) : t_(t) { 927> t_->cs_.Enter(); 928> t_->refcount_ += 1; 929> } 930> ~EnterExit() { 931> bool d = (0 == (--(t_->refcount_))); 932> t_->cs_.Leave(); 933> if (d) 934> delete t_; 935> } 936> }; 937> 938> friend class EnterExit; 939> 940> CriticalSection cs_; 941> int refcount_; 942> 94380a108 944> void OnMainThreadDestroyed(); 94584c112,118 946< enum State { kInit, kRunning, kComplete, kStopping, kReleasing } state_; 947--- 948> enum State { 949> kInit, // Initialized, but not started 950> kRunning, // Started and doing work 951> kReleasing, // Same as running, but to be deleted when work is done 952> kComplete, // Work is done 953> kStopping, // Work is being interrupted 954> } state_; 955diff -r libjingle-0.4.0/talk/base/sigslot.h libjingle/files/talk/base/sigslot.h 956530c530 957< #ifdef _DEBUG 958--- 959> #if !defined(NDEBUG) 960676c676 961< #ifdef _DEBUG 962--- 963> #if !defined(NDEBUG) 964807c807 965< #ifdef _DEBUG 966--- 967> #if !defined(NDEBUG) 968937c937 969< #ifdef _DEBUG 970--- 971> #if !defined(NDEBUG) 9721067c1067 973< #ifdef _DEBUG 974--- 975> #if !defined(NDEBUG) 9761199c1199 977< #ifdef _DEBUG 978--- 979> #if !defined(NDEBUG) 9801331c1331 981< #ifdef _DEBUG 982--- 983> #if !defined(NDEBUG) 9841463c1463 985< #ifdef _DEBUG 986--- 987> #if !defined(NDEBUG) 9881596c1596 989< #ifdef _DEBUG 990--- 991> #if !defined(NDEBUG) 992diff -r libjingle-0.4.0/talk/base/socket.h libjingle/files/talk/base/socket.h 99377a78 994> #undef ETIMEDOUT // remove pthread.h's definition 995diff -r libjingle-0.4.0/talk/base/socketadapters.cc libjingle/files/talk/base/socketadapters.cc 99643a44,45 997> #include <cstring> 998> 999diff -r libjingle-0.4.0/talk/base/socketaddress.cc libjingle/files/talk/base/socketaddress.cc 100052c52 1001< #ifdef _DEBUG 1002--- 1003> #if !defined(NDEBUG) 100454c54 1005< #else // !_DEBUG 1006--- 1007> #else // defined(NDEBUG) 100856c56 1009< #endif // !_DEBUG 1010--- 1011> #endif // !defined(NDEBUG) 1012diff -r libjingle-0.4.0/talk/base/socketfactory.h libjingle/files/talk/base/socketfactory.h 101332a33 1014> #include "talk/base/ssladapter.h" 101546a48,52 1016> 1017> // Wraps the given socket in an SSL adapter. 1018> virtual SSLAdapter* CreateSSLAdapter(AsyncSocket* socket) { 1019> return SSLAdapter::Create(socket); 1020> } 1021diff -r libjingle-0.4.0/talk/base/socketpool.cc libjingle/files/talk/base/socketpool.cc 1022142d141 1023< ASSERT(false); 1024189d187 1025< ASSERT(false); 1026diff -r libjingle-0.4.0/talk/base/ssladapter.cc libjingle/files/talk/base/ssladapter.cc 102734c34,35 1028< #define SSL_USE_OPENSSL 1 1029--- 1030> // Turn off OpenSSL 1031> //#define SSL_USE_OPENSSL 1 103284a86 1033> #if SSL_USE_OPENSSL || SSL_USE_SCHANNEL 103485a88,90 1035> #else 1036> return NULL; 1037> #endif 1038diff -r libjingle-0.4.0/talk/base/stream.cc libjingle/files/talk/base/stream.cc 103927a28 1040> #include <stdio.h> 1041diff -r libjingle-0.4.0/talk/base/stringencode.cc libjingle/files/talk/base/stringencode.cc 104234a35 1043> #include <stdlib.h> 1044525c526 1045< #ifdef _DEBUG 1046--- 1047> #if !defined(NDEBUG) 1048575c576 1049< #endif // _DEBUG 1050--- 1051> #endif // !defined(NDEBUG) 1052diff -r libjingle-0.4.0/talk/base/stringutils.cc libjingle/files/talk/base/stringutils.cc 105372c72 1054< #if _DEBUG 1055--- 1056> #if !defined(NDEBUG) 105776c76 1058< #endif // _DEBUG 1059--- 1060> #endif // !defined(NDEBUG) 1061diff -r libjingle-0.4.0/talk/base/stringutils.h libjingle/files/talk/base/stringutils.h 106233a34 1063> #include <string.h> 106487a89 1065> #if 0 106693a96 1067> #endif 1068200,208d202 1069< size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) { 1070< va_list args; 1071< va_start(args, format); 1072< size_t len = vsprintfn(buffer, buflen, format, args); 1073< va_end(args); 1074< return len; 1075< } 1076< 1077< template<class CTYPE> 1078218a213,221 1079> template<class CTYPE> 1080> size_t sprintfn(CTYPE* buffer, size_t buflen, const CTYPE* format, ...) { 1081> va_list args; 1082> va_start(args, format); 1083> size_t len = vsprintfn(buffer, buflen, format, args); 1084> va_end(args); 1085> return len; 1086> } 1087> 1088272c275 1089< inline static const char* Traits<char>::empty_str() { return ""; } 1090--- 1091> inline static const char* empty_str() { return ""; } 1092diff -r libjingle-0.4.0/talk/base/task.cc libjingle/files/talk/base/task.cc 10935c5 1094< * Redistribution and use in source and binary forms, with or without 1095--- 1096> * Redistribution and use in source and binary forms, with or without 10978c8 1098< * 1. Redistributions of source code must retain the above copyright notice, 1099--- 1100> * 1. Redistributions of source code must retain the above copyright notice, 110113c13 1102< * 3. The name of the author may not be used to endorse or promote products 1103--- 1104> * 3. The name of the author may not be used to endorse or promote products 110517c17 1106< * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1107--- 1108> * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 110919c19 1110< * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1111--- 1112> * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 111323,24c23,24 1114< * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 1115< * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1116--- 1117> * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 1118> * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1119141c141 1120< if (aborted_ || done_) 1121--- 1122> if (done_) 1123150c150 1124< Wake(); // to self-delete 1125--- 1126> GetRunner()->WakeTasks(); 1127diff -r libjingle-0.4.0/talk/base/taskrunner.h libjingle/files/talk/base/taskrunner.h 112863a64,68 1129> bool HasPendingTimeoutTask() { 1130> return next_timeout_task_ != NULL && 1131> next_timeout_task_->TimedOut(); 1132> } 1133> 1134diff -r libjingle-0.4.0/talk/base/testclient.cc libjingle/files/talk/base/testclient.cc 113529a30 1136> #include <cstring> 1137diff -r libjingle-0.4.0/talk/base/thread.cc libjingle/files/talk/base/thread.cc 1138100a101,105 1139> bool ThreadManager::ThreadActive(Thread *thread) { 1140> CritScope cs(&crit_); 1141> return(std::find(threads_.begin(), threads_.end(), thread) != threads_.end()); 1142> } 1143> 1144103a109 1145> stopped_ = false; 1146124,125c130,135 1147< pthread_create(&thread_, &attr, PreRun, this); 1148< started_ = true; 1149--- 1150> CritScope cs(&started_crit_); 1151> // Make sure Join() hasn't been called yet. 1152> if (stopped_) 1153> return; 1154> if (pthread_create(&thread_, &attr, PreRun, this) == 0) 1155> started_ = true; 1156128a139,140 1157> CritScope cs(&started_crit_); 1158> stopped_ = true; 1159131a144 1160> started_ = false; 1161168a182,185 1162> CritScope cs(&started_crit_); 1163> // Make sure Join() hasn't been called yet. 1164> if (stopped_) 1165> return; 1166181a199,200 1167> CritScope cs(&started_crit_); 1168> stopped_ = true; 1169191a211,213 1170> // Make sure the thread hasn't been deleted. 1171> if (!g_thmgr.ThreadActive(thread)) 1172> return NULL; 1173207c229 1174< MessageQueue::Stop(); 1175--- 1176> MessageQueue::Quit(); 1177329c351 1178< return false; 1179--- 1180> return !IsQuitting(); 1181diff -r libjingle-0.4.0/talk/base/thread.h libjingle/files/talk/base/thread.h 118257a58 1183> bool ThreadActive(Thread *thread); 1184134a136 1185> CriticalSection started_crit_; 1186135a138 1187> bool stopped_; 1188diff -r libjingle-0.4.0/talk/base/urlencode.cc libjingle/files/talk/base/urlencode.cc 11890a1,2 1190> #include <stdlib.h> 1191> #include <string.h> 1192Only in libjingle-0.4.0/talk/base: win32socketserver.cc 1193Only in libjingle-0.4.0/talk/base: win32socketserver.h 1194Only in libjingle/files/talk/base: win32window.cc 1195diff -r libjingle-0.4.0/talk/base/winping.cc libjingle/files/talk/base/winping.cc 1196133c133 1197< return sizeof(ICMP_ECHO_REPLY) + max(8UL, data_size); 1198--- 1199> return sizeof(ICMP_ECHO_REPLY) + _max((uint32)(8UL), data_size); 1200317c317 1201< } // namespace talk_base 1202\ No newline at end of file 1203--- 1204> } // namespace talk_base 1205Only in libjingle/files/talk/base: winsock_initializer.cc 1206Only in libjingle/files/talk/base: winsock_initializer.h 1207Only in libjingle-0.4.0/talk: examples 1208Only in libjingle-0.4.0/talk: libjingle.sln 1209Only in libjingle-0.4.0/talk: libjingle.vcproj 1210Only in libjingle-0.4.0/talk: p2p 1211Only in libjingle-0.4.0/talk: session 1212Only in libjingle-0.4.0/talk: third_party 1213Only in libjingle-0.4.0/talk/xmllite: Makefile.in 1214diff -r libjingle-0.4.0/talk/xmllite/qname.cc libjingle/files/talk/xmllite/qname.cc 121539c39 1216< int result = ns.size() * 101; 1217--- 1218> int result = static_cast<int>(ns.size()) * 101; 1219diff -r libjingle-0.4.0/talk/xmllite/qname.h libjingle/files/talk/xmllite/qname.h 122064d63 1221< refcount_(1), 122266c65,66 1223< localPart_(local) {} 1224--- 1225> localPart_(local), 1226> refcount_(1) {} 1227diff -r libjingle-0.4.0/talk/xmllite/xmlelement.cc libjingle/files/talk/xmllite/xmlelement.cc 122888c88,89 1229< pLastChild_(NULL) { 1230--- 1231> pLastChild_(NULL), 1232> cdata_(false) { 123397c98,99 1234< pLastChild_(NULL) { 1235--- 1236> pLastChild_(NULL), 1237> cdata_(false) { 1238125a128 1239> cdata_ = elt.cdata_; 1240133c136,137 1241< pLastChild_(NULL) { 1242--- 1243> pLastChild_(NULL), 1244> cdata_(false) { 1245393a398,403 1246> XmlElement::AddCDATAText(const char * buf, int len) { 1247> cdata_ = true; 1248> AddParsedText(buf, len); 1249> } 1250> 1251> void 1252diff -r libjingle-0.4.0/talk/xmllite/xmlelement.h libjingle/files/talk/xmllite/xmlelement.h 1253203a204,206 1254> // Note: CDATA is not supported by XMPP, therefore using this function will 1255> // generate non-XMPP compatible XML. 1256> void AddCDATAText(const char * buf, int len); 1257217a221,222 1258> bool IsCDATA() const { return cdata_; } 1259> 1260228a234 1261> bool cdata_; 1262diff -r libjingle-0.4.0/talk/xmllite/xmlparser.cc libjingle/files/talk/xmllite/xmlparser.cc 126328,29d27 1264< #include "talk/xmllite/xmlparser.h" 1265< 126635a34 1267> #include "talk/xmllite/xmlconstants.h" 126838c37 1269< #include "talk/xmllite/xmlconstants.h" 1270--- 1271> #include "talk/xmllite/xmlparser.h" 1272119a119,121 1273> context_.SetPosition(XML_GetCurrentLineNumber(expat_), 1274> XML_GetCurrentColumnNumber(expat_), 1275> XML_GetCurrentByteIndex(expat_)); 1276127a130,132 1277> context_.SetPosition(XML_GetCurrentLineNumber(expat_), 1278> XML_GetCurrentColumnNumber(expat_), 1279> XML_GetCurrentByteIndex(expat_)); 1280134a140,142 1281> context_.SetPosition(XML_GetCurrentLineNumber(expat_), 1282> XML_GetCurrentColumnNumber(expat_), 1283> XML_GetCurrentByteIndex(expat_)); 1284168c176,180 1285< if (XML_Parse(expat_, data, static_cast<int>(len), isFinal) != XML_STATUS_OK) 1286--- 1287> if (XML_Parse(expat_, data, static_cast<int>(len), isFinal) != 1288> XML_STATUS_OK) { 1289> context_.SetPosition(XML_GetCurrentLineNumber(expat_), 1290> XML_GetCurrentColumnNumber(expat_), 1291> XML_GetCurrentByteIndex(expat_)); 1292169a182 1293> } 1294193c206,209 1295< raised_(XML_ERROR_NONE) { 1296--- 1297> raised_(XML_ERROR_NONE), 1298> line_number_(0), 1299> column_number_(0), 1300> byte_index_(0) { 1301247c263,285 1302< XmlParser::ParseContext::~ParseContext() { 1303--- 1304> void 1305> XmlParser::ParseContext::SetPosition(XML_Size line, XML_Size column, 1306> XML_Index byte_index) { 1307> line_number_ = line; 1308> column_number_ = column; 1309> byte_index_ = byte_index; 1310> } 1311> 1312> void 1313> XmlParser::ParseContext::GetPosition(unsigned long * line, 1314> unsigned long * column, 1315> unsigned long * byte_index) { 1316> if (line != NULL) { 1317> *line = static_cast<unsigned long>(line_number_); 1318> } 1319> 1320> if (column != NULL) { 1321> *column = static_cast<unsigned long>(column_number_); 1322> } 1323> 1324> if (byte_index != NULL) { 1325> *byte_index = static_cast<unsigned long>(byte_index_); 1326> } 1327249a288 1328> XmlParser::ParseContext::~ParseContext() { 1329251a291 1330> } 1331diff -r libjingle-0.4.0/talk/xmllite/xmlparser.h libjingle/files/talk/xmllite/xmlparser.h 133248a49,50 1333> virtual void GetPosition(unsigned long * line, unsigned long * column, 1334> unsigned long * byte_index) = 0; 133585a88,89 1336> virtual void GetPosition(unsigned long * line, unsigned long * column, 1337> unsigned long * byte_index); 133891a96 1339> void SetPosition(XML_Size line, XML_Size column, XML_Index byte_index); 134096a102,104 1341> XML_Size line_number_; 1342> XML_Size column_number_; 1343> XML_Index byte_index_; 1344diff -r libjingle-0.4.0/talk/xmllite/xmlprinter.cc libjingle/files/talk/xmllite/xmlprinter.cc 134546a47 1346> void PrintCDATAText(const std::string & text); 1347134,136c135,141 1348< if (pchild->IsText()) 1349< PrintBodyText(pchild->AsText()->Text()); 1350< else 1351--- 1352> if (pchild->IsText()) { 1353> if (element->IsCDATA()) { 1354> PrintCDATAText(pchild->AsText()->Text()); 1355> } else { 1356> PrintBodyText(pchild->AsText()->Text()); 1357> } 1358> } else 1359188a194,197 1360> void 1361> XmlPrinterImpl::PrintCDATAText(const std::string & text) { 1362> *pout_ << "<![CDATA[" << text << "]]>"; 1363> } 1364Only in libjingle-0.4.0/talk/xmpp: Makefile.in 1365Only in libjingle-0.4.0/talk/xmpp: constants.cc 1366Only in libjingle-0.4.0/talk/xmpp: constants.h 1367diff -r libjingle-0.4.0/talk/xmpp/jid.cc libjingle/files/talk/xmpp/jid.cc 136833c33 1369< #include "talk/xmpp/constants.h" 1370--- 1371> #include "talk/xmpp/xmppconstants.h" 1372diff -r libjingle-0.4.0/talk/xmpp/plainsaslhandler.h libjingle/files/talk/xmpp/plainsaslhandler.h 137331d30 1374< #include "talk/xmpp/saslhandler.h" 137532a32,34 1376> #include <string> 1377> 1378> #include "talk/xmpp/saslhandler.h" 137968a71,76 1380> 1381> virtual bool GetTlsServerInfo(const talk_base::SocketAddress& server, 1382> std::string* tls_server_hostname, 1383> std::string* tls_server_domain) { 1384> return false; 1385> } 1386diff -r libjingle-0.4.0/talk/xmpp/prexmppauth.h libjingle/files/talk/xmpp/prexmppauth.h 138733d32 1388< #include "talk/xmpp/saslhandler.h" 138964c63 1390< class PreXmppAuth : public SaslHandler { 1391--- 1392> class PreXmppAuth { 1393diff -r libjingle-0.4.0/talk/xmpp/saslcookiemechanism.h libjingle/files/talk/xmpp/saslcookiemechanism.h 139433c33 1395< #include "talk/xmpp/constants.h" 1396--- 1397> #include "talk/xmpp/xmppconstants.h" 139840,41c40,55 1399< SaslCookieMechanism(const std::string & mechanism, const std::string & username, const std::string & cookie) : 1400< mechanism_(mechanism), username_(username), cookie_(cookie) {} 1401--- 1402> SaslCookieMechanism(const std::string & mechanism, 1403> const std::string & username, 1404> const std::string & cookie, 1405> const std::string & token_service) 1406> : mechanism_(mechanism), 1407> username_(username), 1408> cookie_(cookie), 1409> token_service_(token_service) {} 1410> 1411> SaslCookieMechanism(const std::string & mechanism, 1412> const std::string & username, 1413> const std::string & cookie) 1414> : mechanism_(mechanism), 1415> username_(username), 1416> cookie_(cookie), 1417> token_service_("") {} 141848a63,67 1419> if (!token_service_.empty()) { 1420> el->AddAttr( 1421> QName(true, "http://www.google.com/talk/protocol/auth", "service"), 1422> token_service_); 1423> } 142462a82 1425> std::string token_service_; 1426diff -r libjingle-0.4.0/talk/xmpp/saslhandler.h libjingle/files/talk/xmpp/saslhandler.h 142731a32,34 1428> #include <vector> 1429> 1430> #include "talk/base/socketaddress.h" 143153a57,63 1432> 1433> // Fills in the tls server hostname/domain to use for the given 1434> // server (and returns true). Return false if you want the defaults 1435> // to be used. 1436> virtual bool GetTlsServerInfo(const talk_base::SocketAddress& server, 1437> std::string* tls_server_hostname, 1438> std::string* tls_server_domain) = 0; 1439diff -r libjingle-0.4.0/talk/xmpp/saslmechanism.cc libjingle/files/talk/xmpp/saslmechanism.cc 144030c30 1441< #include "talk/xmpp/constants.h" 1442--- 1443> #include "talk/xmpp/xmppconstants.h" 1444diff -r libjingle-0.4.0/talk/xmpp/xmppclient.cc libjingle/files/talk/xmpp/xmppclient.cc 144530c30 1446< #include "talk/xmpp/constants.h" 1447--- 1448> #include "talk/xmpp/xmppconstants.h" 144932a33 1450> #include "talk/xmpp/saslhandler.h" 145168a70 1452> scoped_ptr<SaslHandler> sasl_handler_; 145393c95,99 1454< XmppClient::Connect(const XmppClientSettings & settings, const std::string & lang, AsyncSocket * socket, PreXmppAuth * pre_auth) { 1455--- 1456> XmppClient::Connect(const XmppClientSettings & settings, 1457> const std::string & lang, 1458> AsyncSocket * socket, 1459> PreXmppAuth * pre_auth, 1460> SaslHandler * sasl_handler) { 1461113,125c119,125 1462< // 1463< // The talk.google.com server expects you to use "gmail.com" in the 1464< // stream, and expects the domain certificate to be "gmail.com" as well. 1465< // For all other servers, we leave the strings empty, which causes 1466< // the jid's domain to be used. "foo@example.com" -> stream to="example.com" 1467< // tls certificate for "example.com" 1468< // 1469< // This is only true when using Gaia auth, so let's say if there's no preauth, 1470< // we should use the actual server name 1471< if ((settings.server().IPAsString() == buzz::STR_TALK_GOOGLE_COM || 1472< settings.server().IPAsString() == buzz::STR_TALKX_L_GOOGLE_COM) && 1473< pre_auth != NULL) { 1474< d_->engine_->SetTlsServer(buzz::STR_GMAIL_COM, buzz::STR_GMAIL_COM); 1475--- 1476> if (sasl_handler) { 1477> std::string tls_server_hostname, tls_server_domain; 1478> if (sasl_handler->GetTlsServerInfo(settings.server(), 1479> &tls_server_hostname, 1480> &tls_server_domain)) { 1481> d_->engine_->SetTlsServer(tls_server_hostname, tls_server_domain); 1482> } 1483139a140 1484> d_->sasl_handler_.reset(sasl_handler); 1485200a202,209 1486> if (d_->sasl_handler_.get()) { 1487> d_->engine_->SetSaslHandler(d_->sasl_handler_.release()); 1488> } 1489> else { 1490> d_->engine_->SetSaslHandler(new PlainSaslHandler( 1491> d_->engine_->GetUser(), d_->pass_, d_->allow_plain_)); 1492> } 1493> 1494209,210d217 1495< d_->engine_->SetSaslHandler(new PlainSaslHandler( 1496< d_->engine_->GetUser(), d_->pass_, d_->allow_plain_)); 1497253,254d259 1498< // transfer ownership of pre_auth_ to engine 1499< d_->engine_->SetSaslHandler(d_->pre_auth_.release()); 1500261a267,268 1501> d_->pre_engine_error_ = XmppEngine::ERROR_SOCKET; 1502> d_->pre_engine_subcode_ = d_->socket_->GetError(); 1503347c354 1504< //#ifdef _DEBUG 1505--- 1506> //#if !defined(NDEBUG) 1507375c382 1508< //#ifdef _DEBUG 1509--- 1510> //#if !defined(NDEBUG) 1511diff -r libjingle-0.4.0/talk/xmpp/xmppclient.h libjingle/files/talk/xmpp/xmppclient.h 151242a43 1513> class SaslHandler; 151480c81,82 1515< PreXmppAuth * preauth); 1516--- 1517> PreXmppAuth * preauth, 1518> SaslHandler * sasl_handler); 1519141c143 1520< std::string XmppClient::GetStateName(int state) const { 1521--- 1522> std::string GetStateName(int state) const { 1523diff -r libjingle-0.4.0/talk/xmpp/xmppclientsettings.h libjingle/files/talk/xmpp/xmppclientsettings.h 152431d30 1525< #include "talk/p2p/base/port.h" 152632a32,45 1527> #include "talk/base/proxyinfo.h" 1528> 1529> namespace cricket { 1530> 1531> // This enum was taken from talk/p2p/base/port.h, which is the only 1532> // thing we actually need from the p2p directory. 1533> enum ProtocolType { 1534> PROTO_UDP, 1535> PROTO_TCP, 1536> PROTO_SSLTCP, 1537> PROTO_LAST = PROTO_SSLTCP 1538> }; 1539> 1540> } // namespace cricket 154159a73,75 1542> void set_token_service(const std::string & token_service) { 1543> token_service_ = token_service; 1544> } 154575a92 1546> const std::string & token_service() const { return token_service_; } 154793a111 1548> std::string token_service_; 1549Only in libjingle/files/talk/xmpp: xmppconstants.cc 1550Only in libjingle/files/talk/xmpp: xmppconstants.h 1551diff -r libjingle-0.4.0/talk/xmpp/xmppengineimpl.cc libjingle/files/talk/xmpp/xmppengineimpl.cc 155237c37 1553< #include "talk/xmpp/constants.h" 1554--- 1555> #include "talk/xmpp/xmppconstants.h" 1556diff -r libjingle-0.4.0/talk/xmpp/xmppengineimpl_iq.cc libjingle/files/talk/xmpp/xmppengineimpl_iq.cc 155732c32 1558< #include "talk/xmpp/constants.h" 1559--- 1560> #include "talk/xmpp/xmppconstants.h" 1561diff -r libjingle-0.4.0/talk/xmpp/xmpplogintask.cc libjingle/files/talk/xmpp/xmpplogintask.cc 156234c34 1563< #include "talk/xmpp/constants.h" 1564--- 1565> #include "talk/xmpp/xmppconstants.h" 156644c44 1567< #ifdef _DEBUG 1568--- 1569> #if !defined(NDEBUG) 157059c59 1571< #endif // _DEBUG 1572--- 1573> #endif // !defined(NDEBUG) 1574103c103 1575< #if _DEBUG 1576--- 1577> #if !defined(NDEBUG) 1578106c106 1579< #endif // _DEBUG 1580--- 1581> #endif // !defined(NDEBUG) 1582218a219,221 1583> auth->SetAttr(QN_GOOGLE_ALLOW_GENERATED_JID_XMPP_LOGIN, "true"); 1584> auth->SetAttr(QN_GOOGLE_AUTH_CLIENT_USES_FULL_BIND_RESULT, "true"); 1585> 1586diff -r libjingle-0.4.0/talk/xmpp/xmpplogintask.h libjingle/files/talk/xmpp/xmpplogintask.h 158793c93 1588< #ifdef _DEBUG 1589--- 1590> #if !defined(NDEBUG) 159195c95 1592< #endif // _DEBUG 1593--- 1594> #endif // !defined(NDEBUG) 1595diff -r libjingle-0.4.0/talk/xmpp/xmppstanzaparser.cc libjingle/files/talk/xmpp/xmppstanzaparser.cc 159632c32 1597< #include "talk/xmpp/constants.h" 1598--- 1599> #include "talk/xmpp/xmppconstants.h" 1600diff -r libjingle-0.4.0/talk/xmpp/xmpptask.cc libjingle/files/talk/xmpp/xmpptask.cc 160131c31 1602< #include "talk/xmpp/constants.h" 1603--- 1604> #include "talk/xmpp/xmppconstants.h" 160540c40 1606< #ifdef _DEBUG 1607--- 1608> #if !defined(NDEBUG) 160988c88 1610< #ifdef _DEBUG 1611--- 1612> #if !defined(NDEBUG) 1613174c174 1614< } 1615\ No newline at end of file 1616--- 1617> } 1618diff -r libjingle-0.4.0/talk/xmpp/xmpptask.h libjingle/files/talk/xmpp/xmpptask.h 161980c80 1620< #ifdef _DEBUG 1621--- 1622> #if !defined(NDEBUG) 1623106,107c106,107 1624< XmlElement *MakeIqResult(const XmlElement* query); 1625< XmlElement *MakeIq(const std::string& type, 1626--- 1627> static XmlElement *MakeIqResult(const XmlElement* query); 1628> static XmlElement *MakeIq(const std::string& type, 1629123c123 1630< #ifdef _DEBUG 1631--- 1632> #if !defined(NDEBUG) 1633diff -r libjingle-0.4.0/talk/base/common.cc libjingle/files/talk/base/common.cc 163462c62 1635< } // namespace talk_base 1636\ No newline at end of file 1637--- 1638> } // namespace talk_base 1639diff -r libjingle-0.4.0/talk/base/httpbase.cc libjingle/files/talk/base/httpbase.cc 1640154c154 1641< if (sscanf(value, "%d", &data_size_) != 1) { 1642--- 1643> if (sscanf(value, "%zu", &data_size_) != 1) { 1644diff -r libjingle-0.4.0/talk/base/httpcommon.cc libjingle/files/talk/base/httpcommon.cc 1645339c339 1646< &tval.tm_hour, &tval.tm_min, &tval.tm_sec, &zone)) { 1647--- 1648> &tval.tm_hour, &tval.tm_min, &tval.tm_sec, zone)) { 1649472c472 1650< uint32 vmajor, vminor; 1651--- 1652> unsigned long vmajor, vminor; 1653549,550c549,550 1654< uint32 vmajor, vminor; 1655< if ((sscanf(line, "HTTP/%lu.%lu %lu%n", &vmajor, &vminor, &scode, &pos) != 3) 1656--- 1657> unsigned long vmajor, vminor; 1658> if ((sscanf(line, "HTTP/%lu.%lu %lu%zu", &vmajor, &vminor, &scode, &pos) != 3) 1659693c693 1660< sprintf(buffer, "%d", time(0)); 1661--- 1662> sprintf(buffer, "%ld", time(0)); 1663diff -r libjingle-0.4.0/talk/base/httpcommon.h libjingle/files/talk/base/httpcommon.h 1664329c329 1665< uint32 scode; 1666--- 1667> unsigned long scode; 1668diff -r libjingle-0.4.0/talk/base/diskcache.cc libjingle/files/talk/base/diskcache.cc 1669300c300 1670< if (1 != sscanf(pathname.extension().c_str(), ".%u", index)) 1671--- 1672> if (1 != sscanf(pathname.extension().c_str(), ".%zu", index)) 1673diff -r libjingle-0.4.0/talk/base/logging.cc libjingle/files/talk/base/logging.cc 167469c69 1675< snprintf(buffer, sizeof(buffer), "0x%08lx", err); 1676--- 1677> snprintf(buffer, sizeof(buffer), "0x%08x", err); 1678diff -r libjingle-0.4.0/talk/base/socketadapters.cc libjingle/files/talk/base/socketadapters.cc 1679360,361c360,361 1680< uint32 code; 1681< if (sscanf(data, "HTTP/%*lu.%*lu %lu", &code) != 1) { 1682--- 1683> unsigned long code; 1684> if (sscanf(data, "HTTP/%*u.%*u %lu", &code) != 1) { 1685