1
1

Handle zero-length iovecs in multicast messages

This commit was SVN r22507.
Этот коммит содержится в:
Ralph Castain 2010-01-28 15:29:43 +00:00
родитель 5dc71d85ed
Коммит 86dd1d41af
2 изменённых файлов: 32 добавлений и 22 удалений

Просмотреть файл

@ -383,12 +383,14 @@ process:
ORTE_ERROR_LOG(rc);
goto cleanup;
}
if (0 < tmp32) {
/* pack the bytes */
if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, snd->iovec_array[sz].iov_base, tmp32, OPAL_UINT8))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
}
}
} else {
/* flag it as being a buffer */
@ -978,15 +980,18 @@ static void process_recv(int fd, short event, void *cbdata)
ORTE_ERROR_LOG(rc);
goto cleanup;
}
iovec_array[i].iov_base = NULL;
iovec_array[i].iov_len = sz;
if (0 < sz) {
/* allocate the space */
iovec_array[i].iov_base = (uint8_t*)malloc(sz);
iovec_array[i].iov_len = sz;
/* unpack the data */
if (ORTE_SUCCESS != (rc = opal_dss.unpack(buf, iovec_array[i].iov_base, &sz, OPAL_UINT8))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
}
}
} else if (1 == flag && NULL == recvd_buf) {
/* buffer was included */
recvd_buf = OBJ_NEW(opal_buffer_t);

Просмотреть файл

@ -872,15 +872,18 @@ static void process_recv(int fd, short event, void *cbdata)
ORTE_ERROR_LOG(rc);
goto cleanup;
}
iovec_array[i].iov_base = NULL;
iovec_array[i].iov_len = sz;
if (0 < sz) {
/* allocate the space */
iovec_array[i].iov_base = (uint8_t*)malloc(sz);
iovec_array[i].iov_len = sz;
/* unpack the data */
if (ORTE_SUCCESS != (rc = opal_dss.unpack(&buf, iovec_array[i].iov_base, &sz, OPAL_UINT8))) {
ORTE_ERROR_LOG(rc);
goto cleanup;
}
}
}
} else if (1 == flag && NULL == recvd_buf) {
/* buffer was included */
recvd_buf = OBJ_NEW(opal_buffer_t);
@ -1220,12 +1223,14 @@ static void xmit_data(int sd, short flags, void* send_req)
ORTE_ERROR_LOG(rc);
goto CLEANUP;
}
if (0 < tmp32) {
/* pack the bytes */
if (ORTE_SUCCESS != (rc = opal_dss.pack(&buf, snd->iovec_array[sz].iov_base, tmp32, OPAL_UINT8))) {
ORTE_ERROR_LOG(rc);
goto CLEANUP;
}
}
}
/* unload the working buf to obtain the payload */
if (ORTE_SUCCESS != (rc = opal_dss.unload(&buf, (void**)&bytes, &sz))) {