Skip to content

Commit

Permalink
lib-smtp: server: Moved smtp_server_connection_start() after smtp_ser…
Browse files Browse the repository at this point in the history
…ver_connection_login().

Also fixes an indent problem in the header comment implicitly.
  • Loading branch information
stephanbosch authored and cmouse committed Dec 28, 2017
1 parent 40a926a commit b85a1bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
24 changes: 12 additions & 12 deletions src/lib-smtp/smtp-server-connection.c
Expand Up @@ -1134,18 +1134,6 @@ void smtp_server_connection_reply_immediate(
}
}

void smtp_server_connection_start(struct smtp_server_connection *conn)
{
conn->raw_input = conn->conn.input;
conn->raw_output = conn->conn.output;

smtp_server_connection_timeout_start(conn);
smtp_server_connection_input_resume(conn);

if (!conn->ssl_start)
smtp_server_connection_ready(conn);
}

void smtp_server_connection_login(struct smtp_server_connection *conn,
const char *username, const char *helo,
const unsigned char *pdata, unsigned int pdata_len,
Expand Down Expand Up @@ -1173,6 +1161,18 @@ void smtp_server_connection_login(struct smtp_server_connection *conn,
smtp_server_connection_ready(conn);
}

void smtp_server_connection_start(struct smtp_server_connection *conn)
{
conn->raw_input = conn->conn.input;
conn->raw_output = conn->conn.output;

smtp_server_connection_timeout_start(conn);
smtp_server_connection_input_resume(conn);

if (!conn->ssl_start)
smtp_server_connection_ready(conn);
}

void smtp_server_connection_close(struct smtp_server_connection **_conn,
const char *reason)
{
Expand Down
7 changes: 4 additions & 3 deletions src/lib-smtp/smtp-server.h
Expand Up @@ -295,15 +295,16 @@ smtp_server_connection_create_from_streams(struct smtp_server *server,
void smtp_server_connection_ref(struct smtp_server_connection *conn);
bool smtp_server_connection_unref(struct smtp_server_connection **_conn);

/* Start the connection. Establishes SSL layer immediately if instructed,
and sends the greeting once the connection is ready for commands. */
void smtp_server_connection_start(struct smtp_server_connection *conn);
/* Start the connection with state and data from login service */
void smtp_server_connection_login(struct smtp_server_connection *conn,
const char *username, const char *helo,
const unsigned char *pdata,
unsigned int pdata_len, bool ssl_secured);

/* Start the connection. Establishes SSL layer immediately if instructed,
and sends the greeting once the connection is ready for commands. */
void smtp_server_connection_start(struct smtp_server_connection *conn);

void smtp_server_connection_input_lock(struct smtp_server_connection *conn);
void smtp_server_connection_input_unlock(struct smtp_server_connection *conn);

Expand Down

0 comments on commit b85a1bc

Please sign in to comment.