diff options
author | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-04-11 10:01:18 +0500 |
---|---|---|
committer | Sunil Nimmagadda <sunil@nimmagadda.net> | 2014-04-11 10:01:18 +0500 |
commit | aaf9b53332b4afd163caf8b5b1311247c81bbce9 (patch) | |
tree | 32552588b6f1c6046f35744e4505738edb09af77 | |
parent | b8ce860618b3c173fb0246a723778139983220db (diff) |
Remove redundant sock member in session. io already holds the sock for each session.
-rw-r--r-- | pop3d.h | 1 | ||||
-rw-r--r-- | session.c | 5 |
2 files changed, 2 insertions, 4 deletions
@@ -138,7 +138,6 @@ struct session { size_t nmsgs; struct listener *l; uint32_t id; - int sock; int flags; enum state state; }; @@ -110,11 +110,10 @@ session_init(struct listener *l, int fd) io_init(&s->io, fd, s, session_io, &s->iobuf); io_set_timeout(&s->io, TIMEOUT); s->id = arc4random(); - s->sock = fd; s->state = AUTH; if (s->l->flags & POP3S) { s->flags |= POP3S; - ssl = pop3s_init(ssl_ctx, s->sock); + ssl = pop3s_init(ssl_ctx, fd); io_set_read(&s->io); io_start_tls(&s->io, ssl); return; @@ -283,7 +282,7 @@ auth_command(struct session *s, int cmd, char *args) iobuf_flush(&s->iobuf, s->io.sock); /* add back when IO_TLSREADY. */ SPLAY_REMOVE(session_tree, &sessions, s); - ssl = pop3s_init(ssl_ctx, s->sock); + ssl = pop3s_init(ssl_ctx, s->io.sock); io_set_read(&s->io); io_start_tls(&s->io, ssl); return; |