Branch: Tag:

2020-02-17

2020-02-17 16:14:05 by Stephen R. van den Berg <srb@cuci.nl>

pgsql: Avoid output_to() race on large requests.

565:    add(PGFLUSH);    case SENDOUT:;    } -  if (towrite = sizeof(this)) { +  Thread.MutexKey lock = shortmux->trylock(); +  if (lock && (towrite = sizeof(this))) {    PD("%d>Sendcmd %O\n",    socket->query_fd(), ((string)this)[..towrite-1]);    towrite -= output_to(socket, towrite);