libpurple/protocols/gg/lib/libgadu.c

branch
cpw.rekkanoryo.ggupdate
changeset 29824
9878119b5d78
parent 29752
5cb6314b2477
child 30006
3587e1e5fbe5
equal deleted inserted replaced
29823:bb8a13838ec3 29824:9878119b5d78
27 * 27 *
28 * \brief Główny moduł biblioteki 28 * \brief Główny moduł biblioteki
29 */ 29 */
30 30
31 #include "libgadu.h" 31 #include "libgadu.h"
32 #include "libgadu-config.h"
32 #include "libgadu-internal.h" 33 #include "libgadu-internal.h"
33 34
34 #include <sys/types.h> 35 #include <sys/types.h>
35 36
36 #ifdef _WIN32 37 #ifdef _WIN32
409 */ 410 */
410 void *gg_recv_packet(struct gg_session *sess) 411 void *gg_recv_packet(struct gg_session *sess)
411 { 412 {
412 struct gg_header h; 413 struct gg_header h;
413 char *buf = NULL; 414 char *buf = NULL;
414 int ret = 0; 415 int ret = 0, offset, size = 0;
415 unsigned int offset, size = 0;
416 416
417 gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_recv_packet(%p);\n", sess); 417 gg_debug_session(sess, GG_DEBUG_FUNCTION, "** gg_recv_packet(%p);\n", sess);
418 418
419 if (!sess) { 419 if (!sess) {
420 errno = EFAULT; 420 errno = EFAULT;
607 h = (struct gg_header*) tmp; 607 h = (struct gg_header*) tmp;
608 h->type = gg_fix32(type); 608 h->type = gg_fix32(type);
609 h->length = gg_fix32(tmp_length - sizeof(struct gg_header)); 609 h->length = gg_fix32(tmp_length - sizeof(struct gg_header));
610 610
611 if ((gg_debug_level & GG_DEBUG_DUMP)) { 611 if ((gg_debug_level & GG_DEBUG_DUMP)) {
612 unsigned int i; 612 int i;
613 613
614 gg_debug_session(sess, GG_DEBUG_DUMP, "// gg_send_packet(0x%.2x)", gg_fix32(h->type)); 614 gg_debug_session(sess, GG_DEBUG_DUMP, "// gg_send_packet(0x%.2x)", gg_fix32(h->type));
615 for (i = 0; i < tmp_length; ++i) 615 for (i = 0; i < tmp_length; ++i)
616 gg_debug_session(sess, GG_DEBUG_DUMP, " %.2x", (unsigned char) tmp[i]); 616 gg_debug_session(sess, GG_DEBUG_DUMP, " %.2x", (unsigned char) tmp[i]);
617 gg_debug_session(sess, GG_DEBUG_DUMP, "\n"); 617 gg_debug_session(sess, GG_DEBUG_DUMP, "\n");

mercurial