* Sending a forwarded message that had required a synchronous reply, can now be sent

again with a synchronous reply - the "reply done" flag wasn't cleared before sending.
* Improved error message in case the buffer for flattening the message couldn't be
  allocated. BTW this would be a good place to use the new writev_port() function and
  don't do any allocation at all.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17914 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-06-23 14:44:21 +00:00
parent fb8a578c0a
commit d134f89267
+6 -1
View File
@@ -1888,8 +1888,11 @@ BMessage::_SendMessage(port_id port, int32 token, bigtime_t timeout,
} else { } else {
size = _NativeFlattenedSize(); size = _NativeFlattenedSize();
buffer = (char *)malloc(size); buffer = (char *)malloc(size);
if (buffer != NULL) {
result = _NativeFlatten(buffer, size); result = _NativeFlatten(buffer, size);
header = (message_header *)buffer; header = (message_header *)buffer;
} else
result = B_NO_MEMORY;
} }
if (result < B_OK) if (result < B_OK)
@@ -1905,8 +1908,10 @@ BMessage::_SendMessage(port_id port, int32 token, bigtime_t timeout,
BMessenger::Private replyToPrivate(replyTo); BMessenger::Private replyToPrivate(replyTo);
if (replyRequired) if (replyRequired) {
header->flags |= MESSAGE_FLAG_REPLY_REQUIRED; header->flags |= MESSAGE_FLAG_REPLY_REQUIRED;
header->flags &= ~MESSAGE_FLAG_REPLY_DONE;
}
header->target = token; header->target = token;
header->reply_team = replyToPrivate.Team(); header->reply_team = replyToPrivate.Team();