mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-28 13:58:08 +00:00
CLEANUP: standard: use proper const to addr_to_str() and port_to_str()
The input parameter was not marked const, making it painful for some calls.
This commit is contained in:
parent
d2d3348acb
commit
d5ec4bfe85
@ -446,7 +446,7 @@ int url2sa(const char *url, int ulen, struct sockaddr_storage *addr, struct spli
|
|||||||
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
int addr_to_str(struct sockaddr_storage *addr, char *str, int size);
|
int addr_to_str(const struct sockaddr_storage *addr, char *str, int size);
|
||||||
|
|
||||||
/* Tries to convert a sockaddr_storage port to text form. Upon success, the
|
/* Tries to convert a sockaddr_storage port to text form. Upon success, the
|
||||||
* address family is returned so that it's easy for the caller to adapt to the
|
* address family is returned so that it's easy for the caller to adapt to the
|
||||||
@ -454,7 +454,7 @@ int addr_to_str(struct sockaddr_storage *addr, char *str, int size);
|
|||||||
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
int port_to_str(struct sockaddr_storage *addr, char *str, int size);
|
int port_to_str(const struct sockaddr_storage *addr, char *str, int size);
|
||||||
|
|
||||||
/* check if the given address is local to the system or not. It will return
|
/* check if the given address is local to the system or not. It will return
|
||||||
* -1 when it's not possible to know, 0 when the address is not local, 1 when
|
* -1 when it's not possible to know, 0 when the address is not local, 1 when
|
||||||
|
@ -1427,10 +1427,10 @@ int url2sa(const char *url, int ulen, struct sockaddr_storage *addr, struct spli
|
|||||||
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
int addr_to_str(struct sockaddr_storage *addr, char *str, int size)
|
int addr_to_str(const struct sockaddr_storage *addr, char *str, int size)
|
||||||
{
|
{
|
||||||
|
|
||||||
void *ptr;
|
const void *ptr;
|
||||||
|
|
||||||
if (size < 5)
|
if (size < 5)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1463,7 +1463,7 @@ int addr_to_str(struct sockaddr_storage *addr, char *str, int size)
|
|||||||
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
* is returned upon error, with errno set. AF_INET, AF_INET6 and AF_UNIX are
|
||||||
* supported.
|
* supported.
|
||||||
*/
|
*/
|
||||||
int port_to_str(struct sockaddr_storage *addr, char *str, int size)
|
int port_to_str(const struct sockaddr_storage *addr, char *str, int size)
|
||||||
{
|
{
|
||||||
|
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
|
Loading…
Reference in New Issue
Block a user