big update: hooks and plugins

This commit is contained in:
roberto@sirius
2010-02-07 23:06:24 +01:00
parent a6b42af85a
commit e0882ed8df
12 changed files with 3077 additions and 2230 deletions
+18
View File
@@ -0,0 +1,18 @@
#include "../../uwsgi.h"
void uwsgi_init(struct uwsgi_server *uwsgi){
fprintf(stderr,"i am the example plugin initialization function\n");
}
int uwsgi_request(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req, char *buffer) {
char *http = "HTTP/1.1 200 Ok\r\nContent-type: text/html\r\n\r\n<h1>Hello World</h1>" ;
wsgi_req->response_size += write(uwsgi->poll.fd, http, strlen(http));
return 0;
}
int uwsgi_after_request(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req, char *buffer) {
fprintf(stderr,"i am the example plugin after request function\n");
return 0;
}