[FFmpeg-devel] [PATCH] TLS OPENSSL SSL_get_error

LANGLOIS Olivier PIS -EXT olivier.pis.langlois at transport.alstom.com
Wed Aug 28 16:34:15 CEST 2013



> -----Original Message-----
> From: ffmpeg-devel-bounces at ffmpeg.org [mailto:ffmpeg-devel-
> bounces at ffmpeg.org] On Behalf Of Mirko Puliafito
> Sent: Wednesday, August 28, 2013 7:53 AM
> To: ffmpeg-devel
> Subject: Re: [FFmpeg-devel] [PATCH] TLS OPENSSL SSL_get_error
>
> Sorry,
>
> the specific case is SSL_ERROR_SYSCALL with errno EAGAIN. The patch could
> be - line 85:
>
> ret = SSL_get_error(c->ssl, ret);
>  if (ret == SSL_ERROR_WANT_READ) {
> p.events = POLLIN;
> } else if (ret == SSL_ERROR_WANT_WRITE) {  p.events = POLLOUT; } else {
> if(errno == EAGAIN)  return AVERROR(EAGAIN); av_log(h, AV_LOG_ERROR,
> "%s\n", ERR_error_string(ERR_get_error(), NULL));  return AVERROR(EIO); }
>
> What do you think?
>
1. just a question of taste but I would find using a switch case cleaner.
2. SSL_get_error can return other values than just the 3 handled. (ie: SSL_ERROR_SSL which is probably unrecoverable). I would be explicitly checking for SSL_ERROR_SYSCALL.
3. and possibly handle all the other possible return values with a default case with some generic handling.


________________________________
CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium.


More information about the ffmpeg-devel mailing list