send() function failing kills the worker process

cjt72 nginx-forum at
Fri Jun 25 01:46:31 MSD 2010

Hi all, 

I'm making an nginx module to communicate with my database.

I'm trying to use the C send() function in my handler, but it seems that
whenever send() fails it kills the whole process as opposed to just
returning a -1.

In the error log I get "error: network error". 

Is there anyway I can suppress this behavior?

nginx version: nginx/0.8.39
built by gcc 4.2.1 (Apple Inc. build 5659)
configure arguments: --add-module=../nginx-gridfs --with-debug


user  nobody;
worker_processes  1;

error_log  /usr/local/nginx/log  debug;

events {
    worker_connections  1024;

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    gzip  on;

    server {
        listen       80;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;

        error_page  404              /404.html;

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;

        location /gridfs/_id/ {
            gridfs_db test;

Posted at Nginx Forum:,102050,102050#msg-102050

More information about the nginx mailing list