]> err.no Git - sope/commitdiff
improved handling of port:0 setups
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 24 Feb 2005 14:38:05 +0000 (14:38 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Thu, 24 Feb 2005 14:38:05 +0000 (14:38 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@597 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/mod_ngobjweb/ChangeLog
sope-appserver/mod_ngobjweb/handler.c

index cbf5c615f3a5eff7c759f8d8bde1d8b920de72e4..4a59a4d0a2cd35059e287dfd77338a4b7c9e4eee 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-24  Helge Hess  <helge.hess@skyrix.com>
+
+       * 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  <helge.hess@skyrix.com>
 
        * handler.c (_connectInstance): fixed apr_sleep for Apache 2 which now
index 3b9d6d5fc06dadbbc8817a761a81cf11ed5191bd..8a86191654f44aa42e8f572b7b0f049160490d8c 100644 (file)
@@ -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)) {