lighttpd – Plugin: Overview

插件是各个Web Server的重要组成部分,很多功能通过插件完成(mini_httpd这类超级小的Server当然没有什么插件,网站空间,香港服务器,但它的目的只是实验啊,可不是取代什么Apache这类宏伟目标。说道取代Apache,貌似Nginx是目前…… 算了,还是回到lighttpd吧)。

本文介绍下lighttpd的插件部分的实现。lighttpd版本1.4.31。

1. 数据结构

Lighttpd为每个插件维护一个plugin数据结构,其中包含了插件名,版本号,以及虚函数表和一个保存dlopen(Linux下)返回的非透明句柄。其定义如下,

typedef struct {size_t version;buffer *name; *(* init)();handler_t (* set_defaults)(server *srv, void *p_d);handler_t (* cleanup)(server *srv, void *p_d);handler_t (* handle_trigger)(server *srv, handler_t (* handle_sighup)(server *srv, handler_t (* handle_uri_raw)(server *srv, connection *con, handler_t (* handle_uri_clean)(server *srv, connection *con, handler_t (* handle_docroot)(server *srv, connection *con, handler_t (* handle_physical)(server *srv, connection *con, handler_t (* handle_request_done) (server *srv, connection *con, handler_t (* handle_connection_close)(server *srv, connection *con, handler_t (* handle_joblist)(server *srv, connection *con, handler_t (* handle_subrequest_start)(server *srv, connection *con, void *p_d);/* when a handler for the request* has to be found*/handler_t (* handle_subrequest)(server *srv, connection *con, void *p_d); /* */handler_t (* connection_reset)(server *srv, connection *con, *data;*lib;} plugin;,美国空间想想我的影子,我会在你身后给你一个拥抱;

lighttpd – Plugin: Overview

相关文章:

你感兴趣的文章:

标签云: