| 424 | } |
| 425 | |
| 426 | void message_ex::write_commit(size_t size) |
| 427 | { |
| 428 | // printf("%p %s\n", this, __FUNCTION__); |
| 429 | CHECK(!this->_rw_committed, |
| 430 | "there are no pending msg write to be committed" |
| 431 | ", please invoke dsn_msg_write_next and dsn_msg_write_commit in pairs"); |
| 432 | |
| 433 | this->_rw_offset += (int)size; |
| 434 | *this->buffers.rbegin() = this->buffers.rbegin()->range(0, (int)this->_rw_offset); |
| 435 | this->_rw_committed = true; |
| 436 | this->header->body_length += (int)size; |
| 437 | } |
| 438 | |
| 439 | bool message_ex::read_next(void **ptr, size_t *size) |
| 440 | { |