comparison libpurple/protocols/gg/lib/http.c @ 32827:4a34689eeb33 default tip

merged from im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sat, 19 Nov 2011 14:42:54 +0900
parents 380f530c3f86 e2ff2ac0e022
children
comparison
equal deleted inserted replaced
32692:0f94ec89f0bc 32827:4a34689eeb33
23 * 23 *
24 * \brief Obsługa połączeń HTTP 24 * \brief Obsługa połączeń HTTP
25 */ 25 */
26 26
27 #include <sys/types.h> 27 #include <sys/types.h>
28 #ifndef _WIN32
29 # include <sys/socket.h>
30 # include <netinet/in.h>
31 # include <arpa/inet.h>
32 #endif
33 28
34 #include "compat.h" 29 #include "compat.h"
35 #include "libgadu.h" 30 #include "libgadu.h"
36 #include "resolver.h" 31 #include "resolver.h"
37 32
38 #include <ctype.h> 33 #include <ctype.h>
39 #include <errno.h> 34 #include <errno.h>
40 #ifndef _WIN32
41 # include <netdb.h>
42 #endif
43 #include <signal.h> 35 #include <signal.h>
44 #include <stdarg.h> 36 #include <stdarg.h>
45 #include <stdio.h> 37 #include <stdio.h>
46 #include <stdlib.h> 38 #include <stdlib.h>
47 #include <string.h> 39 #include <string.h>
256 248
257 h->state = GG_STATE_SENDING_QUERY; 249 h->state = GG_STATE_SENDING_QUERY;
258 } 250 }
259 251
260 if (h->state == GG_STATE_SENDING_QUERY) { 252 if (h->state == GG_STATE_SENDING_QUERY) {
261 size_t res; 253 ssize_t res;
262 254
263 if ((res = write(h->fd, h->query, strlen(h->query))) < 1) { 255 if ((res = write(h->fd, h->query, strlen(h->query))) < 1) {
264 gg_debug(GG_DEBUG_MISC, "=> http, write() failed (len=%d, res=%d, errno=%d)\n", strlen(h->query), res, errno); 256 gg_debug(GG_DEBUG_MISC, "=> http, write() failed (len=%d, res=%d, errno=%d)\n", strlen(h->query), res, errno);
265 gg_http_error(GG_ERROR_WRITING); 257 gg_http_error(GG_ERROR_WRITING);
266 } 258 }