pidgin: 2f9cced1: Gadu-Gadu: synchronize internal libgadu ...

tomkiewicz at cpw.pidgin.im tomkiewicz at cpw.pidgin.im
Mon Oct 17 21:01:33 EDT 2011


----------------------------------------------------------------------
Revision: 2f9cced12887b6ffabbdcfef65832961abadd3bb
Parent:   b25bb3869be9cc4589818113f23267005892c3c6
Author:   tomkiewicz at cpw.pidgin.im
Date:     10/17/11 20:55:59
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2f9cced12887b6ffabbdcfef65832961abadd3bb

Changelog: 

Gadu-Gadu: synchronize internal libgadu with upstream. Refs #343

Changes against parent b25bb3869be9cc4589818113f23267005892c3c6

  patched  libpurple/protocols/gg/gg.c
  patched  libpurple/protocols/gg/gg.h
  patched  libpurple/protocols/gg/lib/common.c
  patched  libpurple/protocols/gg/lib/dcc.c
  patched  libpurple/protocols/gg/lib/dcc7.c
  patched  libpurple/protocols/gg/lib/events.c
  patched  libpurple/protocols/gg/lib/handlers.c
  patched  libpurple/protocols/gg/lib/http.c
  patched  libpurple/protocols/gg/lib/libgadu-config.h
  patched  libpurple/protocols/gg/lib/libgadu.c
  patched  libpurple/protocols/gg/lib/libgadu.h
  patched  libpurple/protocols/gg/lib/pubdir.c
  patched  libpurple/protocols/gg/lib/pubdir50.c
  patched  libpurple/protocols/gg/lib/resolver.c
  patched  libpurple/protocols/gg/win32-resolver.c

-------------- next part --------------
============================================================
--- libpurple/protocols/gg/gg.c	c79965bdd1e5449dfc037972761e843acc5d931c
+++ libpurple/protocols/gg/gg.c	231f2de698e9771c679d989c12ab74907c0355b6
@@ -39,8 +39,6 @@
 #include "request.h"
 #include "xmlnode.h"
 
-#include <libgadu.h>
-
 #include "gg.h"
 #include "confer.h"
 #include "search.h"
============================================================
--- libpurple/protocols/gg/lib/common.c	c87ff20f4efb7f6ce12337dfa0ce241ae9bda840
+++ libpurple/protocols/gg/lib/common.c	cfd4c76ed0036e950a506d4b0be092da16bd57df
@@ -30,10 +30,10 @@
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
 #endif
+#ifdef sun
+#  include <sys/filio.h>
+#endif
 
 #include <errno.h>
 #include <fcntl.h>
============================================================
--- libpurple/protocols/gg/lib/dcc.c	4721abb856746ce458eeef437fdce53d36eb821f
+++ libpurple/protocols/gg/lib/dcc.c	04d74bb413e41c8173aec475717aef35a6e8121c
@@ -33,10 +33,10 @@
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
 #endif
+#ifdef sun
+#  include <sys/filio.h>
+#endif
 
 #include <ctype.h>
 #include <errno.h>
============================================================
--- libpurple/protocols/gg/lib/events.c	05da5230649347d4674632763e577b7ae6204075
+++ libpurple/protocols/gg/lib/events.c	36878ce8c159214c082df500b9d63cd057b66099
@@ -38,7 +38,6 @@
 
 #include "compat.h"
 #include "libgadu.h"
-#include "libgadu-config.h"
 #include "protocol.h"
 #include "libgadu-internal.h"
 #include "encoding.h"
============================================================
--- libpurple/protocols/gg/lib/http.c	f9c0de253c74a60682844fc563cb69551f65a16b
+++ libpurple/protocols/gg/lib/http.c	0f48c2011c38427acc9893a7fd8f3a2d4066e48b
@@ -258,7 +258,7 @@ int gg_http_watch_fd(struct gg_http *h)
 	}
 
 	if (h->state == GG_STATE_SENDING_QUERY) {
-		size_t res;
+		ssize_t res;
 
 		if ((res = write(h->fd, h->query, strlen(h->query))) < 1) {
 			gg_debug(GG_DEBUG_MISC, "=> http, write() failed (len=%d, res=%d, errno=%d)\n", strlen(h->query), res, errno);
============================================================
--- libpurple/protocols/gg/lib/libgadu-config.h	bb5b8a51459d6647e400380ef06526ab3a75ad8b
+++ libpurple/protocols/gg/lib/libgadu-config.h	fc01ed0333d9efd045d3e9d66e9b86d07b8b4eba
@@ -5,6 +5,8 @@
 #ifndef __GG_LIBGADU_CONFIG_H
 #define __GG_LIBGADU_CONFIG_H
 
+#define GG_LIBGADU_VERSION "1.11.0"
+
 /* Defined if libgadu was compiled for bigendian machine. */
 #undef __GG_LIBGADU_BIGENDIAN
 #ifdef WORDS_BIGENDIAN
============================================================
--- libpurple/protocols/gg/lib/libgadu.c	c9d29e6893c4ccaf09a643074b5ee67d14941cb3
+++ libpurple/protocols/gg/lib/libgadu.c	bd660c68f8d209f5fb6cf9308451d09573cb9d91
@@ -38,14 +38,13 @@
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
 #endif
+#ifdef sun
+#  include <sys/filio.h>
+#endif
 
 #include "compat.h"
 #include "libgadu.h"
-#include "libgadu-config.h"
 #include "protocol.h"
 #include "resolver.h"
 #include "libgadu-internal.h"
@@ -74,8 +73,6 @@
 #  include <openssl/rand.h>
 #endif
 
-#define GG_LIBGADU_VERSION "1.11.0"
-
 /**
  * Port gniazda nas?uchuj?cego dla po??cze? bezpo?rednich.
  * 
============================================================
--- libpurple/protocols/gg/lib/libgadu.h	7ad8d5be1fd961be6d118aefac3e07040ca468ae
+++ libpurple/protocols/gg/lib/libgadu.h	93353cf7bf9ad72804a05823752f3516633c6639
@@ -1447,7 +1447,6 @@ int gg_file_hash_sha1(int fd, uint8_t *r
 
 int gg_file_hash_sha1(int fd, uint8_t *result) GG_DEPRECATED;
 
-#undef printf
 #ifdef __GNUC__
 char *gg_saprintf(const char *format, ...) __attribute__ ((format (printf, 1, 2))) GG_DEPRECATED;
 #else
@@ -2313,6 +2312,8 @@ struct gg_dcc7_dunno1 {
 
 #endif /* __GG_LIBGADU_H */
 
+#include "libgadu-config.h"
+
 /*
  * Local variables:
  * c-indentation-style: k&r
============================================================
--- libpurple/protocols/gg/lib/pubdir.c	ef0f7c330a64ee8eefc1272d76084befc5e6111d
+++ libpurple/protocols/gg/lib/pubdir.c	28a76bb68aa2380804d02e89c6c83485eb23d487
@@ -35,7 +35,6 @@
 #include <unistd.h>
 
 #include "libgadu.h"
-#include "libgadu-config.h"
 
 /**
  * Rejestruje nowego u?ytkownika.
============================================================
--- libpurple/protocols/gg/lib/pubdir50.c	947ddc5ce92d647a77cbd3d621f5d62125067419
+++ libpurple/protocols/gg/lib/pubdir50.c	ec44588e0c8e9cac3045672349fa6feed6d30f0d
@@ -31,7 +31,6 @@
 #include <time.h>
 
 #include "libgadu.h"
-#include "libgadu-config.h"
 #include "libgadu-internal.h"
 #include "encoding.h"
 
============================================================
--- libpurple/protocols/gg/gg.h	174220d8802b40f910662633c10a5312f041bec6
+++ libpurple/protocols/gg/gg.h	7cc20972ffe3d5a54b6288f14dcf21c6f097a147
@@ -24,6 +24,7 @@
 #ifndef _PURPLE_GG_H
 #define _PURPLE_GG_H
 
+#undef printf
 #include <libgadu.h>
 #include "internal.h"
 #include "search.h"
============================================================
--- libpurple/protocols/gg/lib/dcc7.c	e5218aac1396ab866a8c6f916cf3a18bbafbd170
+++ libpurple/protocols/gg/lib/dcc7.c	90502722cc305a31f8c5538ff2af0e177c6a1a3b
@@ -36,10 +36,10 @@
 #  include <sys/socket.h>
 #  include <netinet/in.h>
 #  include <arpa/inet.h>
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
 #endif
+#ifdef sun
+#  include <sys/filio.h>
+#endif
 #include <time.h>
 
 #include <ctype.h>
============================================================
--- libpurple/protocols/gg/lib/resolver.c	efa50452dff8b59c868dd6605b35416fca2b4955
+++ libpurple/protocols/gg/lib/resolver.c	2b503af33c161984d04d0476efb3e03b389dbc7a
@@ -41,7 +41,6 @@
 #endif
 
 #include "libgadu.h"
-#include "libgadu-config.h"
 #include "resolver.h"
 #include "compat.h"
 #include "session.h"
@@ -249,7 +248,7 @@ int gg_gethostbyname_real(const char *ho
 #endif /* GG_CONFIG_HAVE_GETHOSTBYNAME_R */
 }
 
-#if defined(GG_CONFIG_HAVE_PTHREAD) || !defined(_WIN32)
+#if defined(GG_CONFIG_HAVE_PTHREAD) || defined(GG_CONFIG_HAVE_FORK)
 /**
  * \internal Rozwi?zuje nazw? i zapisuje wynik do podanego desktyptora.
  *
@@ -319,7 +318,7 @@ struct gg_resolver_fork_data {
 	int pid;		/*< Identyfikator procesu */
 };
 
-#ifndef _WIN32
+#ifdef GG_CONFIG_HAVE_FORK
 /**
  * \internal Rozwi?zuje nazw? serwera w osobnym procesie.
  *
============================================================
--- libpurple/protocols/gg/lib/handlers.c	b188c2d1262d18e6cc868eac37fbe919d9820264
+++ libpurple/protocols/gg/lib/handlers.c	8f36fdcc32e381bc3ea7b94cf6ecfa1181d60013
@@ -33,15 +33,12 @@
 #  include <arpa/inet.h>
 #endif
 #include <ctype.h>
-#ifndef _WIN32
-#  ifdef sun
-#    include <sys/filio.h>
-#  endif
+#ifdef sun
+#  include <sys/filio.h>
 #endif
 
 #include "compat.h"
 #include "libgadu.h"
-#include "libgadu-config.h"
 #include "resolver.h"
 #include "session.h"
 #include "protocol.h"
============================================================
--- libpurple/protocols/gg/win32-resolver.c	da6e47112442aa27e477242ca92965cb0dbd0bc9
+++ libpurple/protocols/gg/win32-resolver.c	7df67382fa43098342cd3091b7a1e15a4954f509
@@ -157,6 +157,9 @@ struct ggp_resolver_win32thread_data {
 	int fd;
 };
 
+/**
+ * Copy-paste from gg_resolver_run().
+ */
 static DWORD WINAPI ggp_resolver_win32thread_thread(LPVOID arg)
 {
 	struct ggp_resolver_win32thread_data *data = arg;
@@ -167,12 +170,10 @@ static DWORD WINAPI ggp_resolver_win32th
 		"fd: %i called\n", data->hostname, data->fd);
 
 	if ((addr_ip[0].s_addr = inet_addr(data->hostname)) == INADDR_NONE) {
-		/* W przypadku b??du gg_gethostbyname_real() zwr?ci -1
-		 * i nie zmieni &addr. Tam jest ju? INADDR_NONE,
-		 * wi?c nie musimy robi? nic wi?cej. */
 		if (gg_gethostbyname_real(data->hostname, &addr_list,
 			&addr_count, 0) == -1) {
 			addr_list = addr_ip;
+			/* addr_ip[0] ju? zawiera INADDR_NONE */
 		}
 	} else {
 		addr_list = addr_ip;
@@ -183,7 +184,7 @@ static DWORD WINAPI ggp_resolver_win32th
 	purple_debug_misc("gg", "ggp_resolver_win32thread_thread() "
 		"count = %d\n", addr_count);
 
-	write(data->fd, addr_list, (addr_count+1) * sizeof(struct in_addr));
+	write(data->fd, addr_list, (addr_count + 1) * sizeof(struct in_addr));
 	close(data->fd);
 
 	free(data->hostname);


More information about the Commits mailing list