mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-02-22 11:11:21 +00:00
GSWAdaptors/Apache2/mod_gsw.c
* small cleanups * copy all non-private headers to user GSWeb.framework/GSWBindingNameAssociation.m * remove unused code git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@26443 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fa85c6c210
commit
bee03ed226
3 changed files with 31 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2008-04-09 David Wetzel <dave@turbocat.de>
|
||||||
|
GSWAdaptors/Apache2/mod_gsw.c
|
||||||
|
* small cleanups
|
||||||
|
* copy all non-private headers to user
|
||||||
|
|
||||||
|
GSWeb.framework/GSWBindingNameAssociation.m
|
||||||
|
* remove unused code
|
||||||
|
|
||||||
2008-03-31 David Wetzel <dave@turbocat.de>
|
2008-03-31 David Wetzel <dave@turbocat.de>
|
||||||
GSWAdaptors/Apache2/mod_gsw.c
|
GSWAdaptors/Apache2/mod_gsw.c
|
||||||
* make load-balancing work
|
* make load-balancing work
|
||||||
|
|
|
@ -262,7 +262,6 @@ void * read_shared_mem(apr_pool_t * pool, int appcount)
|
||||||
{
|
{
|
||||||
apr_size_t memsize = apr_shm_size_get(exipc_shm);
|
apr_size_t memsize = apr_shm_size_get(exipc_shm);
|
||||||
void * mem = NULL;
|
void * mem = NULL;
|
||||||
apr_status_t rs;
|
|
||||||
|
|
||||||
if (memsize) {
|
if (memsize) {
|
||||||
mem = apr_pcalloc(pool, memsize);
|
mem = apr_pcalloc(pool, memsize);
|
||||||
|
@ -274,7 +273,7 @@ void * read_shared_mem(apr_pool_t * pool, int appcount)
|
||||||
|
|
||||||
rv = apr_global_mutex_lock(exipc_mutex);
|
rv = apr_global_mutex_lock(exipc_mutex);
|
||||||
if (rv != APR_SUCCESS) {
|
if (rv != APR_SUCCESS) {
|
||||||
char errstr[1024];
|
//char errstr[1024];
|
||||||
//apr_strerror(rv,errstr,1024);
|
//apr_strerror(rv,errstr,1024);
|
||||||
//syslog(LOG_ERR,"rv != APR_SUCCESS %s\n", errstr);
|
//syslog(LOG_ERR,"rv != APR_SUCCESS %s\n", errstr);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -323,7 +322,6 @@ void mark_refusing(gsw_app_conf * app)
|
||||||
void update_app_statistics(gsw_app_conf * app, apr_time_t last_request_time, apr_time_t last_response_time, u_int32_t load)
|
void update_app_statistics(gsw_app_conf * app, apr_time_t last_request_time, apr_time_t last_response_time, u_int32_t load)
|
||||||
{
|
{
|
||||||
exipc_data * mem = NULL;
|
exipc_data * mem = NULL;
|
||||||
exipc_data * data = NULL;
|
|
||||||
u_int16_t index = app->total_index;
|
u_int16_t index = app->total_index;
|
||||||
|
|
||||||
apr_global_mutex_lock(exipc_mutex);
|
apr_global_mutex_lock(exipc_mutex);
|
||||||
|
@ -407,9 +405,9 @@ gsw_app_conf * find_app(request_rec *r)
|
||||||
gsw_cfg * cfg = NULL;
|
gsw_cfg * cfg = NULL;
|
||||||
gsw_app_conf * app_conf = NULL;
|
gsw_app_conf * app_conf = NULL;
|
||||||
|
|
||||||
if (appName = index(r->uri, '/')) {
|
if ((appName = index(r->uri, '/'))) {
|
||||||
appName++;
|
appName++;
|
||||||
if (appName = index(appName, '/')) {
|
if ((appName = index(appName, '/'))) {
|
||||||
appName++;
|
appName++;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -429,11 +427,9 @@ gsw_app_conf * find_app(request_rec *r)
|
||||||
// now get the instance number if any
|
// now get the instance number if any
|
||||||
|
|
||||||
if ((instance_str = index(appName, '/'))) {
|
if ((instance_str = index(appName, '/'))) {
|
||||||
// ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "instance_str '%s'", instance_str);
|
|
||||||
instance_str++;
|
instance_str++;
|
||||||
if (appName = index(instance_str, '/')) {
|
if ((appName = index(instance_str, '/'))) {
|
||||||
*appName = '\0';
|
*appName = '\0';
|
||||||
// ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "appName '%s'", appName);
|
|
||||||
instance_nr = atoi(instance_str);
|
instance_nr = atoi(instance_str);
|
||||||
// parse error?
|
// parse error?
|
||||||
if (instance_nr == 0) {
|
if (instance_nr == 0) {
|
||||||
|
@ -870,16 +866,20 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
||||||
|
|
||||||
while (headers_done == 0) {
|
while (headers_done == 0) {
|
||||||
newBuf = read_sock_line(soc, r, sub_pool);
|
newBuf = read_sock_line(soc, r, sub_pool);
|
||||||
|
int copy_header = 1;
|
||||||
|
|
||||||
if (newBuf != NULL) {
|
if (newBuf != NULL) {
|
||||||
if (load_avr_seen == 0) {
|
if (load_avr_seen == 0) {
|
||||||
if (strncmp(newBuf, "x-webobjects-loadaverage: ", 26) == 0) {
|
if (strncmp(newBuf, "x-webobjects-loadaverage: ", 26) == 0) {
|
||||||
load_avr_seen = 1;
|
load_avr_seen = 1;
|
||||||
newload = atoi(newBuf+26);
|
newload = atoi(newBuf+26);
|
||||||
|
copy_header = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (refusing_seen == 0) {
|
if (refusing_seen == 0) {
|
||||||
if (strncmp(newBuf, REFUSING_SESSIONS_HEADER, 32) == 0) {
|
if (strncmp(newBuf, REFUSING_SESSIONS_HEADER, 32) == 0) {
|
||||||
refusing_seen = 1;
|
refusing_seen = 1;
|
||||||
|
copy_header = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (length_seen == 0) {
|
if (length_seen == 0) {
|
||||||
|
@ -888,17 +888,20 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
||||||
content_length = atol(newBuf+16);
|
content_length = atol(newBuf+16);
|
||||||
snprintf(tmpStr, sizeof(tmpStr), "%d", content_length);
|
snprintf(tmpStr, sizeof(tmpStr), "%d", content_length);
|
||||||
apr_table_set(r->headers_out, "content-length", tmpStr);
|
apr_table_set(r->headers_out, "content-length", tmpStr);
|
||||||
|
copy_header = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (content_type == NULL) {
|
if (content_type == NULL) {
|
||||||
if (strncmp(newBuf, "content-type: ", 14) == 0) {
|
if (strncmp(newBuf, "content-type: ", 14) == 0) {
|
||||||
content_type = newBuf+14;
|
content_type = newBuf+14;
|
||||||
|
copy_header = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (content_encoding == NULL) {
|
if (content_encoding == NULL) {
|
||||||
if (strncmp(newBuf, "content-encoding: ", 18) == 0) {
|
if (strncmp(newBuf, "content-encoding: ", 18) == 0) {
|
||||||
content_encoding = newBuf+18;
|
content_encoding = newBuf+18;
|
||||||
apr_table_set(r->headers_out, "content-encoding", content_encoding);
|
apr_table_set(r->headers_out, "content-encoding", content_encoding);
|
||||||
|
copy_header = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (location == NULL) {
|
if (location == NULL) {
|
||||||
|
@ -907,8 +910,20 @@ static int handle_request(request_rec *r, gsw_app_conf * app, void * postdata, u
|
||||||
location = newBuf+10;
|
location = newBuf+10;
|
||||||
apr_table_set(r->headers_out, "location", location);
|
apr_table_set(r->headers_out, "location", location);
|
||||||
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, "location '%s'", location);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
headers_done = 1;
|
headers_done = 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,6 @@ RCS_ID("$Id$")
|
||||||
{
|
{
|
||||||
if ((self=[super init]))
|
if ((self=[super init]))
|
||||||
{
|
{
|
||||||
NSArray* keys=nil;
|
|
||||||
NSRange dotRange;
|
NSRange dotRange;
|
||||||
|
|
||||||
if ([aKeyPath hasPrefix:@"^"]) {
|
if ([aKeyPath hasPrefix:@"^"]) {
|
||||||
|
@ -52,7 +51,6 @@ RCS_ID("$Id$")
|
||||||
}
|
}
|
||||||
// TODO: check if ~ was used in here in WO 4.x
|
// TODO: check if ~ was used in here in WO 4.x
|
||||||
|
|
||||||
keys=[aKeyPath componentsSeparatedByString:@"."];
|
|
||||||
dotRange = [aKeyPath rangeOfString:DOTSTRING];
|
dotRange = [aKeyPath rangeOfString:DOTSTRING];
|
||||||
|
|
||||||
if (dotRange.length) {
|
if (dotRange.length) {
|
||||||
|
|
Loading…
Reference in a new issue