mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
CLEANUP: log: make the low_level lf_{ip,port,text,text_len} functions take consts
These ones were abusively relying on variables making it hard to integrate with const arguments.
This commit is contained in:
parent
372ac5abff
commit
26ffa8544d
@ -150,19 +150,19 @@ int get_log_facility(const char *fac);
|
|||||||
*
|
*
|
||||||
* Return the adress of the \0 character, or NULL on error
|
* Return the adress of the \0 character, or NULL on error
|
||||||
*/
|
*/
|
||||||
char *lf_text_len(char *dst, const char *src, size_t len, size_t size, struct logformat_node *node);
|
char *lf_text_len(char *dst, const const char *src, size_t len, size_t size, const struct logformat_node *node);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write a IP adress to the log string
|
* Write a IP adress to the log string
|
||||||
* +X option write in hexadecimal notation, most signifant byte on the left
|
* +X option write in hexadecimal notation, most signifant byte on the left
|
||||||
*/
|
*/
|
||||||
char *lf_ip(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node);
|
char *lf_ip(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Write a port to the log
|
* Write a port to the log
|
||||||
* +X option write in hexadecimal notation, most signifant byte on the left
|
* +X option write in hexadecimal notation, most signifant byte on the left
|
||||||
*/
|
*/
|
||||||
char *lf_port(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node);
|
char *lf_port(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _PROTO_LOG_H */
|
#endif /* _PROTO_LOG_H */
|
||||||
|
@ -1053,7 +1053,7 @@ static char *lf_encode_chunk(char *start, char *stop,
|
|||||||
*
|
*
|
||||||
* Return the adress of the \0 character, or NULL on error
|
* Return the adress of the \0 character, or NULL on error
|
||||||
*/
|
*/
|
||||||
char *lf_text_len(char *dst, const char *src, size_t len, size_t size, struct logformat_node *node)
|
char *lf_text_len(char *dst, const char *src, size_t len, size_t size, const struct logformat_node *node)
|
||||||
{
|
{
|
||||||
if (size < 2)
|
if (size < 2)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1097,7 +1097,7 @@ char *lf_text_len(char *dst, const char *src, size_t len, size_t size, struct lo
|
|||||||
return dst;
|
return dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline char *lf_text(char *dst, const char *src, size_t size, struct logformat_node *node)
|
static inline char *lf_text(char *dst, const char *src, size_t size, const struct logformat_node *node)
|
||||||
{
|
{
|
||||||
return lf_text_len(dst, src, size, size, node);
|
return lf_text_len(dst, src, size, size, node);
|
||||||
}
|
}
|
||||||
@ -1106,7 +1106,7 @@ static inline char *lf_text(char *dst, const char *src, size_t size, struct logf
|
|||||||
* Write a IP adress to the log string
|
* Write a IP adress to the log string
|
||||||
* +X option write in hexadecimal notation, most signifant byte on the left
|
* +X option write in hexadecimal notation, most signifant byte on the left
|
||||||
*/
|
*/
|
||||||
char *lf_ip(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node)
|
char *lf_ip(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node)
|
||||||
{
|
{
|
||||||
char *ret = dst;
|
char *ret = dst;
|
||||||
int iret;
|
int iret;
|
||||||
@ -1131,7 +1131,7 @@ char *lf_ip(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_
|
|||||||
* Write a port to the log
|
* Write a port to the log
|
||||||
* +X option write in hexadecimal notation, most signifant byte on the left
|
* +X option write in hexadecimal notation, most signifant byte on the left
|
||||||
*/
|
*/
|
||||||
char *lf_port(char *dst, struct sockaddr *sockaddr, size_t size, struct logformat_node *node)
|
char *lf_port(char *dst, const struct sockaddr *sockaddr, size_t size, const struct logformat_node *node)
|
||||||
{
|
{
|
||||||
char *ret = dst;
|
char *ret = dst;
|
||||||
int iret;
|
int iret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user