[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 15:34:29 CST 2008



> On 2008-12-19 12:13:44, vadim wrote:
> > /trunk/main/utils.c, line 1197
> > <http://reviewboard.digium.com/r/104/diff/1/?file=1975#file1975line1197>
> >
> >     ast_wait_for_output should be called before fflush,  because fflush will provoke write.
> >     
> >     BTW, should't we scrap the fd parameter and retreive it with fileno(f)?
> >

Two more good points.  Both fixed.


> On 2008-12-19 12:13:44, vadim wrote:
> > /trunk/main/utils.c, line 1164
> > <http://reviewboard.digium.com/r/104/diff/1/?file=1975#file1975line1164>
> >
> >     When we iterate here the timeoutms should be smaller than initial one

Good point.  Fixed.


- Russell


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


On 2008-12-19 08:37:35, Russell Bryant wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/104/
> -----------------------------------------------------------
> 
> (Updated 2008-12-19 08:37:35)
> 
> 
> 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 165882 
>   /trunk/main/manager.c 165882 
>   /trunk/main/utils.c 165882 
> 
> 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