| 768 | |
| 769 | template<typename Protocol> |
| 770 | bool client_endpoint_impl<Protocol>::check_queue_limit(const uint8_t* _data, std::uint32_t _size) const { |
| 771 | |
| 772 | if (endpoint_impl<Protocol>::queue_limit_ != QUEUE_SIZE_UNLIMITED |
| 773 | && (queue_size_ + _size > endpoint_impl<Protocol>::queue_limit_ || queue_size_ + _size < _size)) { // overflow protection |
| 774 | service_t its_service(0); |
| 775 | method_t its_method(0); |
| 776 | client_t its_client(0); |
| 777 | session_t its_session(0); |
| 778 | if (_size >= VSOMEIP_SESSION_POS_MAX) { |
| 779 | // this will yield wrong IDs for local communication as the commands |
| 780 | // are prepended to the actual payload |
| 781 | // it will print: |
| 782 | // (lowbyte service ID + highbyte methoid) |
| 783 | // [(Command + lowerbyte sender's client ID). |
| 784 | // highbyte sender's client ID + lowbyte command size. |
| 785 | // lowbyte methodid + highbyte vsomeip length] |
| 786 | its_service = bithelper::read_uint16_be(&_data[VSOMEIP_SERVICE_POS_MIN]); |
| 787 | its_method = bithelper::read_uint16_be(&_data[VSOMEIP_METHOD_POS_MIN]); |
| 788 | its_client = bithelper::read_uint16_be(&_data[VSOMEIP_CLIENT_POS_MIN]); |
| 789 | its_session = bithelper::read_uint16_be(&_data[VSOMEIP_SESSION_POS_MIN]); |
| 790 | } |
| 791 | VSOMEIP_ERROR_P << "Queue size limit (" << endpoint_impl<Protocol>::queue_limit_ << ") reached. Dropping message (" |
| 792 | << hex4(its_client) << "): [" << hex4(its_service) << "." << hex4(its_method) << "." << hex4(its_session) << "] " |
| 793 | << "queue_size: " << queue_size_ << " data size: " << _size; |
| 794 | return false; |
| 795 | } |
| 796 | return true; |
| 797 | } |
| 798 | |
| 799 | template<typename Protocol> |
| 800 | void client_endpoint_impl<Protocol>::queue_train(const std::shared_ptr<train>& _train) { |