From: helge Date: Thu, 24 Feb 2005 14:38:05 +0000 (+0000) Subject: improved handling of port:0 setups X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f54c2af46cffe674138809bac7f38ccf24e7d84c;p=sope improved handling of port:0 setups git-svn-id: http://svn.opengroupware.org/SOPE/trunk@597 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/mod_ngobjweb/ChangeLog b/sope-appserver/mod_ngobjweb/ChangeLog index cbf5c615..4a59a4d0 100644 --- a/sope-appserver/mod_ngobjweb/ChangeLog +++ b/sope-appserver/mod_ngobjweb/ChangeLog @@ -1,3 +1,8 @@ +2005-02-24 Helge Hess + + * handler.c: only write the x-webobjects-port if the Apache variable + is not 0 (need to find out how this can happen ...) + 2004-11-17 Helge Hess * handler.c (_connectInstance): fixed apr_sleep for Apache 2 which now diff --git a/sope-appserver/mod_ngobjweb/handler.c b/sope-appserver/mod_ngobjweb/handler.c index 3b9d6d5f..8a861916 100644 --- a/sope-appserver/mod_ngobjweb/handler.c +++ b/sope-appserver/mod_ngobjweb/handler.c @@ -493,8 +493,8 @@ int ngobjweb_handler(request_rec *r) { } } - if (cfg) { - if (cfg->appPrefix) { + if (cfg != NULL) { + if (cfg->appPrefix != NULL) { if (!NGBufferedDescriptor_writeHttpHeader(toApp, "x-webobjects-adaptor-prefix", cfg->appPrefix)) { writeError = 1; @@ -510,20 +510,28 @@ int ngobjweb_handler(request_rec *r) { goto writeErrorHandler; } - apr_snprintf(tmp, sizeof(tmp), "%i", r->server->port); - if (!NGBufferedDescriptor_writeHttpHeader(toApp, - "x-webobjects-server-port", - tmp)) { - writeError = 1; - goto writeErrorHandler; + if (r->server->port != 0) { + apr_snprintf(tmp, sizeof(tmp), "%i", r->server->port); + if (!NGBufferedDescriptor_writeHttpHeader(toApp, + "x-webobjects-server-port", + tmp)) { + writeError = 1; + goto writeErrorHandler; + } } // TODO: this seems to be broken with some Apache's! // see: http://www.mail-archive.com/modssl-users@modssl.org/msg16396.html - apr_snprintf(tmp, sizeof(tmp), "%s://%s:%i", - ap_http_method(r), - r->server->server_hostname, - r->server->port); + if (r->server->port != 0) { + apr_snprintf(tmp, sizeof(tmp), "%s://%s:%i", + ap_http_method(r), + r->server->server_hostname, + r->server->port); + } + else { + apr_snprintf(tmp, sizeof(tmp), "%s://%s", + ap_http_method(r), r->server->server_hostname); + } if (!NGBufferedDescriptor_writeHttpHeader(toApp, "x-webobjects-server-url", tmp)) {