Fix alignment of recieved packet
GitOrigin-RevId: 8cbb24dabb7cf8050cecd47364df496b122db559
This commit is contained in:
parent
4aa5b0af02
commit
b44c7cfcb8
@ -64,6 +64,12 @@ Status RawConnection::flush_read(const AuthKey &auth_key, Callback &callback) {
|
|||||||
BufferSlice packet;
|
BufferSlice packet;
|
||||||
uint32 quick_ack = 0;
|
uint32 quick_ack = 0;
|
||||||
TRY_RESULT(wait_size, transport_->read_next(&packet, &quick_ack));
|
TRY_RESULT(wait_size, transport_->read_next(&packet, &quick_ack));
|
||||||
|
if (!is_aligned_pointer<4>(packet.as_slice().ubegin())) {
|
||||||
|
BufferSlice new_packet(packet.size());
|
||||||
|
new_packet.as_slice().copy_from(packet.as_slice());
|
||||||
|
packet = std::move(new_packet);
|
||||||
|
}
|
||||||
|
CHECK(is_aligned_pointer<4>(packet.as_slice().ubegin()));
|
||||||
if (wait_size != 0) {
|
if (wait_size != 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user