Mercurial > pidgin
comparison src/oscar.c @ 1839:109cacf1ff97
[gaim-migrate @ 1849]
now we don't require a hash server anymore. but it still has the ability to use one.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 11 May 2001 21:54:27 +0000 |
parents | bee2239f5952 |
children | 15a415b5f08c |
comparison
equal
deleted
inserted
replaced
1838:bee2239f5952 | 1839:109cacf1ff97 |
---|---|
679 aim_conn_kill(od->sess, &pos->conn); | 679 aim_conn_kill(od->sess, &pos->conn); |
680 aim_sendmemblock(od->sess, pos->mainconn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH); | 680 aim_sendmemblock(od->sess, pos->mainconn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH); |
681 g_free(pos); | 681 g_free(pos); |
682 } | 682 } |
683 | 683 |
684 /* size of icbmui.ocm, the largest module in AIM 3.5 */ | |
685 #define AIM_MAX_FILE_SIZE 98304 | |
686 | |
684 int gaim_memrequest(struct aim_session_t *sess, | 687 int gaim_memrequest(struct aim_session_t *sess, |
685 struct command_rx_struct *command, ...) { | 688 struct command_rx_struct *command, ...) { |
686 va_list ap; | 689 va_list ap; |
687 struct pieceofcrap *pos; | 690 struct pieceofcrap *pos; |
688 unsigned long offset, len; | 691 unsigned long offset, len; |
693 len = va_arg(ap, unsigned long); | 696 len = va_arg(ap, unsigned long); |
694 modname = va_arg(ap, char *); | 697 modname = va_arg(ap, char *); |
695 va_end(ap); | 698 va_end(ap); |
696 | 699 |
697 if (len == 0) { | 700 if (len == 0) { |
701 debug_printf("len is 0, hashing NULL\n"); | |
698 aim_sendmemblock(sess, command->conn, offset, len, NULL, | 702 aim_sendmemblock(sess, command->conn, offset, len, NULL, |
699 AIM_SENDMEMBLOCK_FLAG_ISREQUEST); | 703 AIM_SENDMEMBLOCK_FLAG_ISREQUEST); |
704 return 1; | |
705 } | |
706 if (offset > AIM_MAX_FILE_SIZE || len > AIM_MAX_FILE_SIZE) { | |
707 char buf[8]; | |
708 buf[0] = offset & 0xff; | |
709 buf[1] = (offset >> 8) & 0xff; | |
710 buf[2] = (offset >> 16) & 0xff; | |
711 buf[3] = (offset >> 24) & 0xff; | |
712 buf[4] = len & 0xff; | |
713 buf[5] = (len >> 8) & 0xff; | |
714 buf[6] = (len >> 16) & 0xff; | |
715 buf[7] = (len >> 24) & 0xff; | |
716 debug_printf("len + offset is invalid, hashing request\n"); | |
717 aim_sendmemblock(sess, command->conn, offset, 8, buf, AIM_SENDMEMBLOCK_FLAG_ISREQUEST); | |
700 return 1; | 718 return 1; |
701 } | 719 } |
702 | 720 |
703 pos = g_new0(struct pieceofcrap, 1); | 721 pos = g_new0(struct pieceofcrap, 1); |
704 pos->gc = sess->aux_data; | 722 pos->gc = sess->aux_data; |