pidgin/pidgin

Update libgadu to the current version from repo
release-2.x.y
2014-03-22, Tomasz Wasilczyk
0143226782bb
Parents 3bce877e1722
Children f4232b1c3263
Update libgadu to the current version from repo
--- a/libpurple/protocols/gg/lib/common.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/common.c Sat Mar 22 00:42:07 2014 +0100
@@ -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 @@
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 @@
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 @@
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 @@
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;
}
--- a/libpurple/protocols/gg/lib/dcc7.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/dcc7.c Sat Mar 22 00:42:07 2014 +0100
@@ -664,7 +664,10 @@
/* 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;
--- a/libpurple/protocols/gg/lib/events.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/events.c Sat Mar 22 00:42:07 2014 +0100
@@ -1239,7 +1239,9 @@
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 +1438,7 @@
#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 +1453,7 @@
sess->timeout = GG_DEFAULT_TIMEOUT;
return GG_ACTION_WAIT;
+#endif
}
static gg_action_t gg_handle_reading_proxy_gg(struct gg_session *sess,
--- a/libpurple/protocols/gg/lib/handlers.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/handlers.c Sat Mar 22 00:42:07 2014 +0100
@@ -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"
--- a/libpurple/protocols/gg/lib/internal.h Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/internal.h Sat Mar 22 00:42:07 2014 +0100
@@ -55,6 +55,10 @@
# define GG_CDECL
#endif
+#define GG_STATIC_ASSERT(condition, message) \
+ { typedef char static_assertion_failed_ ## message \
+ [(condition) ? 1 : -1]; }
+
struct gg_dcc7_relay {
uint32_t addr;
uint16_t port;
--- a/libpurple/protocols/gg/lib/protobuf-c.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/protobuf-c.c Sat Mar 22 00:42:07 2014 +0100
@@ -1363,7 +1363,6 @@
}
return rv;
-goto no_packing_needed;
no_packing_needed:
buffer->append (buffer, rv, array);
return rv;
@@ -2028,7 +2027,6 @@
*p_n += count;
return TRUE;
-goto no_unpacking_needed;
no_unpacking_needed:
memcpy (array, at, count * siz);
*p_n += count;
--- a/libpurple/protocols/gg/lib/resolver.c Fri Mar 21 04:40:05 2014 -0500
+++ b/libpurple/protocols/gg/lib/resolver.c Sat Mar 22 00:42:07 2014 +0100
@@ -474,7 +474,8 @@
if (force)
kill(data->pid, SIGKILL);
- waitpid(data->pid, NULL, WNOHANG);
+ /* we don't care about child's exit status, just want to clean it up */
+ (void)waitpid(data->pid, NULL, WNOHANG);
free(data);
}
@@ -817,10 +818,10 @@
return 0;
}
-#ifdef _WIN32
+#ifdef GG_CONFIG_HAVE_PTHREAD
+ type = GG_RESOLVER_PTHREAD;
+#elif defined(_WIN32)
type = GG_RESOLVER_WIN32;
-#elif defined(GG_CONFIG_HAVE_PTHREAD) && defined(GG_CONFIG_PTHREAD_DEFAULT)
- type = GG_RESOLVER_PTHREAD;
#elif defined(GG_CONFIG_HAVE_FORK)
type = GG_RESOLVER_FORK;
#endif
@@ -944,10 +945,10 @@
return 0;
}
-#ifdef _WIN32
+#ifdef GG_CONFIG_HAVE_PTHREAD
+ type = GG_RESOLVER_PTHREAD;
+#elif defined(_WIN32)
type = GG_RESOLVER_WIN32;
-#elif defined(GG_CONFIG_HAVE_PTHREAD) && defined(GG_CONFIG_PTHREAD_DEFAULT)
- type = GG_RESOLVER_PTHREAD;
#elif defined(GG_CONFIG_HAVE_FORK)
type = GG_RESOLVER_FORK;
#endif