Commit 2835e376 authored by Max Kellermann's avatar Max Kellermann

client: added client_[gs]et_permission()

The code in command.c shouldn't mess with a pointer to client->permission. Provide an API for accessing this value.
parent bf6994d8
...@@ -133,6 +133,16 @@ int client_is_expired(const struct client *client) ...@@ -133,6 +133,16 @@ int client_is_expired(const struct client *client)
return client->fd < 0; return client->fd < 0;
} }
int client_get_permission(const struct client *client)
{
return client->permission;
}
void client_set_permission(struct client *client, int permission)
{
client->permission = permission;
}
static inline void client_set_expired(struct client *client) static inline void client_set_expired(struct client *client)
{ {
if (client->fd >= 0) { if (client->fd >= 0) {
......
...@@ -33,6 +33,10 @@ void client_new(int fd, const struct sockaddr *addr); ...@@ -33,6 +33,10 @@ void client_new(int fd, const struct sockaddr *addr);
int client_is_expired(const struct client *client); int client_is_expired(const struct client *client);
int client_get_permission(const struct client *client);
void client_set_permission(struct client *client, int permission);
/** /**
* Write a block of data to the client. * Write a block of data to the client.
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment