Synchronous write

Igor S. ha scritto:

  self->r->connection->write->ready = 1;

When I send a SIGINT signal to nginx during a blocking write operation,
the termination is not “clean”:

[…]

while (rc == NGX_AGAIN && !ngx_quit && !ngx_terminate);

There is still a problem with a:
[crit] 19816#0: *1 writev() failed (14: Bad address), client: 10.0.0.10,
server: localhost, URL: “/wsgi-write/”, host: “localdomain:1234”

The problem may be caused by the memory buffer (owned by Python) being
deallocated when the write function returns and nginx still continues to
write the data.

I have “patched” the code with a:

if (ngx_quit || ngx_terminate) {
b->pos = 0;
b->last = 0;
b->last_buf = 0;
b->memory = 0;
return NULL;
}

Thanks for you support
Manlio P.