/pidgin/main: c9069e0e3c36: Update internal libgadu to 1.12.0-rc2

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri Feb 28 11:30:04 EST 2014


Changeset: c9069e0e3c36935f06181819b5db0b5d4c686a78
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-02-28 17:29 +0100
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/c9069e0e3c36

Description:

Update internal libgadu to 1.12.0-rc2

diffstat:

 ChangeLog                                     |     8 +-
 configure.ac                                  |    26 +
 libpurple/protocols/gg/Makefile.am            |    61 +-
 libpurple/protocols/gg/lib/common.c           |   298 ++-
 libpurple/protocols/gg/lib/compat.h           |    35 -
 libpurple/protocols/gg/lib/config.h           |    89 +
 libpurple/protocols/gg/lib/dcc.c              |   231 +-
 libpurple/protocols/gg/lib/dcc7.c             |   144 +-
 libpurple/protocols/gg/lib/debug.c            |    39 +-
 libpurple/protocols/gg/lib/debug.h            |    27 +
 libpurple/protocols/gg/lib/deflate.h          |     2 +-
 libpurple/protocols/gg/lib/encoding.c         |    45 +-
 libpurple/protocols/gg/lib/endian.c           |   110 +
 libpurple/protocols/gg/lib/events.c           |  2311 ++++++++++++++-------
 libpurple/protocols/gg/lib/fileio.h           |    54 +
 libpurple/protocols/gg/lib/handlers.c         |  1164 +++++++++-
 libpurple/protocols/gg/lib/http.c             |   113 +-
 libpurple/protocols/gg/lib/internal.h         |   133 +
 libpurple/protocols/gg/lib/libgadu-config.h   |    59 -
 libpurple/protocols/gg/lib/libgadu-debug.h    |    29 -
 libpurple/protocols/gg/lib/libgadu-internal.h |    44 -
 libpurple/protocols/gg/lib/libgadu.c          |  2073 ++++++++++++-------
 libpurple/protocols/gg/lib/libgadu.h          |   406 +++-
 libpurple/protocols/gg/lib/message.c          |   507 +++-
 libpurple/protocols/gg/lib/message.h          |     8 +-
 libpurple/protocols/gg/lib/network.c          |   307 ++
 libpurple/protocols/gg/lib/network.h          |    95 +
 libpurple/protocols/gg/lib/obsolete.c         |    11 +-
 libpurple/protocols/gg/lib/packets.pb-c.c     |  2370 ++++++++++++++++++++++
 libpurple/protocols/gg/lib/packets.pb-c.h     |   682 ++++++
 libpurple/protocols/gg/lib/protobuf-c.c       |  2682 +++++++++++++++++++++++++
 libpurple/protocols/gg/lib/protobuf-c.h       |   552 +++++
 libpurple/protocols/gg/lib/protobuf.c         |   153 +
 libpurple/protocols/gg/lib/protobuf.h         |    70 +
 libpurple/protocols/gg/lib/protocol.h         |    85 +
 libpurple/protocols/gg/lib/pubdir.c           |    26 +-
 libpurple/protocols/gg/lib/pubdir50.c         |    15 +-
 libpurple/protocols/gg/lib/resolver.c         |   703 ++---
 libpurple/protocols/gg/lib/resolver.h         |     7 +-
 libpurple/protocols/gg/lib/session.h          |     3 -
 libpurple/protocols/gg/lib/sha1.c             |   159 +-
 libpurple/protocols/gg/lib/strman.h           |    43 +
 libpurple/protocols/gg/lib/tvbuff.c           |   601 +++++
 libpurple/protocols/gg/lib/tvbuff.h           |    59 +
 libpurple/protocols/gg/lib/tvbuilder.c        |   424 +++
 libpurple/protocols/gg/lib/tvbuilder.h        |    50 +
 46 files changed, 14282 insertions(+), 2831 deletions(-)

diffs (truncated from 20514 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,12 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
-version 2.10.10:
-	Stuff:
-	* Stuff.
-
+version 2.10.10 (?/?/?):
 	Finch:
 	* Fix build against Python 3. (Ed Catmur) (#15969)
 
+	Gadu-Gadu:
+	* Updated internal libgadu to version 1.12.0-rc2.
+
 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
@@ -1108,6 +1108,32 @@ if test "x$gadu_libs" = "xyes"; then
 fi
 
 AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes")
+if test "x$gadu_libs" != "xyes"; then
+	AC_CHECK_LIB(gnutls, gnutls_certificate_set_x509_system_trust, [gg_have_gnutls_csxst=yes], [gg_have_gnutls_csxst=no])
+
+	gg_gnutls_sts=""
+	if test "x$gg_have_gnutls_csxst" = "xno"; then
+		for i in /etc/ssl/ca-bundle.pem \
+			/etc/ssl/certs/ca-certificates.crt \
+			/etc/pki/tls/cert.pem \
+			/usr/local/share/certs/ca-root-nss.crt \
+			/etc/ssl/cert.pem
+		do
+			if test -e $i; then
+				gg_gnutls_sts="$i"
+				break
+			fi
+		done
+	fi
+
+	if test "x$gg_have_gnutls_csxst" = "xyes"; then
+		AC_DEFINE(HAVE_GNUTLS_CERTIFICATE_SET_X509_SYSTEM_TRUST, 1, [gnutls contains the gnutls_certificate_set_x509_system_trust function])
+	fi
+	if test "x$gg_gnutls_sts" != "x"; then
+		AC_DEFINE_UNQUOTED(GG_CONFIG_GNUTLS_SYSTEM_TRUST_STORE, ["$gg_gnutls_sts"], [use the given file as GnuTLS default trust store])
+	fi
+
+fi
 
 if test "x$gadu_libs" = "x"; then
 	gadu_libs=no
diff --git a/libpurple/protocols/gg/Makefile.am b/libpurple/protocols/gg/Makefile.am
--- a/libpurple/protocols/gg/Makefile.am
+++ b/libpurple/protocols/gg/Makefile.am
@@ -1,64 +1,93 @@
 EXTRA_DIST = \
 	Makefile.mingw \
+	lib/COPYING \
 	lib/common.c \
-	lib/compat.h \
-	lib/COPYING \
+	lib/config.h \
+	lib/dcc7.c \
 	lib/dcc.c \
-	lib/dcc7.c \
 	lib/debug.c \
+	lib/debug.h \
 	lib/deflate.c \
 	lib/deflate.h \
 	lib/encoding.c \
 	lib/encoding.h \
+	lib/endian.c \
 	lib/events.c \
+	lib/fileio.h \
 	lib/handlers.c \
 	lib/http.c \
+	lib/internal.h \
+	lib/libgadu.c \
 	lib/libgadu.h \
-	lib/libgadu.c \
-	lib/libgadu-config.h \
-	lib/libgadu-debug.h \
-	lib/libgadu-internal.h \
 	lib/message.c \
 	lib/message.h \
+	lib/network.c \
+	lib/network.h \
 	lib/obsolete.c \
+	lib/packets.pb-c.c \
+	lib/packets.pb-c.h \
+	lib/protobuf.c \
+	lib/protobuf-c.c \
+	lib/protobuf-c.h \
+	lib/protobuf.h \
 	lib/protocol.h \
+	lib/pubdir50.c \
 	lib/pubdir.c \
-	lib/pubdir50.c \
 	lib/resolver.c \
 	lib/resolver.h \
 	lib/session.h \
-	lib/sha1.c
+	lib/sha1.c \
+	lib/strman.h \
+	lib/tvbuff.c \
+	lib/tvbuff.h \
+	lib/tvbuilder.c \
+	lib/tvbuilder.h
 
 pkgdir = $(libdir)/purple-$(PURPLE_MAJOR_VERSION)
 
 if USE_INTERNAL_LIBGADU
 INTGGSOURCES = \
 	lib/common.c \
-	lib/compat.h \
+	lib/config.h \
+	lib/dcc7.c \
 	lib/dcc.c \
-	lib/dcc7.c \
 	lib/debug.c \
+	lib/debug.h \
 	lib/deflate.c \
 	lib/deflate.h \
 	lib/encoding.c \
 	lib/encoding.h \
+	lib/endian.c \
 	lib/events.c \
+	lib/fileio.h \
 	lib/handlers.c \
 	lib/http.c \
+	lib/internal.h \
+	lib/libgadu.c \
 	lib/libgadu.h \
-	lib/libgadu.c \
-	lib/libgadu-config.h \
-	lib/libgadu-internal.h \
 	lib/message.c \
 	lib/message.h \
+	lib/network.c \
+	lib/network.h \
 	lib/obsolete.c \
+	lib/packets.pb-c.c \
+	lib/packets.pb-c.h \
+	lib/protobuf.c \
+	lib/protobuf-c.c \
+	lib/protobuf-c.h \
+	lib/protobuf.h \
 	lib/protocol.h \
+	lib/pubdir50.c \
 	lib/pubdir.c \
-	lib/pubdir50.c \
 	lib/resolver.c \
 	lib/resolver.h \
 	lib/session.h \
-	lib/sha1.c
+	lib/sha1.c \
+	lib/strman.h \
+	lib/tvbuff.c \
+	lib/tvbuff.h \
+	lib/tvbuilder.c \
+	lib/tvbuilder.h
 
 INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib -DGG_IGNORE_DEPRECATED -DUSE_INTERNAL_LIBGADU
 endif
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
@@ -1,4 +1,4 @@
-/* $Id: common.c 1101 2011-05-05 21:17:28Z wojtekka $ */
+/* $Id$ */
 
 /*
  *  (C) Copyright 2001-2002 Wojtek Kaniewski <wojtekka at irc.pl>
@@ -24,29 +24,34 @@
  *
  * \brief Funkcje wykorzystywane przez różne moduły biblioteki
  */
-#ifndef _WIN32
-#  include <sys/types.h>
-#  include <sys/ioctl.h>
-#  include <sys/socket.h>
-#  include <netinet/in.h>
-#  include <arpa/inet.h>
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
+
+#include "network.h"
+#include "strman.h"
+#ifdef sun
+#  include <sys/filio.h>
 #endif
 
 #include <errno.h>
-#include <fcntl.h>
-#ifndef _WIN32
-#  include <netdb.h>
-#endif
 #include <stdarg.h>
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
+#include <ctype.h>
+#include <time.h>
 
+#include "config.h"
 #include "libgadu.h"
+#include "internal.h"
+
+#ifndef GG_CONFIG_HAVE_VA_COPY
+#  ifdef GG_CONFIG_HAVE___VA_COPY
+#    define va_copy(dest, src) __va_copy((dest), (src))
+#  else
+/* Taka wersja va_copy() działa poprawnie tylko na platformach, które
+ * va_copy() de facto wcale nie potrzebujÄ
, np. MSVC. Definicja tylko dla
+ * przejrzystości kodu. */
+#    define va_copy(dest, src) (dest) = (src)
+#  endif
+#endif
 
 /**
  * \internal Odpowiednik funkcji \c vsprintf alokujÄ
cy miejsce na wynik.
@@ -63,59 +68,54 @@
  */
 char *gg_vsaprintf(const char *format, va_list ap)
 {
-	int size = 0;
+	int size;
 	char *buf = NULL;
-
-#ifdef GG_CONFIG_HAVE_VA_COPY
 	va_list aq;
 
-	va_copy(aq, ap);
-#else
-#  ifdef GG_CONFIG_HAVE___VA_COPY
-	va_list aq;
-
-	__va_copy(aq, ap);
-#  endif
-#endif
-
-#ifndef GG_CONFIG_HAVE_C99_VSNPRINTF
+#if !defined(GG_CONFIG_HAVE_C99_VSNPRINTF) && !defined(HAVE__VSCPRINTF)
 	{
-		int res;
+		int res = 0;
 		char *tmp;
 
 		size = 128;
 		do {
-			size *= 2;
-			if (!(tmp = realloc(buf, size + 1))) {
+			if (res > size) {
+				/* Jednak zachowanie zgodne z C99. */
+				size = res + 1;
+			} else {
+				size *= 2;
+			}
+
+			if (!(tmp = realloc(buf, size))) {
 				free(buf);
 				return NULL;
 			}
+
 			buf = tmp;
-			res = vsnprintf(buf, size, format, ap);
-		} while (res == size - 1 || res == -1);
+			va_copy(aq, ap);
+			res = vsnprintf(buf, size, format, aq);
+			va_end(aq);
+		} while (res >= size || res < 0);
 	}
 #else
+	va_copy(aq, ap);
+
+#  ifdef HAVE__VSCPRINTF
+	size = _vscprintf(format, aq) + 1;
+#  else
 	{
 		char tmp[2];
 
 		/* libce Solarisa przy buforze NULL zawsze zwracajÄ
 -1, więc
 		 * musimy podać coÅ› istniejÄ
cego jako cel printf()owania. */
-		size = vsnprintf(tmp, sizeof(tmp), format, ap);
-		if (!(buf = malloc(size + 1)))
-			return NULL;
+		size = vsnprintf(tmp, sizeof(tmp), format, aq) + 1;
 	}
-#endif
+#  endif
+	va_end(aq);
+	if (!(buf = malloc(size)))
+		return NULL;



More information about the Commits mailing list