On Tue, Aug 7, 2012 at 3:47 AM, Ben Noordhuis <i...@bnoordhuis.nl> wrote:
> No, libuv (and node.js) handles that fine. Chances are high that the
> bug is in your application.

After further investigation, valgrind says that it got a SIGPIPE:

==17980== Process terminating with default action of signal 13 (SIGPIPE)
==17980==    at 0x4E380D0: __write_nocancel (syscall-template.S:82)
==17980==    by 0x40AC30: uv__write (stream.c:430)
==17980==    by 0x40B9BA: uv__stream_io (stream.c:752)
==17980==    by 0x4063D2: uv__io_rw (core.c:655)
==17980==    by 0x41B533: ev_invoke_pending (ev.c:2145)
==17980==    by 0x405A45: uv__poll (core.c:248)
==17980==    by 0x405A8F: uv__run (core.c:257)
==17980==    by 0x405AED: uv_run (core.c:265)
==17980==    by 0x405040: main (webserver.c:174)


So my guess is that my program get signalled when the client
prematurely terminates the connection?
So, I should handle SIGPIPE error in my application?
Is this handled by libuv?
Is there a callback in libuv to tell us to stop writing when the
client terminates prematurely?


BTW, I found an interesting discussion about SIGPIPE:

http://piscisaureus.no.de/libuv/2011-09-09

"21:27:33       <bnoordhuis>    ryah: you still get the SIGPIPE but node won't
crash anymore"

So, how does node.js handle that SIGPIPE?


Felix Halim

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to