diff libpurple/protocols/gg/lib/http.c @ 29939:db6735e579f8

Partially fix libgadu build on Win32. Refs #10542. I'm still not sure how to handle all the stuff in resolver.c for DNS resolution. I couldn't quite see how to reconcile our earlier stuff with this new code. Hopefully a more skilled Win32 developer can finish this.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Mon, 22 Feb 2010 00:36:15 +0000
parents 6359fde67f4c
children 2292d8896b0b 93b08d43f684
line wrap: on
line diff
--- a/libpurple/protocols/gg/lib/http.c	Sun Feb 21 16:52:42 2010 +0000
+++ b/libpurple/protocols/gg/lib/http.c	Mon Feb 22 00:36:15 2010 +0000
@@ -24,18 +24,26 @@
  * \brief Obsługa połączeń HTTP
  */
 
+#include "libgadu.h"
+
 #include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+
+#ifndef _WIN32
+#  include <sys/socket.h>
+#  include <netinet/in.h>
+#  include <arpa/inet.h>
+#endif
 
 #include "compat.h"
-#include "libgadu.h"
 #include "resolver.h"
 
 #include <ctype.h>
 #include <errno.h>
-#include <netdb.h>
+
+#ifndef _WIN32
+#  include <netdb.h>
+#endif
+
 #include <signal.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -230,7 +238,7 @@
 
 	if (h->state == GG_STATE_CONNECTING) {
 		int res = 0;
-		unsigned int res_size = sizeof(res);
+		socklen_t res_size = sizeof(res);
 
 		if (h->async && (getsockopt(h->fd, SOL_SOCKET, SO_ERROR, &res, &res_size) || res)) {
 			gg_debug(GG_DEBUG_MISC, "=> http, async connection failed (errno=%d, %s)\n", (res) ? res : errno , strerror((res) ? res : errno));
@@ -249,7 +257,7 @@
 	}
 
 	if (h->state == GG_STATE_SENDING_QUERY) {
-		int 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);