fixes forwards of BMessages

iroster now works successfully


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11367 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval
2005-02-14 11:47:55 +00:00
parent 3a85b92372
commit 0d0f1600ef
2 changed files with 12 additions and 10 deletions
+7 -1
View File
@@ -1899,6 +1899,12 @@ PRINT(("BMessage::_send_(port: %ld, token: %ld, preferred: %d): "
tmp_msg.fReplyRequired = fReplyRequired; tmp_msg.fReplyRequired = fReplyRequired;
tmp_msg.fReplyTo = fReplyTo; tmp_msg.fReplyTo = fReplyTo;
if (!reply_to.IsValid()) {
BMessenger::Private(reply_to).SetTo(fReplyTo.team, fReplyTo.port, fReplyTo.target, fReplyTo.preferred);
if (!reply_to.IsValid())
reply_to = be_app_messenger;
}
BMessage* self = const_cast<BMessage*>(this); BMessage* self = const_cast<BMessage*>(this);
BMessenger::Private replyToPrivate(reply_to); BMessenger::Private replyToPrivate(reply_to);
self->fPreferred = preferred; self->fPreferred = preferred;
@@ -1925,7 +1931,7 @@ PRINT(("BMessage::_send_(port: %ld, token: %ld, preferred: %d): "
} }
self->fPreferred = tmp_msg.fPreferred; self->fPreferred = tmp_msg.fPreferred;
self->fTarget = tmp_msg.fTarget; self->fTarget = tmp_msg.fTarget;
self->fReplyRequired = tmp_msg.fReplyRequired; self->fReplyRequired = false; //tmp_msg.fReplyRequired;
self->fReplyTo = tmp_msg.fReplyTo; self->fReplyTo = tmp_msg.fReplyTo;
tmp_msg.init_data(); tmp_msg.init_data();
PRINT(("BMessage::_send_() done: %lx\n", err)); PRINT(("BMessage::_send_() done: %lx\n", err));
+4 -8
View File
@@ -350,16 +350,12 @@ status_t
BMessenger::SendMessage(BMessage *message, BMessenger replyTo, BMessenger::SendMessage(BMessage *message, BMessenger replyTo,
bigtime_t timeout) const bigtime_t timeout) const
{ {
status_t error = (message ? B_OK : B_BAD_VALUE); if (!message)
if (error == B_OK) { return B_BAD_VALUE;
// If the reply messenger is invalid use the app messenger.
if (!replyTo.IsValid()) return message->_send_(fPort, fHandlerToken, fPreferredTarget,
replyTo = be_app_messenger;
error = message->_send_(fPort, fHandlerToken, fPreferredTarget,
timeout, false, replyTo); timeout, false, replyTo);
} }
return error;
}
// SendMessage // SendMessage
/*! \brief Delivers a BMessage synchronously to the messenger's target and /*! \brief Delivers a BMessage synchronously to the messenger's target and