Static ETags

2 views
Skip to first unread message

trojan2748

unread,
Mar 16, 2012, 11:29:02 AM3/16/12
to ng...@nginx.org
Hi Everyone,
I had a look at the Static Etag 3rd party module, and noticed a few
things:

1) There is a memory leak, a malloc() requesting 1000 bytes is called,
but never free()'d
2) Doesn't check headers from client to see if there is a
"If-None-Matched:" header, so all it does is generate etags, never
checks
3) Not very robust.

I've written the author Mike West a couple of times but got no reply. So
I took it upon myself to fix. Below is the github with the fixed
version. This is my first nginx module, so please critique as much as
you can. I'm still getting acquainted with the code.

https://github.com/trojan2748/NginX-Etags

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,223971,223971#msg-223971

_______________________________________________
nginx mailing list
ng...@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Valentin V. Bartenev

unread,
Mar 16, 2012, 12:13:33 PM3/16/12
to ng...@nginx.org
On Friday 16 March 2012 19:29:02 trojan2748 wrote:
> Hi Everyone,
> I had a look at the Static Etag 3rd party module, and noticed a few
> things:
>
> 1) There is a memory leak, a malloc() requesting 1000 bytes is called,
> but never free()'d
> 2) Doesn't check headers from client to see if there is a
> "If-None-Matched:" header, so all it does is generate etags, never
> checks
> 3) Not very robust.
>
> I've written the author Mike West a couple of times but got no reply. So
> I took it upon myself to fix. Below is the github with the fixed
> version. This is my first nginx module, so please critique as much as
> you can. I'm still getting acquainted with the code.
>
> https://github.com/trojan2748/NginX-Etags
>

A cursory examination shows a large number of problems with the code. But
the most serious one is that your module just block nginx on fread(), which
will completely kill the performance.

wbr, Valentin V. Bartenev

Reply all
Reply to author
Forward
0 new messages