BMessage: fix passing messages by area
I missed the fact that the BDataIO based Unflatten didn't handle this. Restore the code from the recently removed buffer-based unflatten, so it's possible to pass a message by area again.
This commit is contained in:
@@ -1311,6 +1311,14 @@ BMessage::Unflatten(BDataIO* stream)
|
||||
|
||||
what = fHeader->what;
|
||||
|
||||
if ((fHeader->flags & MESSAGE_FLAG_PASS_BY_AREA) != 0
|
||||
&& fHeader->message_area >= 0) {
|
||||
status_t result = _Reference();
|
||||
if (result != B_OK) {
|
||||
_InitHeader();
|
||||
return result;
|
||||
}
|
||||
} else {
|
||||
fHeader->message_area = -1;
|
||||
|
||||
if (fHeader->field_count > 0) {
|
||||
@@ -1325,6 +1333,7 @@ BMessage::Unflatten(BDataIO* stream)
|
||||
if (result != fieldsSize)
|
||||
return result < 0 ? result : B_BAD_VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (fHeader->data_size > 0) {
|
||||
fData = (uint8*)malloc(fHeader->data_size);
|
||||
|
||||
Reference in New Issue
Block a user