Skip to content

Commit

Permalink
lmtp: client: Moved soon-to-be-obsolete output handling functions to …
Browse files Browse the repository at this point in the history
…end of the file.
  • Loading branch information
stephanbosch committed Dec 7, 2017
1 parent eac03bb commit 3a1c078
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
36 changes: 20 additions & 16 deletions src/lmtp/client.c
Expand Up @@ -285,22 +285,6 @@ void client_disconnect(struct client *client, const char *prefix,
client->disconnected = TRUE;
}

void client_send_line(struct client *client, const char *fmt, ...)
{
va_list args;

va_start(args, fmt);
T_BEGIN {
string_t *str;

str = t_str_new(256);
str_vprintfa(str, fmt, args);
str_append(str, "\r\n");
o_stream_nsend(client->output, str_data(str), str_len(str));
} T_END;
va_end(args);
}

bool client_is_trusted(struct client *client)
{
const char *const *net;
Expand Down Expand Up @@ -437,3 +421,23 @@ void client_io_reset(struct client *client)
client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
client_idle_timeout, client);
}

/*
* Output handling
*/

void client_send_line(struct client *client, const char *fmt, ...)
{
va_list args;

va_start(args, fmt);
T_BEGIN {
string_t *str;

str = t_str_new(256);
str_vprintfa(str, fmt, args);
str_append(str, "\r\n");
o_stream_nsend(client->output, str_data(str), str_len(str));
} T_END;
va_end(args);
}
5 changes: 3 additions & 2 deletions src/lmtp/client.h
Expand Up @@ -90,8 +90,6 @@ void client_state_reset(struct client *client, const char *state_name);
void client_state_set(struct client *client, const char *name, const char *args);
const char *client_remote_id(struct client *client);

void client_send_line(struct client *client, const char *fmt, ...)
ATTR_FORMAT(2, 3);
bool client_is_trusted(struct client *client);

void clients_destroy(void);
Expand All @@ -100,4 +98,7 @@ void client_input_handle(struct client *client);
int client_input_read(struct client *client);
void client_io_reset(struct client *client);

void client_send_line(struct client *client, const char *fmt, ...)
ATTR_FORMAT(2, 3);

#endif

0 comments on commit 3a1c078

Please sign in to comment.