Address.equalByName

Tests if @addr1 and @addr2 have the same "name". This method can be used with soup_address_hash_by_name() to create a #GHashTable that hashes on address "names".

Comparing by name normally means comparing the addresses by their hostnames. But if the address was originally created using an IP address literal, then it will be compared by that instead.

In particular, if "www.example.com" has the IP address 10.0.0.1, and @addr1 was created with the name "www.example.com" and @addr2 was created with the name "10.0.0.1", then they will compare as unequal for purposes of soup_address_equal_by_name().

This would be used to distinguish hosts in situations where different virtual hosts on the same IP address should be considered different. Eg, for purposes of HTTP authentication or cookies, two hosts with the same IP address but different names are considered to be different hosts.

See also soup_address_equal_by_ip(), which compares by IP address rather than by name.

class Address
bool
equalByName

Parameters

addr2 Address

another #SoupAddress with a resolved name

Return Value

Type: bool

whether or not @addr1 and @addr2 have the same name

Meta

Since

2.26