new option --http-modifer1

This commit is contained in:
roberto@sirius
2010-10-17 12:25:50 +02:00
parent aaa6033c2a
commit 53ccd3d4b8
5 changed files with 19 additions and 1 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ static void *http_request(void *u_h_r)
int path_info_len;
char *ip;
up[0] = 5;
up[0] = uwsgi.http_modifier1;
up[3] = 0;
up += 4;
View File
+12
View File
@@ -6,6 +6,10 @@
static PerlInterpreter *my_perl;
static SV *psgi_func ;
#ifdef UWSGI_THREADING
pthread_key_t uwsgi_perl_interpreter;
#endif
extern char **environ;
extern struct uwsgi_server uwsgi;
@@ -107,6 +111,14 @@ int uwsgi_init(char *args){
http_sc->message_size = strlen(http_sc->message);
}
#ifdef UWSGI_THREADING
if (uwsgi.threads > 1) {
if (pthread_key_create(&uwsgi_perl_interpreter, NULL)) {
uwsgi_error("pthread_key_create()");
exit(1);
}
}
#endif
PL_origalen = 1;
perl_parse(my_perl, xs_init, 4, embedding, NULL);
+4
View File
@@ -165,6 +165,7 @@ static struct option long_options[] = {
{"http", required_argument, 0, LONG_ARGS_HTTP},
{"http-only", no_argument, &uwsgi.http_only, 1},
{"http-var", required_argument, 0, LONG_ARGS_HTTP_VAR},
{"http-modifier1", required_argument, 0, LONG_ARGS_HTTP_MODIFIER1},
#endif
{"catch-exceptions", no_argument, &uwsgi.catch_exceptions, 1},
{"close-on-exec", no_argument, &uwsgi.close_on_exec, 1},
@@ -2210,6 +2211,9 @@ void manage_opt(int i, char *optarg) {
uwsgi_log( "you can specify at most 64 --http-var options\n");
}
break;
case LONG_ARGS_HTTP_MODIFIER1:
uwsgi.http_modifier1 = (uint8_t) atoi(optarg);
break;
#endif
#ifdef __linux__
case LONG_ARGS_CGROUP:
+2
View File
@@ -212,6 +212,7 @@ PyAPI_FUNC(PyObject *) PyMarshal_ReadObjectFromString(char *, Py_ssize_t);
#define LONG_ARGS_MOUNT 17053
#define LONG_ARGS_THREADS 17054
#define LONG_ARGS_LOG_SENDFILE 17055
#define LONG_ARGS_HTTP_MODIFIER1 17056
@@ -542,6 +543,7 @@ struct uwsgi_server {
int http_fd;
char *http_vars[64];
int http_vars_cnt;
uint8_t http_modifier1;
#endif
int ignore_script_name;