MAJOR: connection: move the addr field from the stream_interface
We need to have the source and destination addresses in the connection.
They were lying in the stream interface so let's move them. The flags
SI_FL_FROM_SET and SI_FL_TO_SET have been moved as well.
It's worth noting that tcp_connect_server() almost does not use the
stream interface anymore except for a few flags.
It has been identified that once we detach the connection from the SI,
it will probably be needed to keep a copy of the server-side addresses
in the SI just for logging purposes. This has not been implemented right
now though.
diff --git a/src/session.c b/src/session.c
index b5c7645..0782419 100644
--- a/src/session.c
+++ b/src/session.c
@@ -87,9 +87,7 @@
s->si[0].conn.t.sock.fd = cfd;
s->si[0].conn.ctrl = l->proto;
s->si[0].conn.flags = CO_FL_NONE | CO_FL_NOTIFY_SI; /* we're on a stream_interface */
- s->si[0].addr.from = *addr;
- s->si[0].conn.peeraddr = (struct sockaddr *)&s->si[0].addr.from;
- s->si[0].conn.peerlen = sizeof(s->si[0].addr.from);
+ s->si[0].conn.addr.from = *addr;
s->logs.accept_date = date; /* user-visible date for logging */
s->logs.tv_accept = now; /* corrected date for internal use */
s->uniq_id = totalconn;