void Log::handle_msg_octets () { int pos = this->dump_target_->add_octets(this->line_, this->offset_); if (this->dump_target_ == &this->unknown_msg_) { for (ACE_DLList_Iterator<Thread> t_iter(this->giop_waiters_); !t_iter.done(); t_iter.advance()) { Thread *th = 0; t_iter.next(th); GIOP_Buffer *waiter = th->giop_target(); if (waiter == 0) continue; if (waiter->matches (this->dump_target_)) { waiter->transfer_from (this->dump_target_); this->dump_target_ = waiter; t_iter.remove(); break; } } } if (pos == -1) // done { Invocation *inv = this->dump_target_->owner(); if (inv != 0) { size_t len = 0; const char *oid = this->dump_target_->target_oid(len); if (oid != 0) inv->set_target (oid, len); } else { if (this->dump_target_ == &this->unknown_msg_) ACE_ERROR ((LM_ERROR, "%d dump ended with no target owner\n", this->offset_)); } this->dump_target_ = 0; this->unknown_msg_.reset(); } }
void Log::parse_cleanup_queue_i (void) { char *hpos = ACE_OS::strchr(this->info_,'['); long handle = ACE_OS::strtol(hpos+1,0,10); PeerProcess *pp = this->hostproc_->find_peer(handle); if (pp == 0) { ACE_ERROR ((LM_ERROR, "%d: cleanup queue, error parsing %C, can't find peer " "for handle %d, text = %s\n", this->offset_, this->origin_.c_str(), handle, this->info_)); return; } Thread *original_thr = this->thr_; GIOP_Buffer *target = original_thr->giop_target(); if (target == 0 || target->owner() != 0) { original_thr = this->hostproc_->find_thread_for_handle (handle); if (original_thr == 0) { ACE_ERROR ((LM_ERROR, "%d: cleanup queue, no original " "thread found, handle %d\n", this->offset_, handle)); return; } target = original_thr->giop_target(); } if (target != 0 && target->cur_size() == 0 && original_thr->has_dup()) { ACE_ERROR ((LM_ERROR, "%d: cleanup queue, swapping targets for thread %d\n", this->offset_, original_thr->id())); original_thr->swap_target(); } original_thr->set_giop_target(0); original_thr->active_handle (0); if (target != 0 && target->owner() == 0) { size_t rid = target->actual_req_id(); char mtype = target->type(); Invocation *inv = pp->find_invocation(rid, handle); if (inv == 0) { ACE_ERROR ((LM_ERROR, "%d: Cleanup queue detected, " "could not find invocation for rid = %d on thread %d\n", this->offset_, rid, original_thr->id())); rid = target->expected_req_id(); inv = pp->find_invocation (rid, handle); if (inv == 0) { ACE_ERROR ((LM_ERROR, "%d, Cleanup queue still failed to find rid %d, on thread %d\n", this->offset_, rid, original_thr->id())); return; } original_thr->exit_wait(pp, this->offset_); mtype = target->expected_type(); } inv->set_octets (mtype == 0, target); size_t len = 0; const char *oid = target->target_oid(len); if (mtype == 0 && len > 0) inv->set_target (oid, len); } }