Commit 0aaf6a71 0aaf6a71627fdaff310296269f35e235478b01f4 by Sergey Poznyakoff

(_tls_get_fd): New function.

(tls_stream_create): Install _get_fd method
1 parent 4895e88d
......@@ -366,6 +366,15 @@ _tls_strerror (stream_t stream, const char **pstr)
return 0;
}
/* FIXME: It returns only input fd */
int
_tls_get_fd (stream_t stream, int *pfd)
{
struct _tls_stream *s = stream_get_owner (stream);
*pfd = s->ifd;
return 0;
}
int
tls_stream_create (stream_t *stream, int in_fd, int out_fd, int flags)
{
......@@ -397,6 +406,7 @@ tls_stream_create (stream_t *stream, int in_fd, int out_fd, int flags)
stream_set_flush (*stream, _tls_flush, s);
stream_set_destroy (*stream, _tls_destroy, s);
stream_set_strerror (*stream, _tls_strerror, s);
stream_set_fd (*stream, _tls_get_fd, s);
s->state = state_init;
return 0;
......