comparison src/protocols/rendezvous/mdns.c @ 8838:518455386538

[gaim-migrate @ 9604] -Fix the compile error in perl that was my fault -Rename a network.c function and change it's signature (is that work applicable in c?) -Make rendezvous crash when trying to sign on committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 28 Apr 2004 03:16:40 +0000
parents beb7be215db3
children 01c3db200c8f
comparison
equal deleted inserted replaced
8837:25206a0fb4e4 8838:518455386538
770 770
771 return ret; 771 return ret;
772 } 772 }
773 773
774 int 774 int
775 mdns_advertise_a(int fd, const char *name, unsigned char *ip) 775 mdns_advertise_a(int fd, const char *name, const unsigned char *ip)
776 { 776 {
777 int ret; 777 int ret;
778 ResourceRecord *rr; 778 ResourceRecord *rr;
779 ResourceRecordRDataA *rdata; 779 ResourceRecordRDataA *rdata;
780 int i; 780 int i;
781 781
782 if ((name == NULL) || (strlen(name) > 255)) { 782 g_return_val_if_fail(name != NULL, -EINVAL);
783 return -EINVAL; 783 g_return_val_if_fail(strlen(name) <= 255, -EINVAL);
784 } 784 g_return_val_if_fail(ip != NULL, -EINVAL);
785 785
786 rdata = g_malloc(4); 786 rdata = g_malloc(4);
787 for (i = 0; i < 4; i++) 787 for (i = 0; i < 4; i++)
788 util_put8(&rdata[i], ip[i]); 788 util_put8(&rdata[i], ip[i]);
789 789
876 876
877 return ret; 877 return ret;
878 } 878 }
879 879
880 int 880 int
881 mdns_advertise_aaaa(int fd, const char *name, unsigned char *ip) 881 mdns_advertise_aaaa(int fd, const char *name, const unsigned char *ip)
882 { 882 {
883 int ret; 883 int ret;
884 ResourceRecord *rr; 884 ResourceRecord *rr;
885 ResourceRecordRDataA *rdata; 885 ResourceRecordRDataA *rdata;
886 int i; 886 int i;