I am failing to see a question in your comments. I will assume that your question is along the lines of "why, if HTTP::Tiny has this protection, does not LWP?"
Perhaps you can make a case for it on the mailing list (as found on the LWP documentation page), or create a patch and submit it on the github repository.
| [reply] |
Question is in subject of this topic
| [reply] |
Answer to this question is in the body of the question ;) As you can see from the code it is not handling SIGPIPE itself. On the other hand nothing prevents you from setting handler in your script from which you're using LWP.
| [reply] |
One thing to remember is that SIGPIPE is global for that
program. So, after looking at your examples, my guess is that the authors each had different requirements. GAAS may not have wanted to use SIGPIPE because of its global implications
and requirements, and his usage of syswrite doesn't suggest that LWP isn't SIGPIPE safe. | [reply] |
In HTTP::Tiny example "local $SIG{PIPE}" used, so it handles only sigpipe emitted from the block where it was installed.
May be lwp's syswrite is safe. But I want to know reason why it is safe. For example: syswrite() can't fail if it was called immediately after socket opening and data length for write is small enough.
| [reply] |