[OpenSIPS-Devel] [OpenSIPS/opensips] 8d6a96: tcp: don't add conn in TCP main reactor after asyn...

Razvan Crainea razvan at opensips.org
Thu Feb 9 04:10:44 EST 2017


  Branch: refs/heads/1.11
  Home:   https://github.com/OpenSIPS/opensips
  Commit: 8d6a9656dd7408eda7b1c4921ee86104fc3282ba
      https://github.com/OpenSIPS/opensips/commit/8d6a9656dd7408eda7b1c4921ee86104fc3282ba
  Author: Razvan Crainea <razvan at opensips.org>
  Date:   2017-02-09 (Thu, 09 Feb 2017)

  Changed paths:
    M tcp_conn.h
    M tcp_main.c
    M tcp_read.c

  Log Message:
  -----------
  tcp: don't add conn in TCP main reactor after async write

When getting back a TCP connection from a TCP worker after it wrote some
async chunks, we should not add the connection in the reactor for read.
The reason is that the connection might already be polled by a different
process. If the poll triggers for read in the main reactor, the
connection will be assigned to a new process - and we end up having a
connection for read in two different processes reactor - this breaks
connections list and results in double frees and invalid memory access.

Many thanks to Federico Edorna for all the help given to track down this
issue!




More information about the Devel mailing list