[mod_magnet] fix regression in lighty.stat (fixes #2877)

fix regression in mod_magnet lighty.stat introduced in lighttpd 1.4.49
in commit commit:b1df38ab

x-ref:
  "lighty.stat failure"
  https://redmine.lighttpd.net/issues/2877
personal/stbuehler/fix-fdevent
Glenn Strauss 2018-03-17 11:57:50 -04:00
parent e21906b3b4
commit 86f64a0288
1 changed files with 4 additions and 2 deletions

View File

@ -334,14 +334,16 @@ static int magnet_stat(lua_State *L) {
handler_t res;
res = stat_cache_get_entry(srv, con, sb, &sce);
stat_cache_content_type_get(srv, con, sb, sce);
buffer_free(sb);
if (HANDLER_GO_ON != res) {
buffer_free(sb);
lua_pushnil(L);
return 1;
}
stat_cache_content_type_get(srv, con, sb, sce);
buffer_free(sb);
lua_newtable(L); // return value
lua_pushboolean(L, S_ISREG(sce->st.st_mode));