From d134f89267ec0d41f1d10fd29e79126c5c0caa3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 23 Jun 2006 14:44:21 +0000 Subject: [PATCH] * 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 --- src/kits/app/Message.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/kits/app/Message.cpp b/src/kits/app/Message.cpp index 9e7a267ffa..d812abd33d 100644 --- a/src/kits/app/Message.cpp +++ b/src/kits/app/Message.cpp @@ -1888,8 +1888,11 @@ BMessage::_SendMessage(port_id port, int32 token, bigtime_t timeout, } else { size = _NativeFlattenedSize(); buffer = (char *)malloc(size); - result = _NativeFlatten(buffer, size); - header = (message_header *)buffer; + if (buffer != NULL) { + result = _NativeFlatten(buffer, size); + header = (message_header *)buffer; + } else + result = B_NO_MEMORY; } if (result < B_OK) @@ -1905,9 +1908,11 @@ BMessage::_SendMessage(port_id port, int32 token, bigtime_t timeout, BMessenger::Private replyToPrivate(replyTo); - if (replyRequired) + if (replyRequired) { header->flags |= MESSAGE_FLAG_REPLY_REQUIRED; - + header->flags &= ~MESSAGE_FLAG_REPLY_DONE; + } + header->target = token; header->reply_team = replyToPrivate.Team(); header->reply_port = replyToPrivate.Port();