char b[], isize_t bsiz,
int eos)
{
- msg_mclass_t const *mc = msg->m_class;
- msg_href_t const *hr = mc->mc_payload;
+ msg_mclass_t const *mc;
+ msg_href_t const *hr;
msg_header_t *h, *h0;
msg_payload_t *pl;
char *x;
return -1;
assert(!msg->m_chunk);
+ mc = msg->m_class;
+ hr = mc->mc_payload;
if (return_payload == NULL)
return_payload = &h0;
return -1;
append_parsed(msg, mo, hr, h, 0);
- pl = h->sh_payload;
+ pl = (msg_payload_t*)h;
*return_payload = h;
if (bsiz >= body_len) {
else
bsiz = used + n + 1;
+ if (bsiz < msg_min_size) {
+ errno = ENOMEM;
+ su_free(home, b);
+ return NULL;
+ }
+
b2 = su_realloc(home, b, bsiz);
- if (b2 == NULL || bsiz < msg_min_size) {
+ if (b2 == NULL) {
errno = ENOMEM;
su_free(home, b);
return NULL;
msg_header_t **separator;
msg_header_t **payload;
msg_header_t **multipart;
- msg_mclass_t const *mc = msg->m_class;
+ msg_mclass_t const *mc;
msg_header_t **tail, ***ptail;
if (!msg)
serialize_first(msg, h);
+ mc = msg->m_class;
separator = (msg_header_t **)((char *)pub + mc->mc_separator->hr_offset);
payload = (msg_header_t **)((char *)pub + mc->mc_payload->hr_offset);
if (mc->mc_multipart->hr_class)
msg_header_t **head,
msg_header_t *h)
{
- msg_mclass_t const *mc = msg->m_class;
+ msg_mclass_t const *mc;
msg_header_t **hh;
msg_header_t **separator;
msg_header_t **payload;
assert(msg && pub && head && h);
+ mc = msg->m_class;
separator = (msg_header_t **)((char *)pub + mc->mc_separator->hr_offset);
payload = (msg_header_t **)((char *)pub + mc->mc_payload->hr_offset);