Node monitoring didn't work because unflattening KMessages didn't take the

message header into account. It worked before at some point as BLooper was
letting the looper handle messages to invalid targets - they are now just
dropped.
This fixes bug #93.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-23 13:30:17 +00:00
parent 81a02ebcfa
commit 05b4b0d7ce
2 changed files with 15 additions and 1 deletions

View File

@ -26,6 +26,14 @@ class BMessage::Private {
fMessage->fPreferred = token == B_PREFERRED_TOKEN;
}
inline void SetReply(team_id team, port_id port, int32 token)
{
fMessage->fReplyTo.port = port;
fMessage->fReplyTo.target = token;
fMessage->fReplyTo.team = team;
fMessage->fReplyTo.preferred = token == B_PREFERRED_TOKEN;
}
inline void SetReply(BMessenger messenger)
{
BMessenger::Private mp(messenger);

View File

@ -38,6 +38,7 @@
#include <DataBuffer.h>
#include <KMessage.h>
#include <MessageBody.h>
#include <MessagePrivate.h>
#include <MessageUtils.h>
#include <TokenSpace.h>
@ -2171,9 +2172,14 @@ convert_message(const KMessage *fromMessage, BMessage *toMessage)
if (!fromMessage || !toMessage)
return B_BAD_VALUE;
// make empty and init what of the target message
// make empty and init the header of the target message
toMessage->MakeEmpty();
toMessage->what = fromMessage->What();
BMessage::Private toPrivate(toMessage);
toPrivate.SetTarget(fromMessage->TargetToken());
toPrivate.SetReply(B_SYSTEM_TEAM, fromMessage->ReplyPort(),
fromMessage->ReplyToken());
// iterate through the fields and import them in the target message
KMessageField field;