summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pop3d.h1
-rw-r--r--session.c5
2 files changed, 2 insertions, 4 deletions
diff --git a/pop3d.h b/pop3d.h
index d2b29d0..1b70163 100644
--- a/pop3d.h
+++ b/pop3d.h
@@ -138,7 +138,6 @@ struct session {
size_t nmsgs;
struct listener *l;
uint32_t id;
- int sock;
int flags;
enum state state;
};
diff --git a/session.c b/session.c
index fb2ae37..aa5d583 100644
--- a/session.c
+++ b/session.c
@@ -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;