introduced open PSGI plugin for uWSGI

This commit is contained in:
roberto@sirius
2010-04-13 08:39:49 +02:00
parent 8caee1b15b
commit 299fd9cf8a
5 changed files with 396 additions and 6 deletions
+3 -5
View File
@@ -1,17 +1,15 @@
#include "../../uwsgi.h"
/* gcc `python-config --cflags` `python ../../uwsgiconfig.py --cflags` -o example_plugin.so -fPIC -shared example_plugin.c */
int uwsgi_init(struct uwsgi_server *uwsgi, char *args){
fprintf(stderr,"i am the example plugin initialization function with arg: %s\n", args);
return 0;
}
int uwsgi_request(struct uwsgi_server *uwsgi, struct wsgi_request *wsgi_req) {
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));
fprintf(stderr,"UWSGI POLL: %p\n", &uwsgi->poll);
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(wsgi_req->poll.fd, http, strlen(http));
return 0;
}