MEDIUM: stream: return the stream upon accept()
The function was called stream_accept_session(), let's rename it
stream_new() and make it return the newly allocated pointer. It's
more convenient for some callers who need it.
diff --git a/src/peers.c b/src/peers.c
index 1b0fa10..4899ee7 100644
--- a/src/peers.c
+++ b/src/peers.c
@@ -1140,7 +1140,7 @@
}
t->nice = l->nice;
- if (stream_accept_session(sess, t) <= 0) {
+ if ((s = stream_new(sess, t)) == NULL) {
Alert("Failed to initialize stream in peer_session_create().\n");
goto out_free_task;
}
@@ -1148,7 +1148,6 @@
/* The tasks below are normally what is supposed to be done by
* fe->accept().
*/
- s = t->context; // For now the session is not stored anywhere else :-/
s->flags = SF_ASSIGNED|SF_ADDR_SET;
/* initiate an outgoing connection */