Re: [PATCH v3] send-email: --batch-size to work around some SMTP server limit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> 在 2017年5月8日,12:11,Junio C Hamano <gitster@xxxxxxxxx> 写道:
> 
> Two suggestions.
> 
> (1) I do not think $smtp is always valid when we come here; it is
>     unsafe to unconditionally say $smtp->quit like this patch does.
> 
>    $smtp->quit if defined $smtp;
> 
>     may help codepaths like $dry_run and also the case where
>     $smtp_server is the absolute path to a local program.
> 

Hmm,missed this code path.

> (2) You are setting $auth to zero to force re-authentication to
>     happen.  It would be more consistent to the state of $auth that
>     is not-yet-used to "undef $auth;" here instead.  After all, the
>     variable starts its life in an undefined state.
> 
> 
> So all in all
> 
>    $smtp->quit if defined $smtp;
>    undef $smtp;
>    undef $auth;
> 
> perhaps?
> 
> This change of course forces re-authentication every N messages,
> which may not hurt those who use some form of credential helper, but
> that may be something we want to mention in the log message.

Yes, it' s better to undef $auth here. I will update the commit message next version.

Thank you very much for your helpful suggestions !

> 
>> +        sleep($relogin_delay);
>> +    }
>> }
> 
> Thanks.






[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]