diff options
Diffstat (limited to 'lib/stream.c')
-rw-r--r-- | lib/stream.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/stream.c b/lib/stream.c index f6ea8496f..5959309c6 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -278,8 +278,10 @@ stream_close(struct stream *stream) { if (stream != NULL) { char *name = stream->name; + char *peer_id = stream->peer_id; (stream->class->close)(stream); free(name); + free(peer_id); } } @@ -430,6 +432,19 @@ stream_send_wait(struct stream *stream) stream_wait(stream, STREAM_SEND); } +void +stream_set_peer_id(struct stream *stream, const char *peer_id) +{ + free(stream->peer_id); + stream->peer_id = xstrdup(peer_id); +} + +const char * +stream_get_peer_id(const struct stream *stream) +{ + return stream->peer_id; +} + /* Given 'name', a pstream name in the form "TYPE:ARGS", stores the class * named "TYPE" into '*classp' and returns 0. Returns EAFNOSUPPORT and stores * a null pointer into '*classp' if 'name' is in the wrong form or if no such |