Correction to commit 2a4a84a578. We don't check for tailroom but for read space

This commit is contained in:
Ismael Gomez 2018-07-05 10:56:32 +02:00
parent 1248a4224a
commit fae5531bcc
2 changed files with 2 additions and 3 deletions

View File

@ -1193,7 +1193,7 @@ void rlc_am::reassemble_rx_sdus()
} }
if (rx_sdu->get_tailroom() >= len) { if (rx_sdu->get_tailroom() >= len) {
if (rx_window[vr_r].buf->get_tailroom() >= len) { if ((rx_window[vr_r].buf->msg - rx_window[vr_r].buf->buffer) + len < SRSLTE_MAX_BUFFER_SIZE_BYTES) {
memcpy(&rx_sdu->msg[rx_sdu->N_bytes], rx_window[vr_r].buf->msg, len); memcpy(&rx_sdu->msg[rx_sdu->N_bytes], rx_window[vr_r].buf->msg, len);
rx_sdu->N_bytes += len; rx_sdu->N_bytes += len;
rx_window[vr_r].buf->msg += len; rx_window[vr_r].buf->msg += len;
@ -1213,7 +1213,7 @@ void rlc_am::reassemble_rx_sdus()
#endif #endif
} }
} else { } else {
log->error("Cannot read %d bytes from rx_window. vr_r=%d, tailroom=%d bytes\n", len, vr_r, rx_window[vr_r].buf->get_tailroom()); log->error("Cannot read %d bytes from rx_window. vr_r=%d, msg-buffer=%d bytes\n", len, vr_r, (rx_window[vr_r].buf->msg - rx_window[vr_r].buf->buffer));
pool->deallocate(rx_sdu); pool->deallocate(rx_sdu);
goto exit; goto exit;
} }

View File

@ -169,7 +169,6 @@ void phy::run_thread() {
} }
for (uint32_t i=0;i<nof_coworkers;i++) { for (uint32_t i=0;i<nof_coworkers;i++) {
printf("setting coworker for %d/%d\n", i, nof_coworkers);
workers[i].enable_pdsch_coworker(); workers[i].enable_pdsch_coworker();
} }