From 6bf8d4e117cff7649722b5237275d2e17ed6edab Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 30 Jan 2006 21:52:55 +0000 Subject: [PATCH] * Reversed the previous change --- webcit/ChangeLog | 3 +++ webcit/groupdav.h | 2 +- webcit/groupdav_main.c | 12 ++++++++++++ webcit/groupdav_propfind.c | 24 +++--------------------- webcit/groupdav_put.c | 8 +------- webcit/webcit.c | 2 +- webcit/webcit.h | 1 + webcit/webserver.c | 10 +++++----- 8 files changed, 27 insertions(+), 35 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index d6139869a..aa333b98a 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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 tags containing server-absolute URL's instead of globally absolute URL's. diff --git a/webcit/groupdav.h b/webcit/groupdav.h index dfbb5f7df..7ebb5e2b1 100644 --- a/webcit/groupdav.h +++ b/webcit/groupdav.h @@ -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); diff --git a/webcit/groupdav_main.c b/webcit/groupdav_main.c index c32fc6a5f..6fe89b1b9 100644 --- a/webcit/groupdav_main.c +++ b/webcit/groupdav_main.c @@ -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); + } +} + + /*@}*/ diff --git a/webcit/groupdav_propfind.c b/webcit/groupdav_propfind.c index 16dad8794..724d4eb45 100644 --- a/webcit/groupdav_propfind.c +++ b/webcit/groupdav_propfind.c @@ -97,13 +97,7 @@ void groupdav_folder_list(void) { wprintf(""); wprintf(""); -/* - if (strlen(WC->http_host) > 0) { - wprintf("%s://%s", - (is_https ? "https" : "http"), - WC->http_host); - } - */ + output_host_prefix(); wprintf("/groupdav/"); urlescputs(roomname); wprintf("/"); @@ -239,13 +233,7 @@ void groupdav_propfind(char *dav_pathname) { wprintf(""); wprintf(""); -/* - 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(""); wprintf(""); -/* - 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); diff --git a/webcit/groupdav_put.c b/webcit/groupdav_put.c index e3d83a637..0c022b1f6 100644 --- a/webcit/groupdav_put.c +++ b/webcit/groupdav_put.c @@ -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); diff --git a/webcit/webcit.c b/webcit/webcit.c index 37289dea8..0f931e694 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -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)) { diff --git a/webcit/webcit.h b/webcit/webcit.h index ffa329a7d..974592133 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -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; diff --git a/webcit/webserver.c b/webcit/webserver.c index 7609b6fb4..b308ceef6 100644 --- a/webcit/webserver.c +++ b/webcit/webserver.c @@ -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); -- 2.39.2