Update libjingle to 50191337.
R=mallinath@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/1885005
git-svn-id: http://webrtc.googlecode.com/svn/trunk@4461 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/talk/base/host.cc b/talk/base/host.cc
deleted file mode 100644
index 7decc49..0000000
--- a/talk/base/host.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * libjingle
- * Copyright 2004--2005, Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "talk/base/host.h"
-
-#ifdef POSIX
-#include <sys/utsname.h>
-#endif // POSIX
-
-#include <string>
-
-namespace talk_base {
-
-std::string GetHostName() {
- // TODO: fix or get rid of this
-#if 0
- struct utsname nm;
- if (uname(&nm) < 0)
- FatalError("uname", LAST_SYSTEM_ERROR);
- return std::string(nm.nodename);
-#endif
- return "cricket";
-}
-
-} // namespace talk_base
diff --git a/talk/base/host.h b/talk/base/host.h
deleted file mode 100644
index 8528240..0000000
--- a/talk/base/host.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * libjingle
- * Copyright 2004--2005, Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef TALK_BASE_HOST_H_
-#define TALK_BASE_HOST_H_
-
-#include <string>
-
-namespace talk_base {
-
-// Returns the name of the local host.
-std::string GetHostName();
-
-} // namespace talk_base
-
-#endif // TALK_BASE_HOST_H_
diff --git a/talk/base/host_unittest.cc b/talk/base/host_unittest.cc
deleted file mode 100644
index aba87af..0000000
--- a/talk/base/host_unittest.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * libjingle
- * Copyright 2004--2011, Google Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
- * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "talk/base/gunit.h"
-#include "talk/base/host.h"
-
-TEST(Host, GetHostName) {
- EXPECT_NE("", talk_base::GetHostName());
-}
diff --git a/talk/base/httpcommon.cc b/talk/base/httpcommon.cc
index 458f2f9..ec7ffd2 100644
--- a/talk/base/httpcommon.cc
+++ b/talk/base/httpcommon.cc
@@ -528,11 +528,14 @@
HttpError
HttpRequestData::parseLeader(const char* line, size_t len) {
- UNUSED(len);
unsigned int vmajor, vminor;
int vend, dstart, dend;
- if ((sscanf(line, "%*s%n %n%*s%n HTTP/%u.%u", &vend, &dstart, &dend,
- &vmajor, &vminor) != 2)
+ // sscanf isn't safe with strings that aren't null-terminated, and there is
+ // no guarantee that |line| is. Create a local copy that is null-terminated.
+ std::string line_str(line, len);
+ line = line_str.c_str();
+ if ((sscanf(line, "%*s%n %n%*s%n HTTP/%u.%u",
+ &vend, &dstart, &dend, &vmajor, &vminor) != 2)
|| (vmajor != 1)) {
return HE_PROTOCOL;
}
@@ -649,6 +652,10 @@
size_t pos = 0;
unsigned int vmajor, vminor, temp_scode;
int temp_pos;
+ // sscanf isn't safe with strings that aren't null-terminated, and there is
+ // no guarantee that |line| is. Create a local copy that is null-terminated.
+ std::string line_str(line, len);
+ line = line_str.c_str();
if (sscanf(line, "HTTP %u%n",
&temp_scode, &temp_pos) == 1) {
// This server's response has no version. :( NOTE: This happens for every
diff --git a/talk/base/nat_unittest.cc b/talk/base/nat_unittest.cc
index 03170ca..9771235 100644
--- a/talk/base/nat_unittest.cc
+++ b/talk/base/nat_unittest.cc
@@ -28,7 +28,6 @@
#include <string>
#include "talk/base/gunit.h"
-#include "talk/base/host.h"
#include "talk/base/logging.h"
#include "talk/base/natserver.h"
#include "talk/base/natsocketfactory.h"
diff --git a/talk/base/network.cc b/talk/base/network.cc
index 9351b87..d6367c3 100644
--- a/talk/base/network.cc
+++ b/talk/base/network.cc
@@ -53,7 +53,6 @@
#include <algorithm>
#include <cstdio>
-#include "talk/base/host.h"
#include "talk/base/logging.h"
#include "talk/base/scoped_ptr.h"
#include "talk/base/socket.h" // includes something that makes windows happy
@@ -174,8 +173,7 @@
}
BasicNetworkManager::BasicNetworkManager()
- : thread_(NULL),
- start_count_(0) {
+ : thread_(NULL), sent_first_update_(false), start_count_(0) {
}
BasicNetworkManager::~BasicNetworkManager() {
diff --git a/talk/base/testclient_unittest.cc b/talk/base/testclient_unittest.cc
index 1269236..c1411f0 100644
--- a/talk/base/testclient_unittest.cc
+++ b/talk/base/testclient_unittest.cc
@@ -26,7 +26,6 @@
*/
#include "talk/base/gunit.h"
-#include "talk/base/host.h"
#include "talk/base/nethelpers.h"
#include "talk/base/physicalsocketserver.h"
#include "talk/base/testclient.h"
diff --git a/talk/base/thread_unittest.cc b/talk/base/thread_unittest.cc
index 11b493d..246faa4 100644
--- a/talk/base/thread_unittest.cc
+++ b/talk/base/thread_unittest.cc
@@ -28,7 +28,6 @@
#include "talk/base/asyncudpsocket.h"
#include "talk/base/event.h"
#include "talk/base/gunit.h"
-#include "talk/base/host.h"
#include "talk/base/physicalsocketserver.h"
#include "talk/base/socketaddress.h"
#include "talk/base/thread.h"