Project

General

Profile

Actions

Feature #2141

closed

Magnet enhancement

Added by crypt over 14 years ago. Updated 4 months ago.

Status:
Fixed
Priority:
Low
Category:
mod_magnet
Target version:
-
ASK QUESTIONS IN Forums:
No

Description

lighttpd uses a very simple hash algorithm to create etags. I ported the function "hashme" to lua to be able to create etags also from lua.

Another feature is the lighty variable lighty.env["request.time"] to get the cached time without a syscall.


Files

mod_magnet.patch (1.52 KB) mod_magnet.patch crypt, 2009-12-31 15:00
Actions #1

Updated by gstrauss about 8 years ago

The hashme implementation is incorrect. To correct it, please use (unsigned char *)

const unsigned char *s = (unsigned char *)luaL_checkstring(L, 1);

Actions #2

Updated by gstrauss almost 8 years ago

  • Priority changed from Normal to Low
  • Target version deleted (1.5.0)
Actions #3

Updated by gstrauss almost 8 years ago

  • Status changed from New to Missing Feedback

The functionality of the patch could be done in lua code. Why is there a measurable benefit after taking into account the cost of marshalling across language boundaries?

Actions #4

Updated by gstrauss 4 months ago

  • Status changed from Missing Feedback to Fixed
  • ASK QUESTIONS IN Forums set to No

lighty.c.time() was added to mod_magnet in lighttpd 1.4.60

While lighttpd mod_magnet could expose dekhash or djbhash in lua, that could also be managed as a separate lua module and loaded into your lua script.

If there is a burning need for lighttpd to provide this for you, besides a small bit of convenience, please provide more details.

Actions

Also available in: Atom