* Reversed the previous change
authorArt Cancro <ajc@citadel.org>
Mon, 30 Jan 2006 21:52:55 +0000 (21:52 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 30 Jan 2006 21:52:55 +0000 (21:52 +0000)
webcit/ChangeLog
webcit/groupdav.h
webcit/groupdav_main.c
webcit/groupdav_propfind.c
webcit/groupdav_put.c
webcit/webcit.c
webcit/webcit.h
webcit/webserver.c

index d6139869abb9508705205f5b94c44fd9790fb5e1..aa333b98ae499797e6c6653486678eb2aab37ddc 100644 (file)
@@ -1,5 +1,8 @@
 $Id$
 
+Mon Jan 30 16:52:37 EST 2006 ajc
+* Reversed the previous change
+
 Mon Jan 30 15:25:43 EST 2006 ajc
 * GroupDAV now outputs <href> tags containing server-absolute URL's instead
   of globally absolute URL's.
index dfbb5f7dff5226adfd157754bc643398bd07f9d5..7ebb5e2b1f6488c32d8df8a175443623027f37e1 100644 (file)
@@ -11,4 +11,4 @@ long locate_message_by_uid(char *);
 void groupdav_folder_list(void);
 void euid_escapize(char *, char *);
 void euid_unescapize(char *, char *);
-
+void output_host_prefix(void);
index c32fc6a5f7f344dc3b22aae857d0224401e249c7..6fe89b1b927e0fd54d715255e81b6fa186843a6a 100644 (file)
@@ -236,4 +236,16 @@ void groupdav_main(struct httprequest *req,
 }
 
 
+/**
+ * \brief Output http[s]://fqdn.example.com[:port] to the client.
+ */
+void output_host_prefix(void) {
+       if (strlen(WC->http_host) > 0) {
+               wprintf("%s://%s",
+                       (is_https ? "https" : "http"),
+                       WC->http_host);
+       }
+}
+
+
 /*@}*/
index 16dad8794979fb94e412e1c8494b32e579404ed9..724d4eb45de883d373845bcd67ec26508b87a6e0 100644 (file)
@@ -97,13 +97,7 @@ void groupdav_folder_list(void) {
                        wprintf("<D:response>");
 
                        wprintf("<D:href>");
-/*
-                       if (strlen(WC->http_host) > 0) {
-                               wprintf("%s://%s",
-                                       (is_https ? "https" : "http"),
-                                       WC->http_host);
-                       }
- */
+                       output_host_prefix();
                        wprintf("/groupdav/");
                        urlescputs(roomname);
                        wprintf("/</D:href>");
@@ -239,13 +233,7 @@ void groupdav_propfind(char *dav_pathname) {
                wprintf("<D:response>");
 
                wprintf("<D:href>");
-/*
-               if (strlen(WC->http_host) > 0) {
-                       wprintf("%s://%s",
-                               (is_https ? "https" : "http"),
-                               WC->http_host);
-               }
- */
+               output_host_prefix();
                wprintf("/groupdav/");
                urlescputs(WC->wc_roomname);
                euid_escapize(encoded_uid, dav_uid);
@@ -304,13 +292,7 @@ void groupdav_propfind(char *dav_pathname) {
                if (strlen(uid) > 0) {
                        wprintf("<D:response>");
                        wprintf("<D:href>");
-/*
-                       if (strlen(WC->http_host) > 0) {
-                               wprintf("%s://%s",
-                                       (is_https ? "https" : "http"),
-                                       WC->http_host);
-                       }
- */
+                       output_host_prefix();
                        wprintf("/groupdav/");
                        urlescputs(WC->wc_roomname);
                        euid_escapize(encoded_uid, uid);
index e3d83a6370f0e0e867c984bac26cd38cabe5d374..0c022b1f6a33c6d088f171912eb619f6f9046915 100644 (file)
@@ -139,13 +139,7 @@ void groupdav_put(char *dav_pathname, char *dav_ifmatch,
                wprintf("etag: \"%ld\"\r\n", new_msgnum);
                wprintf("Content-Length: 0\r\n");
                wprintf("Location: ");
-/*
-               if (strlen(WC->http_host) > 0) {
-                       wprintf("%s://%s",
-                               (is_https ? "https" : "http"),
-                               WC->http_host);
-               }
- */
+               output_host_prefix();
                wprintf("/groupdav/");
                urlescputs(dav_roomname);
                wprintf("/%s\r\n", dav_uid);
index 37289dea89ba649811642f70d8c9f0e82f4afa2b..0f931e694b58771e7a35297d0d3fb5df1622c40d 100644 (file)
@@ -1089,7 +1089,7 @@ void session_loop(struct httprequest *req)
 
        while (hptr != NULL) {
                safestrncpy(buf, hptr->line, sizeof buf);
-               lprintf(9, "HTTP HEADER: %s\n", buf);
+               /* lprintf(9, "HTTP HEADER: %s\n", buf); */
                hptr = hptr->next;
 
                if (!strncasecmp(buf, "Cookie: webcit=", 15)) {
index ffa329a7d6fda9247faa987a33e5d0dcae2b2db7..9745921339962575ec69c4549b1e579d01edccf4 100644 (file)
@@ -413,6 +413,7 @@ struct serv_info serv_info;
 extern char floorlist[128][SIZ];
 extern char *axdefs[];
 extern char *ctdlhost, *ctdlport;
+extern int http_port;
 extern char *server_cookie;
 extern int is_https;
 extern int setup_wizard;
index 7609b6fb47c85eb239e2ef6849df648fd2b3a9b2..b308ceef6ac65968198b6e130ec4b210bcbf2cd2 100644 (file)
@@ -28,6 +28,7 @@ extern pthread_key_t MyConKey;
 
 char *server_cookie = NULL; /**< our Cookie connection to the client */
 
+int http_port = PORT_NUM;      /**< Port to listen on */
 
 char *ctdlhost = DEFAULT_HOST; /**< our name */
 char *ctdlport = DEFAULT_PORT; /**< our Port */
@@ -465,7 +466,6 @@ int main(int argc, char **argv)
        pthread_t SessThread;   /**< Thread descriptor */
        pthread_attr_t attr;    /**< Thread attributes */
        int a, i;                       /**< General-purpose variables */
-       int port = PORT_NUM;    /**< Port to listen on */
        char tracefile[PATH_MAX];
        char ip_addr[256];
        char *webcitdir = WEBCITDIR;
@@ -491,8 +491,8 @@ int main(int argc, char **argv)
                        safestrncpy(ip_addr, optarg, sizeof ip_addr);
                        break;
                case 'p':
-                       port = atoi(optarg);
-                       if (port == 0) {
+                       http_port = atoi(optarg);
+                       if (http_port == 0) {
                                safestrncpy(uds_listen_path, optarg, sizeof uds_listen_path);
                        }
                        break;
@@ -611,8 +611,8 @@ int main(int argc, char **argv)
                msock = ig_uds_server(uds_listen_path, LISTEN_QUEUE_LENGTH);
        }
        else {
-               lprintf(2, "Attempting to bind to port %d...\n", port);
-               msock = ig_tcp_server(ip_addr, port, LISTEN_QUEUE_LENGTH);
+               lprintf(2, "Attempting to bind to port %d...\n", http_port);
+               msock = ig_tcp_server(ip_addr, http_port, LISTEN_QUEUE_LENGTH);
        }
 
        lprintf(2, "Listening on socket %d\n", msock);