| 338 | } |
| 339 | |
| 340 | OpenDDS_FACE_Export |
| 341 | void receive_header(/*in*/ FACE::CONNECTION_ID_TYPE connection_id, |
| 342 | /*in*/ FACE::TIMEOUT_TYPE /*timeout*/, |
| 343 | /*inout*/ FACE::TRANSACTION_ID_TYPE& transaction_id, |
| 344 | /*inout*/ FACE::TS::MessageHeader& message_header, |
| 345 | /*in*/ FACE::MESSAGE_SIZE_TYPE message_size, |
| 346 | /*out*/ FACE::RETURN_CODE_TYPE& return_code) |
| 347 | { |
| 348 | try { |
| 349 | Entities::ConnIdToReceiverMap& readers = |
| 350 | Entities::instance()->receivers_; |
| 351 | // transaction_id cannot be 0 due to initialization |
| 352 | // of last_msg_tid to 0 before a msg has been received so |
| 353 | // only valid transaction_ids are > 0. |
| 354 | if (!readers.count(connection_id) || transaction_id == 0) { |
| 355 | if (OpenDDS::DCPS::DCPS_debug_level > 3) { |
| 356 | ACE_DEBUG((LM_DEBUG, "(%P|%t) receive_header - INVALID_PARAM - " |
| 357 | "could not find reader for connection_id: %d OR transaction id[%d] == 0\n", |
| 358 | connection_id, |
| 359 | transaction_id)); |
| 360 | } |
| 361 | return_code = FACE::INVALID_PARAM; |
| 362 | return; |
| 363 | } |
| 364 | |
| 365 | if (message_size < 0 || (unsigned)message_size < sizeof(FACE::TS::MessageHeader)) { |
| 366 | if (OpenDDS::DCPS::DCPS_debug_level) { |
| 367 | ACE_DEBUG((LM_DEBUG, "(%P|%t) receive_header - INVALID_PARAM - message_size: %d is < %d\n", |
| 368 | message_size, |
| 369 | sizeof(FACE::TS::MessageHeader))); |
| 370 | } |
| 371 | return_code = FACE::INVALID_PARAM; |
| 372 | return; |
| 373 | } |
| 374 | if (transaction_id == readers[connection_id]->last_msg_tid) { |
| 375 | message_header = readers[connection_id]->last_msg_header; |
| 376 | return_code = OpenDDS::FaceTSS::update_status(connection_id, DDS::RETCODE_OK); |
| 377 | } else { |
| 378 | return_code = OpenDDS::FaceTSS::update_status(connection_id, DDS::RETCODE_BAD_PARAMETER); |
| 379 | } |
| 380 | } catch (const CORBA::BAD_PARAM&) { |
| 381 | if (OpenDDS::DCPS::DCPS_debug_level) { |
| 382 | ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: receive_header - INVALID_PARAM\n")); |
| 383 | } |
| 384 | return_code = INVALID_PARAM; |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | void Receive_Message( |
| 389 | /* in */ CONNECTION_ID_TYPE connection_id, |
no test coverage detected