miurahr/lua-nginx-osm — pull request #4 by tsufiev (2013-07-07 14:15:10+00:00)
Title: Fix invalid comparison nil < SUCCEDEED

While using lua-nginx-osm together with tirex and mapnik i've got an error:

2013/07/07 17:53:55 [error] 28091#0: *463 lua entry thread aborted: runtime error: ...imur/develop/neosphere-tiles/lua-nginx-osm/osm/tirex.lua:183: attempt to compare nil with number
stack traceback:
coroutine 0:
...imur/develop/neosphere-tiles/lua-nginx-osm/osm/tirex.lua: in function 'get_handle'
...imur/develop/neosphere-tiles/lua-nginx-osm/osm/tirex.lua:368: in function 'enqueue_request'
...imur/develop/neosphere-tiles/lua-nginx-osm/osm/tirex.lua:448: in function 'request'
[string "content_by_lua"]:20: in function <[string "content_by_lua"]:1>, client: 10.20.20.6, server: localhost, request: "GET /osm/16/35351/22253.png HTTP/1.1", host: "wdesktop", referrer: "http://wdesktop/"

It seems to me that prev_flag in get_handle function is '' or something like (i'm not an expert in lua), so nil is obviosly not SUCCEDEED. So i've simply fixed comparison of incomparable types.