Commit 71da3446 71da34463c159d4bff5687e6cc4bc5e2a589f314 by Sergey Poznyakoff

Added message_stream_size().

1 parent 5d0daf09
...@@ -44,6 +44,7 @@ static int message_sender __P ((envelope_t envelope, char *buf, size_t len, ...@@ -44,6 +44,7 @@ static int message_sender __P ((envelope_t envelope, char *buf, size_t len,
44 size_t *pnwrite)); 44 size_t *pnwrite));
45 static int message_date __P ((envelope_t envelope, char *buf, size_t len, 45 static int message_date __P ((envelope_t envelope, char *buf, size_t len,
46 size_t *pnwrite)); 46 size_t *pnwrite));
47 static int message_stream_size __P((stream_t stream, off_t *psize));
47 48
48 /* Allocate ressources for the message_t. */ 49 /* Allocate ressources for the message_t. */
49 int 50 int
...@@ -333,6 +334,7 @@ message_get_stream (message_t msg, stream_t *pstream) ...@@ -333,6 +334,7 @@ message_get_stream (message_t msg, stream_t *pstream)
333 stream_set_read (stream, message_read, msg); 334 stream_set_read (stream, message_read, msg);
334 stream_set_write (stream, message_write, msg); 335 stream_set_write (stream, message_write, msg);
335 stream_set_fd (stream, message_get_fd, msg); 336 stream_set_fd (stream, message_get_fd, msg);
337 stream_set_size (stream, message_stream_size, msg);
336 stream_set_flags (stream, MU_STREAM_RDWR); 338 stream_set_flags (stream, MU_STREAM_RDWR);
337 msg->stream = stream; 339 msg->stream = stream;
338 } 340 }
...@@ -857,6 +859,13 @@ message_get_fd (stream_t stream, int *pfd) ...@@ -857,6 +859,13 @@ message_get_fd (stream_t stream, int *pfd)
857 return stream_get_fd (is, pfd); 859 return stream_get_fd (is, pfd);
858 } 860 }
859 861
862 int
863 message_stream_size (stream_t stream, off_t *psize)
864 {
865 message_t msg = stream_get_owner (stream);
866 return message_size (msg, (size_t*) psize);
867 }
868
860 static int 869 static int
861 message_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite) 870 message_date (envelope_t envelope, char *buf, size_t len, size_t *pnwrite)
862 { 871 {
......