X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Ff2fchat.git;a=blobdiff_plain;f=friend.c;fp=friend.c;h=fd7964347593a7264a764fc04f855fa5dd06477b;hp=2d317e7dcf68c6290de54e2b2307d6cbdf49ccfd;hb=9bfbad1591814150338bb62050d28ad0e4033552;hpb=92d1f23463706939dda3445ddea37028fc03fdb7 diff --git a/friend.c b/friend.c index 2d317e7..fd79643 100644 --- a/friend.c +++ b/friend.c @@ -62,12 +62,13 @@ struct cache { static struct cache *ucache; -struct friend *friend_get_by_address(GInetAddress *address) +struct friend *friend_get_by_address(GInetAddress *address, uint16_t port) { GList *l; for (l = g_list_first(ucache->friends); l != NULL; l = g_list_next(l)) { struct friend *friend = l->data; - if (g_inet_address_equal(g_inet_socket_address_get_address(friend->saddr), address)) + if (g_inet_address_equal(g_inet_socket_address_get_address(friend->saddr), address) && + friend->port == port) return friend; } return NULL;