Welcome! Log In Create A New Profile

Advanced

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

Maxim Dounin
October 26, 2016 01:58PM
Hello!

On Thu, Oct 27, 2016 at 12:40:21AM +0800, 胡聪 (hucc) wrote:

> Hello!
>
> On Wed, Oct 26, 2016 at 8:31PM, Maxim Dounin wrote:
>
> >On Wed, Oct 26, 2016 at 05:10:25PM +0800, 胡聪 (hucc) wrote:
> >
> >> VOD (video on demand) module which support requesting time range
> >> also need the special function, so i would like to see that nginx-devel
> >> add a function in Core, that would be helpful. Possible patch below.
> >
> >If you mean https://github.com/kaltura/nginx-vod-module, then I
> >don't think it does. Quick look suggests that it uses
> >milliseconds to specify times instead, and uses ngx_atoi() to
> >parse them. It doesn't use strtod() at all, and the only place it
> >uses ngx_atofp() now is to parse rate, and I don't think there are
> >reasons to allow arbitrary numbers like in the mp4 case.
> >
> >The main problem with mp4 was that there were existing Flash
> >clients nginx has to be compatible with, and some of them used to
> >send incorrect start time specifications. It is highly unlikely
> >that the same unique situation affects other modules.
>
> I don`t know how to make a more specific description because of my
> poor english. What i mean about VOD is video-processing module in
> CDN provider, this scenario usually be asked to provide parameter
> parsing which support seconds and milliseconds. I am developing a
> series of moudles which are a bit like nginx-vod-module and new
> function will be used based on my experience. I just think the usage
> of atofp() is very limited, maybe a function supporting optional mode
> should be provided. Anyway, the point is whether other modules
> need new function, i pointed out the scene i familiar with and hope
> this helps.

There is no problem with parsing seconds and milliseconds using
ngx_atofp(). The problem with ngx_atofp() only appears if you
have to support existing clients who already use invalid syntax.
Unless you have to support such clients - you'd better use generic
ngx_atofp() and reject attempts to use invalid syntax in the
arguments.

--
Maxim Dounin
http://nginx.org/

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

月耳 413 October 13, 2016 04:48AM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

Maxim Dounin 148 October 18, 2016 02:28PM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

胡聪 (hucc) 172 October 19, 2016 02:46AM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

Maxim Dounin 237 October 25, 2016 03:36PM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

胡聪 (hucc) 141 October 26, 2016 05:12AM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

Maxim Dounin 144 October 26, 2016 08:32AM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

胡聪 (hucc) 155 October 26, 2016 05:48AM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

胡聪 (hucc) 142 October 26, 2016 12:42PM

Re: [patch][bugfix]Http mp4: replace strtod() with improved ngx_atofp() because precision problem.

Maxim Dounin 167 October 26, 2016 01:58PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready