MEDIUM: stream: remove the confusing SF_ADDR_SET flag
This flag is no longer needed now that it must always match the presence
of a destination address on the backend conn_stream. Worse, before previous
patch, if it were to be accidently removed while the address is present, it
could result in a leak of that address since alloc_dst_address() would first
be called to flush it.
Its usage has a long history where addresses were stored in an area shared
with the connection, but as this is no longer the case, there's no reason
for putting this burden onto application-level code that should not focus
on setting obscure flags.
The only place where that made a small difference is in the dequeuing code
in case of queue redistribution, because previously the code would first
clear the flag, and only later when trying to deal with the queue, would
release the address. It's not even certain whether there would exist a
code path going to connect_server() without calling pendconn_dequeue()
first (e.g. retries on queue timeout maybe?).
Now the pendconn_dequeue() code will rely on SF_ASSIGNED to decide to
clear and release the address, since that flag is always set while in
a server's queue, and its clearance implies that we don't want to keep
the address. At least it remains consistent and there's no more risk of
leaking it.
diff --git a/src/dns.c b/src/dns.c
index 29d3cef..e7e42ff 100644
--- a/src/dns.c
+++ b/src/dns.c
@@ -917,7 +917,7 @@
s->csb->dst = addr;
s->csb->flags |= CS_FL_NOLINGER;
s->target = &ds->dss->srv->obj_type;
- s->flags = SF_ASSIGNED|SF_ADDR_SET;
+ s->flags = SF_ASSIGNED;
s->do_log = NULL;
s->uniq_id = 0;