mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-21 02:41:04 +00:00
* GSWAdaptors/Apache2/mod_gsw.c
modified find_app_by_name() wen dealing with single instances include image include some css git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@33034 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
37a13f0222
commit
041da71850
2 changed files with 218 additions and 98 deletions
|
@ -1,3 +1,9 @@
|
|||
2011-05-13 David Wetzel <dave@turbocat.de>
|
||||
* GSWAdaptors/Apache2/mod_gsw.c
|
||||
modified find_app_by_name() wen dealing with single instances
|
||||
include image
|
||||
include some css
|
||||
|
||||
2010-10-24 David Wetzel <dave@turbocat.de>
|
||||
* GSWeb/GSWContext.h
|
||||
add @class GSWResourceManager
|
||||
|
|
|
@ -340,56 +340,69 @@ void update_app_statistics(gsw_app_conf * app, apr_time_t last_request_time, apr
|
|||
|
||||
gsw_app_conf * find_app_by_name(char * name, gsw_cfg *cfg, request_rec *r)
|
||||
{
|
||||
|
||||
if (((name) && (strlen(name))) && (cfg->app_table)) {
|
||||
|
||||
const apr_array_header_t *tarr = apr_table_elts(cfg->app_table);
|
||||
const apr_table_entry_t *telts = (const apr_table_entry_t*)tarr->elts;
|
||||
int i;
|
||||
apr_time_t t;
|
||||
exipc_data * mem;
|
||||
int appcount = tarr->nelts;
|
||||
u_int32_t lastload = UINT32_MAX;
|
||||
int lastindex = -1;
|
||||
|
||||
if (!appcount) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mem = read_shared_mem(r->pool, appcount);
|
||||
if (!mem) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// current time
|
||||
t = apr_time_now();
|
||||
// substract 300 sec / 5 min
|
||||
t = t - apr_time_from_sec(300);
|
||||
|
||||
for (i = 0; i < tarr->nelts; i++) {
|
||||
gsw_app_conf *appconf = (gsw_app_conf *) telts[i].val;
|
||||
|
||||
if ((strcasecmp(appconf->app_name, name) == 0)) {
|
||||
// enable unreachable instances after some time
|
||||
if (mem[i].last_request_time < t) {
|
||||
mem[i].unreachable = 0;
|
||||
mem[i].refusing = 0;
|
||||
if (((name) && (strlen(name))) && (cfg->app_table))
|
||||
{
|
||||
|
||||
const apr_array_header_t *tarr = apr_table_elts(cfg->app_table);
|
||||
const apr_table_entry_t *telts = (const apr_table_entry_t*)tarr->elts;
|
||||
int i;
|
||||
apr_time_t t;
|
||||
exipc_data * mem;
|
||||
int appcount = tarr->nelts;
|
||||
u_int32_t lastload = UINT32_MAX;
|
||||
int lastindex = -1;
|
||||
int lastUnreachableIndex = -1;
|
||||
|
||||
if (!appcount) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((mem[i].unreachable == 0) && (mem[i].refusing == 0)) {
|
||||
if (mem[i].load <= lastload) {
|
||||
lastindex = i;
|
||||
lastload = mem[i].load;
|
||||
}
|
||||
|
||||
mem = read_shared_mem(r->pool, appcount);
|
||||
if (!mem) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// current time
|
||||
t = apr_time_now();
|
||||
// substract 300 sec / 5 min
|
||||
t = t - apr_time_from_sec(300);
|
||||
|
||||
for (i = 0; i < tarr->nelts; i++) {
|
||||
gsw_app_conf *appconf = (gsw_app_conf *) telts[i].val;
|
||||
|
||||
if ((strcasecmp(appconf->app_name, name) == 0)) {
|
||||
// enable unreachable instances after some time
|
||||
if (mem[i].last_request_time < t) {
|
||||
mem[i].unreachable = 0;
|
||||
mem[i].refusing = 0;
|
||||
}
|
||||
|
||||
if ((mem[i].unreachable == 0) && (mem[i].refusing == 0)) {
|
||||
if (mem[i].load <= lastload) {
|
||||
lastindex = i;
|
||||
lastload = mem[i].load;
|
||||
}
|
||||
} else {
|
||||
// if there is only one app, we have to hit it anyways.
|
||||
if ((appcount == 1)) {
|
||||
if ((mem[i].unreachable == 1)) {
|
||||
lastUnreachableIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (lastindex >= 0) {
|
||||
return (gsw_app_conf *) telts[lastindex].val;
|
||||
}
|
||||
if (lastUnreachableIndex >= 0) {
|
||||
return (gsw_app_conf *) telts[lastUnreachableIndex].val;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (lastindex >= 0) {
|
||||
return (gsw_app_conf *) telts[lastindex].val;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
gsw_app_conf * find_app(request_rec *r)
|
||||
|
@ -811,13 +824,13 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
char * content_encoding = NULL;
|
||||
char * location = NULL;
|
||||
int http_status = DECLINED;
|
||||
char tmpStr[512];
|
||||
apr_time_t request_time;
|
||||
apr_time_t done_time;
|
||||
char tmpStr[512];
|
||||
apr_time_t request_time;
|
||||
apr_time_t done_time;
|
||||
|
||||
apr_pool_create(&sub_pool, r->pool);
|
||||
|
||||
|
||||
|
||||
|
||||
soc = connect_host(app->host_name, app->port);
|
||||
|
||||
if (soc != -1) {
|
||||
|
@ -826,9 +839,9 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
|
||||
request_time = apr_time_now();
|
||||
// check if we are on a POST trip...
|
||||
if (postdata) {
|
||||
write_sock(soc, CRLF, 2, r);
|
||||
write_sock(soc, postdata, contentLen, r);
|
||||
if (postdata) {
|
||||
write_sock(soc, CRLF, 2, r);
|
||||
write_sock(soc, postdata, contentLen, r);
|
||||
}
|
||||
write_sock(soc, CRLF, 2, r);
|
||||
|
||||
|
@ -844,28 +857,28 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
if (http_status==200) {
|
||||
http_status=OK;
|
||||
}
|
||||
if (http_status == 302) {
|
||||
r->status = http_status;
|
||||
}
|
||||
if (http_status == 302) {
|
||||
r->status = http_status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (headers_done == 0) {
|
||||
newBuf = read_sock_line(soc, r, sub_pool);
|
||||
int copy_header = 1;
|
||||
|
||||
int copy_header = 1;
|
||||
|
||||
if (newBuf != NULL) {
|
||||
if (load_avr_seen == 0) {
|
||||
if (strncmp(newBuf, "x-webobjects-loadaverage: ", 26) == 0) {
|
||||
load_avr_seen = 1;
|
||||
newload = atoi(newBuf+26);
|
||||
copy_header = 0;
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if (refusing_seen == 0) {
|
||||
if (refusing_seen == 0) {
|
||||
if (strncmp(newBuf, REFUSING_SESSIONS_HEADER, 32) == 0) {
|
||||
refusing_seen = 1;
|
||||
copy_header = 0;
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if (length_seen == 0) {
|
||||
|
@ -874,42 +887,42 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
content_length = atol(newBuf+16);
|
||||
snprintf(tmpStr, sizeof(tmpStr), "%d", content_length);
|
||||
apr_table_set(r->headers_out, "content-length", tmpStr);
|
||||
copy_header = 0;
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if (content_type == NULL) {
|
||||
if (strncmp(newBuf, "content-type: ", 14) == 0) {
|
||||
content_type = newBuf+14;
|
||||
copy_header = 0;
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if (content_encoding == NULL) {
|
||||
if (strncmp(newBuf, "content-encoding: ", 18) == 0) {
|
||||
content_encoding = newBuf+18;
|
||||
apr_table_set(r->headers_out, "content-encoding", content_encoding);
|
||||
copy_header = 0;
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if (location == NULL) {
|
||||
// Apple has a bug, giving us a 'L', so we do that too but accept a 'l' too -- dw
|
||||
// Apple has a bug, giving us a 'L', so we do that too but accept a 'l' too -- dw
|
||||
if (strncasecmp(newBuf, "location: ", 10) == 0) {
|
||||
location = newBuf+10;
|
||||
apr_table_set(r->headers_out, "location", location);
|
||||
//ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "location '%s'", location);
|
||||
copy_header = 0;
|
||||
//ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "location '%s'", location);
|
||||
copy_header = 0;
|
||||
}
|
||||
}
|
||||
if ((copy_header == 1)) {
|
||||
char * hdrValue = index(newBuf, ':');
|
||||
|
||||
if (hdrValue) {
|
||||
*hdrValue = '\0';
|
||||
hdrValue++; // space
|
||||
hdrValue++; // first pos.
|
||||
|
||||
apr_table_set(r->headers_out, newBuf, hdrValue);
|
||||
}
|
||||
}
|
||||
if ((copy_header == 1)) {
|
||||
char * hdrValue = index(newBuf, ':');
|
||||
|
||||
if (hdrValue) {
|
||||
*hdrValue = '\0';
|
||||
hdrValue++; // space
|
||||
hdrValue++; // first pos.
|
||||
|
||||
apr_table_set(r->headers_out, newBuf, hdrValue);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
headers_done = 1;
|
||||
}
|
||||
|
@ -922,10 +935,10 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
size_t rval=1;
|
||||
char * transferBuf = NULL;
|
||||
|
||||
if (content_type != NULL) {
|
||||
ap_set_content_type(r, content_type);
|
||||
if (content_type != NULL) {
|
||||
ap_set_content_type(r, content_type);
|
||||
}
|
||||
|
||||
|
||||
if (content_length < blockSize) {
|
||||
blockSize = content_length;
|
||||
}
|
||||
|
@ -945,19 +958,19 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
|||
}
|
||||
|
||||
close(soc);
|
||||
|
||||
done_time = apr_time_now();
|
||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Request took %d ms", apr_time_msec(done_time - request_time));
|
||||
|
||||
if ((http_status==302) && (refusing_seen==1)) {
|
||||
mark_refusing(app);
|
||||
} else {
|
||||
update_app_statistics(app, request_time, done_time, newload);
|
||||
}
|
||||
|
||||
|
||||
done_time = apr_time_now();
|
||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "Request took %d ms", apr_time_msec(done_time - request_time));
|
||||
|
||||
if ((http_status==302) && (refusing_seen==1)) {
|
||||
mark_refusing(app);
|
||||
} else {
|
||||
update_app_statistics(app, request_time, done_time, newload);
|
||||
}
|
||||
|
||||
} else { // -1
|
||||
http_status = UNREACHABLE;
|
||||
}
|
||||
http_status = UNREACHABLE;
|
||||
}
|
||||
|
||||
//apr_pool_destroy(sub_pool);
|
||||
|
||||
|
@ -1095,6 +1108,105 @@ static const char * set_App(cmd_parms *cmd, void *mconfig,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
// done using http://www.sveinbjorn.org/dataurlmaker
|
||||
|
||||
static void print_image(request_rec * r)
|
||||
{
|
||||
ap_rputs("<img alt=\"exclamation sign\" src=\""
|
||||
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAyCAYAAAF38YiUAAAAAXNSR0IArs"
|
||||
"4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAN1wAADdcBQiibeAAAD8dJREFUaN7dmnl0VVWWh7"
|
||||
"9735S8zGQAAgQSQhKGhmAAMQ6ABhAZBCkRQSgcy6Gbru7VzrW6rVKrre5eRVG6UBBXIRoQooBQgkDQAk"
|
||||
"WwFQpEUKEKEUwgCYSQvPnde3b/cd97ySOggILaZ627zrjP7+yz99l3n30vnE/aAEq9tUbatultKyOrqz"
|
||||
"UtNZ0Xobkd9bE7bxERkenTp4uUlcXNwrtgrynQJRQKyQcffCC1tbXyQa/81kF1PXXZu3ev1NbWyoQJE2"
|
||||
"Tfvn3ymhMB0jSAeSB+4PTHCw3nzqLs2SP3wNh2HdWpySIiIo88Iu2pKisFEBGRubreOqBhTJk0NDRIQk"
|
||||
"KC+Hw+eTtVEwC9Etb46ms4efIkTqeTEydO0G3bp2zNzRHtxbOw4v+21R++eaysA+F8k++Pz4hUV4tUVs"
|
||||
"qOwQPObYLV8LRUV4ssXy6AFBcXi9x+u9SNGi6A66yEr4NIZaW0fPmliIgAMnfuXFFKiZSUSGN+ntwO/x"
|
||||
"Idr0UL67vlSn/nMRpX7yE1NZWUlBQSEhI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|
||||
|
||||
/*
|
||||
* this prints some CSS for use in the error page in gsw_handler
|
||||
*/
|
||||
|
||||
static void print_css(request_rec * r)
|
||||
{
|
||||
ap_rputs("<style type=\"text/css\"> \
|
||||
body {color: #111;font-family:\"Helvetica Neue\",Helvetica,sans-serif;} \
|
||||
.fail {margin: auto; padding: 40px; display: block; \
|
||||
border: 1px solid #000000; \
|
||||
position: relative;} \
|
||||
.fail h2 {margin: 0 0 .2em; font-size: 24px} \
|
||||
.fail p {margin: 0; font-size: .8em;} \
|
||||
.power {float:right;padding-top: 10px;} \
|
||||
img {float:left;padding-right: 10px;} \
|
||||
a {color: #0092E8;} \
|
||||
a:hover {color: #0071b3;} \
|
||||
table {white-space:nowrap;} \
|
||||
</style>\n", r);
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
/* */
|
||||
|
@ -1214,6 +1326,7 @@ static int gsw_handler(request_rec *r)
|
|||
ap_rputs(DOCTYPE_HTML_3_2, r);
|
||||
ap_rputs("<html>\n", r);
|
||||
ap_rputs("<head>\n", r);
|
||||
print_css(r);
|
||||
ap_rputs("<title>GNUstepWeb Status</title>\n", r);
|
||||
ap_rputs("<meta name=\"robots\" content=\"NOINDEX, NOFOLLOW\">\n", r);
|
||||
ap_rputs("</head>\n", r);
|
||||
|
@ -1232,8 +1345,9 @@ static int gsw_handler(request_rec *r)
|
|||
mem = read_shared_mem(r->pool, appcount);
|
||||
|
||||
if (mem) {
|
||||
ap_rputs("<table border=1>\n",r);
|
||||
ap_rputs("<tr><td>Name</td><td>Instance</td><td>Host</td><td>Port</td><td>Load</td><td> Unreachable</td><td>Refusing</td><td>Last Request</td><td>Last Response</td></tr>\n",r);
|
||||
ap_rputs("<div class=\"fail\"><table width=\"700\">\n",r);
|
||||
print_image(r);
|
||||
ap_rputs("<tr><th>Name</th><th>Instance</th><th>Host</th><th>Port</th><th>Load</th><th>Unreachable</th><th>Refusing</th><th>Last Request</th><th>Last Response</th></tr>\n",r);
|
||||
|
||||
for (i = 0; i < tarr->nelts; i++) {
|
||||
gsw_app_conf *appconf = (gsw_app_conf *) telts[i].val;
|
||||
|
@ -1264,9 +1378,9 @@ static int gsw_handler(request_rec *r)
|
|||
|
||||
}
|
||||
|
||||
ap_rputs("<p>Powered by <a href=\"http://wiki.gnustep.org/index.php/GNUstepWeb\">GNUstep Web</a></p>\n",r);
|
||||
ap_rputs("<p class=\"power\">Powered by <a href=\"http://wiki.gnustep.org/index.php/GNUstepWeb\">GNUstep Web</a></p>\n",r);
|
||||
|
||||
ap_rputs(" </body>\n", r);
|
||||
ap_rputs("</div>\n</body>\n", r);
|
||||
ap_rputs("</html>\n", r);
|
||||
/*
|
||||
* We're all done, so cancel the timeout we set. Since this is probably
|
||||
|
|
Loading…
Reference in a new issue