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