[asterisk-dev] [Code Review] Introduce ast_careful_fwrite() to avoid partial writes for AMI in trunk/1.6

Russell Bryant russell at digium.com
Fri Dec 19 18:41:31 CST 2008



> On 2008-12-19 17:19:29, vadim wrote:
> > /trunk/main/utils.c, line 1087
> > <http://reviewboard.digium.com/r/104/diff/2/?file=2068#file2068line1087>
> >
> >     Don't we need account for elapsed time here?

You're right about this one.  I'll fix it now.


> On 2008-12-19 17:19:29, vadim wrote:
> > /trunk/main/utils.c, line 1125
> > <http://reviewboard.digium.com/r/104/diff/2/?file=2068#file2068line1125>
> >
> >     and here?

Yes, probably.  However, ast_carefulwrite() has behaved this way for as long as it has existed.  I noticed it (and there is even a comment with the function pointing it out).  However, I figured I would fix the timeout handling in another patch since it's not directly related to this one.

Thanks again for the feedback!


- Russell


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


On 2008-12-19 15:45:40, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/104/
> -----------------------------------------------------------
> 
> (Updated 2008-12-19 15:45:40)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> This patch is very similar to the one for review 99.  This code has the same purpose as ast_carefulwrite(), except it is for writing to a file stream.  The common code between the two functions was broken out into a function, ast_wait_for_output().
> 
> 
> This addresses bug 13546.
>     http://bugs.digium.com/view.php?id=13546
> 
> 
> Diffs
> -----
> 
>   /trunk/include/asterisk/utils.h 166057 
>   /trunk/main/manager.c 166057 
>   /trunk/main/utils.c 166057 
> 
> Diff: http://reviewboard.digium.com/r/104/diff
> 
> 
> Testing
> -------
> 
> Connected to AMI, logged in, watched events
> 
> 
> Thanks,
> 
> Russell
> 
>




More information about the asterisk-dev mailing list