/pidgin/main: cae91a875b23: Merge release-2.x.y

Tomasz Wasilczyk twasilczyk at pidgin.im
Thu Apr 3 10:02:45 EDT 2014


Changeset: cae91a875b235bf9d3b293b3edc3e80b81089054
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-03 16:02 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/cae91a875b23

Description:

Merge release-2.x.y

diffstat:

 COPYRIGHT                               |      3 +
 ChangeLog                               |      4 +
 configure.ac                            |      2 +-
 libpurple/internal.h                    |      3 +
 libpurple/protocols/gg/lib/common.c     |     26 +-
 libpurple/protocols/gg/lib/dcc7.c       |      5 +-
 libpurple/protocols/gg/lib/events.c     |     15 +-
 libpurple/protocols/gg/lib/handlers.c   |      6 +-
 libpurple/protocols/gg/lib/internal.h   |     14 +-
 libpurple/protocols/gg/lib/libgadu.h    |      2 +-
 libpurple/protocols/gg/lib/network.h    |      2 +
 libpurple/protocols/gg/lib/protobuf-c.c |     12 +-
 libpurple/protocols/gg/lib/resolver.c   |     15 +-
 libpurple/protocols/gg/lib/sha1.c       |     16 +-
 libpurple/protocols/yahoo/libymsg.h     |      2 +-
 libpurple/win32/wpurpleerror.h          |      2 +
 pidgin/gtkdialogs.c                     |      8 +-
 po/de.po                                |    312 +-
 po/lv.po                                |  19813 ++++++++++++++++++++++++++++++
 po/tt.po                                |  19755 +++++++++++++++++++++++++++++
 20 files changed, 39819 insertions(+), 198 deletions(-)

diffs (truncated from 40438 to 300 lines):

diff --git a/COPYRIGHT b/COPYRIGHT
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -340,6 +340,7 @@ John Matthews
 Simo Mattila
 Robert Matusewicz
 Michal Matyska
+Rudolfs Mazurs
 Ryan McCabe
 Peter McCurdy
 Kurt McKee
@@ -568,6 +569,8 @@ Max Ulidtko
 Dmitry Utkin
 Igor Vlasenko
 István Váradi
+ILDAR Valeev
+Cédric Valmary
 Martijn van Beers
 Gideon van Melle
 Arjan van de Ven
diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,10 @@ version 2.10.10 (?/?/?):
 	Gadu-Gadu:
 	* Updated internal libgadu to version 1.12.0-rc2.
 
+	Windows-Specific Changes:
+	* Updates to dependencies:
+		* NSS 3.16 and NSPR 4.10.4
+
 version 2.10.9 (2/2/2014):
 	XMPP:
 	* Fix problems logging into some servers including jabber.org and
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -305,7 +305,7 @@ if test x$enable_i18n = xyes; then
 	GETTEXT_PACKAGE=pidgin
 	AC_SUBST(GETTEXT_PACKAGE)
 
-	ALL_LINGUAS="af am ar ast az be at latin bg bn bn_IN bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ku lt mai mhr mk mn mr my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr at latin sv sw ta te th tr uk ur vi xh zh_CN zh_HK zh_TW"
+	ALL_LINGUAS="af am ar ast az be at latin bg bn bn_IN bs ca ca at valencia cs da de dz el en_AU en_CA en_GB eo es et eu fa fi fr ga gl gu he hi hr hu id it ja ka kk km kn ko ku lt lv mai mhr mk mn mr my_MM nb ne nl nn oc or pa pl pt_BR pt ps ro ru si sk sl sq sr sr at latin sv sw ta te th tr tt uk ur vi xh zh_CN zh_HK zh_TW"
 	AM_GLIB_GNU_GETTEXT
 
 	dnl If we don't have msgfmt, then po/ is going to fail -- ensure that
diff --git a/libpurple/internal.h b/libpurple/internal.h
--- a/libpurple/internal.h
+++ b/libpurple/internal.h
@@ -49,6 +49,9 @@
  */
 #ifdef ENABLE_NLS
 #  include <locale.h>
+#  ifndef __APPLE_CC__
+#    define __APPLE_CC__ 0
+#  endif
 #  include <libintl.h>
 #  undef printf
 #  define _(String) ((const char *)dgettext(PACKAGE, String))
diff --git a/libpurple/protocols/gg/lib/common.c b/libpurple/protocols/gg/lib/common.c
--- a/libpurple/protocols/gg/lib/common.c
+++ b/libpurple/protocols/gg/lib/common.c
@@ -27,9 +27,7 @@
 
 #include "network.h"
 #include "strman.h"
-#ifdef sun
-#  include <sys/filio.h>
-#endif
+#include "fileio.h"
 
 #include <errno.h>
 #include <stdarg.h>
@@ -253,10 +251,12 @@ int gg_connect(void *addr, int port, int
 	struct in_addr *a = addr;
 	struct sockaddr_in myaddr;
 
-	gg_debug(GG_DEBUG_FUNCTION, "** gg_connect(%s, %d, %d);\n", inet_ntoa(*a), port, async);
+	gg_debug(GG_DEBUG_FUNCTION, "** gg_connect(%s, %d, %d);\n",
+		inet_ntoa(*a), port, async);
 
 	if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1) {
-		gg_debug(GG_DEBUG_MISC, "// gg_connect() socket() failed (errno=%d, %s)\n", errno, strerror(errno));
+		gg_debug(GG_DEBUG_MISC, "// gg_connect() socket() failed "
+			"(errno=%d, %s)\n", errno, strerror(errno));
 		return -1;
 	}
 
@@ -266,7 +266,8 @@ int gg_connect(void *addr, int port, int
 	myaddr.sin_addr.s_addr = gg_local_ip;
 
 	if (bind(sock, (struct sockaddr *) &myaddr, sizeof(myaddr)) == -1) {
-		gg_debug(GG_DEBUG_MISC, "// gg_connect() bind() failed (errno=%d, %s)\n", errno, strerror(errno));
+		gg_debug(GG_DEBUG_MISC, "// gg_connect() bind() failed "
+			"(errno=%d, %s)\n", errno, strerror(errno));
 		errno2 = errno;
 		close(sock);
 		errno = errno2;
@@ -300,7 +301,8 @@ int gg_connect(void *addr, int port, int
 			errno = errno2;
 			return -1;
 		}
-		gg_debug(GG_DEBUG_MISC, "// gg_connect() connect() in progress\n");
+		gg_debug(GG_DEBUG_MISC,
+			"// gg_connect() connect() in progress\n");
 	}
 
 	return sock;
@@ -575,19 +577,23 @@ char *gg_proxy_auth(void)
 	if (!gg_proxy_enabled || !gg_proxy_username || !gg_proxy_password)
 		return NULL;
 
-	if (!(tmp = malloc((tmp_size = strlen(gg_proxy_username) + strlen(gg_proxy_password) + 2))))
+	tmp_size = strlen(gg_proxy_username) + strlen(gg_proxy_password) + 2;
+	tmp = malloc(tmp_size);
+	if (!tmp)
 		return NULL;
 
 	snprintf(tmp, tmp_size, "%s:%s", gg_proxy_username, gg_proxy_password);
 
-	if (!(enc = gg_base64_encode(tmp))) {
+	enc = gg_base64_encode(tmp);
+	if (!enc) {
 		free(tmp);
 		return NULL;
 	}
 
 	free(tmp);
 
-	if (!(out = malloc(strlen(enc) + 40))) {
+	out = malloc(strlen(enc) + 40);
+	if (!out) {
 		free(enc);
 		return NULL;
 	}
diff --git a/libpurple/protocols/gg/lib/dcc7.c b/libpurple/protocols/gg/lib/dcc7.c
--- a/libpurple/protocols/gg/lib/dcc7.c
+++ b/libpurple/protocols/gg/lib/dcc7.c
@@ -664,7 +664,10 @@ int gg_dcc7_handle_id(struct gg_session 
 
 				/* Uwaga: To nie jest ciÄ
g kończony zerem.
 				 * Note: This is not a null-terminated string. */
-				strncpy((char*) s.filename, (char*) tmp->filename, sizeof(s.filename));
+				GG_STATIC_ASSERT(
+					sizeof(s.filename) == sizeof(tmp->filename) - 1,
+					filename_sizes_does_not_match);
+				memcpy((char*)s.filename, (char*)tmp->filename, sizeof(s.filename));
 
 				tmp->state = GG_STATE_WAITING_FOR_ACCEPT;
 				tmp->timeout = GG_DCC7_TIMEOUT_FILE_ACK;
diff --git a/libpurple/protocols/gg/lib/events.c b/libpurple/protocols/gg/lib/events.c
--- a/libpurple/protocols/gg/lib/events.c
+++ b/libpurple/protocols/gg/lib/events.c
@@ -588,6 +588,7 @@ static gg_action_t gg_handle_resolving(s
 	int count = -1;
 	int res;
 	unsigned int i;
+	struct in_addr *addrs;
 
 	res = gg_resolver_recv(sess->fd, buf, sizeof(buf));
 
@@ -622,8 +623,10 @@ static gg_action_t gg_handle_resolving(s
 
 	/* Sprawdź, czy mamy listÄ™ zakoÅ„czonÄ
 INADDR_NONE */
 
+	addrs = (struct in_addr *)(void *)sess->recv_buf;
+
 	for (i = 0; i < sess->recv_done / sizeof(struct in_addr); i++) {
-		if (((struct in_addr*) sess->recv_buf)[i].s_addr == INADDR_NONE) {
+		if (addrs[i].s_addr == INADDR_NONE) {
 			count = i;
 			break;
 		}
@@ -661,7 +664,7 @@ static gg_action_t gg_handle_resolving(s
 			if (i > 0)
 				len += 2;
 
-			len += strlen(inet_ntoa(((struct in_addr*) sess->recv_buf)[i]));
+			len += strlen(inet_ntoa(addrs[i]));
 		}
 
 		list = malloc(len + 1);
@@ -675,7 +678,7 @@ static gg_action_t gg_handle_resolving(s
 			if (i > 0)
 				strcat(list, ", ");
 
-			strcat(list, inet_ntoa(((struct in_addr*) sess->recv_buf)[i]));
+			strcat(list, inet_ntoa(addrs[i]));
 		}
 
 		gg_debug_session(sess, GG_DEBUG_DUMP, "// gg_watch_fd() resolved: %s\n", list);
@@ -687,7 +690,7 @@ static gg_action_t gg_handle_resolving(s
 	gg_close(sess);
 
 	sess->state = next_state;
-	sess->resolver_result = (struct in_addr*) sess->recv_buf;
+	sess->resolver_result = addrs;
 	sess->resolver_count = count;
 	sess->resolver_index = 0;
 	sess->recv_buf = NULL;
@@ -1239,7 +1242,9 @@ static gg_action_t gg_handle_tls_negotia
 	struct gg_event *e, enum gg_state_t next_state,
 	enum gg_state_t alt_state, enum gg_state_t alt2_state)
 {
+#if defined(GG_CONFIG_HAVE_GNUTLS) || defined(GG_CONFIG_HAVE_OPENSSL)
 	int valid_hostname = 0;
+#endif
 
 #ifdef GG_CONFIG_HAVE_GNUTLS
 	unsigned int status;
@@ -1436,6 +1441,7 @@ static gg_action_t gg_handle_tls_negotia
 
 #endif
 
+#if defined(GG_CONFIG_HAVE_GNUTLS) || defined(GG_CONFIG_HAVE_OPENSSL)
 	if (!valid_hostname) {
 		gg_debug_session(sess, GG_DEBUG_MISC, "//   WARNING!  unable to verify hostname\n");
 
@@ -1450,6 +1456,7 @@ static gg_action_t gg_handle_tls_negotia
 	sess->timeout = GG_DEFAULT_TIMEOUT;
 
 	return GG_ACTION_WAIT;
+#endif
 }
 
 static gg_action_t gg_handle_reading_proxy_gg(struct gg_session *sess,
diff --git a/libpurple/protocols/gg/lib/handlers.c b/libpurple/protocols/gg/lib/handlers.c
--- a/libpurple/protocols/gg/lib/handlers.c
+++ b/libpurple/protocols/gg/lib/handlers.c
@@ -27,10 +27,8 @@
  */
 
 #include <ctype.h>
-#ifdef sun
-#  include <sys/filio.h>
-#endif
-
+
+#include "fileio.h"
 #include "network.h"
 #include "strman.h"
 #include "libgadu.h"
diff --git a/libpurple/protocols/gg/lib/internal.h b/libpurple/protocols/gg/lib/internal.h
--- a/libpurple/protocols/gg/lib/internal.h
+++ b/libpurple/protocols/gg/lib/internal.h
@@ -28,17 +28,20 @@
 
 #ifdef _WIN32
 #  define GG_SIZE_FMT "Iu"
+#  define _GG_INT64_MODIFIER "I64"
 #else
 #  define GG_SIZE_FMT "zu"
+#  define _GG_INT64_MODIFIER "ll"
 #endif
+
 #ifndef PRIu64
-#  define PRIu64 "llu"
+#  define PRIu64 _GG_INT64_MODIFIER "u"
 #endif
 #ifndef PRIx64
-#  define PRIx64 "llx"
+#  define PRIx64 _GG_INT64_MODIFIER "x"
 #endif
 #ifndef PRId64
-#  define PRId64 "lld"
+#  define PRId64 _GG_INT64_MODIFIER "d"
 #endif
 
 #define GG_LOGIN_PARAMS_HAS_FIELD(glp, member) \
@@ -55,6 +58,11 @@
 #  define GG_CDECL
 #endif
 
+#define GG_STATIC_ASSERT(condition, message) \
+	{ typedef char static_assertion_failed_ ## message \
+	[(condition) ? 1 : -1]; static_assertion_failed_ ## message dummy; \
+	(void)dummy; }
+
 struct gg_dcc7_relay {
 	uint32_t addr;
 	uint16_t port;
diff --git a/libpurple/protocols/gg/lib/libgadu.h b/libpurple/protocols/gg/lib/libgadu.h
--- a/libpurple/protocols/gg/lib/libgadu.h
+++ b/libpurple/protocols/gg/lib/libgadu.h
@@ -283,7 +283,7 @@ struct gg_session {
 	int initial_status;	/**< PoczÄ
tkowy status */
 	int status;		/**< Aktualny status */
 
-	char *recv_buf;		/**< Bufor na odbierany pakiety */
+	char *recv_buf;		/**< Bufor na odbierane pakiety. Wskaźnik zawsze maksymalnie wyrównany, tak jak w wyniku działania \c malloc(). */
 	int recv_done;		/**< Liczba wczytanych bajtów pakietu */
 	int recv_left;		/**< Liczba pozostałych do wczytania bajtów pakietu */
 
diff --git a/libpurple/protocols/gg/lib/network.h b/libpurple/protocols/gg/lib/network.h
--- a/libpurple/protocols/gg/lib/network.h
+++ b/libpurple/protocols/gg/lib/network.h
@@ -31,6 +31,8 @@
 #ifdef _WIN32
 #  include <ws2tcpip.h>
 #  include <winsock2.h>



More information about the Commits mailing list