Commit 35a260bb 35a260bb8d4b705fb1e190d98ccf99d4e3673594 by Sergey Poznyakoff

(message_size): Bugfix. Retrieve

the header and the body with appropriate calls instead of
addressing corresponding members of the message_t structure.
1 parent 1598ce88
......@@ -462,9 +462,14 @@ message_size (message_t msg, size_t *psize)
return msg->_size (msg, psize);
if (psize)
{
header_t hdr = NULL;
body_t body = NULL;
hsize = bsize = 0;
if ( ( ret = header_size (msg->header, &hsize) ) == 0 )
ret = body_size (msg->body, &bsize);
message_get_header (msg, &hdr);
message_get_body (msg, &body);
if ( ( ret = header_size (hdr, &hsize) ) == 0 )
ret = body_size (body, &bsize);
*psize = hsize + bsize;
}
return ret;
......