| 26 | } |
| 27 | |
| 28 | int zmq::raw_decoder_t::decode (const uint8_t *data_, |
| 29 | size_t size_, |
| 30 | size_t &bytes_used_) |
| 31 | { |
| 32 | const int rc = |
| 33 | _in_progress.init (const_cast<unsigned char *> (data_), size_, |
| 34 | shared_message_memory_allocator::call_dec_ref, |
| 35 | _allocator.buffer (), _allocator.provide_content ()); |
| 36 | |
| 37 | // if the buffer serves as memory for a zero-copy message, release it |
| 38 | // and allocate a new buffer in get_buffer for the next decode |
| 39 | if (_in_progress.is_zcmsg ()) { |
| 40 | _allocator.advance_content (); |
| 41 | _allocator.release (); |
| 42 | } |
| 43 | |
| 44 | errno_assert (rc != -1); |
| 45 | bytes_used_ = size_; |
| 46 | return 1; |
| 47 | } |
nothing calls this directly
no test coverage detected