[asterisk-dev] [Code Review] Make ast_carefulwrite() ... be more careful

Russell Bryant russell at digium.com
Thu Dec 18 15:37:08 CST 2008



> On 2008-12-18 15:35:41, Mark Michelson wrote:
> > Looks good to me. Just make sure to give it a couple of tests since you have changed things around a bit.

Thanks.  I did run it through the same basic tests that I did with the original patch.  It still appears to work.


> On 2008-12-18 15:35:41, Mark Michelson wrote:
> > /branches/1.4/main/utils.c, lines 943-946
> > <http://reviewboard.digium.com/r/99/diff/2/?file=1956#file1956line943>
> >
> >     poll should never set errno to EAGAIN, but checking for it here and accepting it as a valid error doesn't really hurt. I'd leave it in for safety's sake.

Ah yes, nice observation.  I'll leave it in anyway, since it doesn't hurt, like you said.


- Russell


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/99/#review253
-----------------------------------------------------------


On 2008-12-18 15:28:45, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/99/
> -----------------------------------------------------------
> 
> (Updated 2008-12-18 15:28:45)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch was written to address some cases where users of the Asterisk Manager Interface could observe partial writes of messages.  In Asterisk 1.4, the function ast_carefulwrite() is used to write data to the socket.  While the function was sort of careful, it was not careful enough.  This patch addresses the following issues:
> 
> 1) It did not previously handle an error of EINTR from write().
> 2) It did not handle EINTR or EGAIN errors from poll().
> 
> 
> This addresses bug 13546.
>     http://bugs.digium.com/view.php?id=13546
> 
> 
> Diffs
> -----
> 
>   /branches/1.4/main/utils.c 165794 
> 
> Diff: http://reviewboard.digium.com/r/99/diff
> 
> 
> Testing
> -------
> 
> I connected to the AMI, made sure I could still log in, and observed normal looking responses and events.
> 
> 
> Thanks,
> 
> Russell
> 
>




More information about the asterisk-dev mailing list