avoid passing stack vars by reference in callbacks

This commit is contained in:
Francisco Paisana 2019-11-19 17:15:03 +00:00
parent e8487211e4
commit 151159e2c6
1 changed files with 2 additions and 2 deletions

View File

@ -246,7 +246,7 @@ void enb_stack_lte::remove_mme_socket(int fd)
void enb_stack_lte::add_gtpu_s1u_socket_handler(int fd)
{
auto gtpu_s1u_handler = [this](srslte::unique_byte_buffer_t pdu, const sockaddr_in& from) {
auto task_handler = [this, &from](task_t* t) { gtpu.handle_gtpu_s1u_rx_packet(std::move(t->pdu), from); };
auto task_handler = [this, from](task_t* t) { gtpu.handle_gtpu_s1u_rx_packet(std::move(t->pdu), from); };
pending_tasks.push(gtpu_queue_id, task_t{task_handler, std::move(pdu)});
};
rx_sockets->add_socket_pdu_handler(fd, gtpu_s1u_handler);
@ -255,7 +255,7 @@ void enb_stack_lte::add_gtpu_s1u_socket_handler(int fd)
void enb_stack_lte::add_gtpu_m1u_socket_handler(int fd)
{
auto gtpu_m1u_handler = [this](srslte::unique_byte_buffer_t pdu, const sockaddr_in& from) {
auto task_handler = [this, &from](task_t* t) { gtpu.handle_gtpu_m1u_rx_packet(std::move(t->pdu), from); };
auto task_handler = [this, from](task_t* t) { gtpu.handle_gtpu_m1u_rx_packet(std::move(t->pdu), from); };
pending_tasks.push(gtpu_queue_id, task_t{task_handler, std::move(pdu)});
};
rx_sockets->add_socket_pdu_handler(fd, gtpu_m1u_handler);