'Determines if the vhost is the same \'server\'.
Used in redirection - indicates whether or not the two virtual hosts
serve on the exact same IP combinations, but different ports.
The generic flag indicates that that we\'re trying to match to a
default or generic vhost
.. todo:: Handle _default_'

def same_server(self, vhost, generic=False):

    if (not generic):
        if (vhost.get_names() != self.get_names()):
            return False
        if ((self.name is not None) or self.aliases):
            return True
    elif self.name:
        return False
    if (len(vhost.addrs) != len(self.addrs)):
        return False
    already_found = set()
    for addr in vhost.addrs:
        for local_addr in self.addrs:
            if ((local_addr.get_addr() == addr.get_addr()) and (local_addr != addr) and (local_addr.get_addr() not in already_found)):
                already_found.add(local_addr.get_addr())
                break
        else:
            return False
    return True
