$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.
void groupdav_folder_list(void);
void euid_escapize(char *, char *);
void euid_unescapize(char *, char *);
-
+void output_host_prefix(void);
}
+/**
+ * \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);
+ }
+}
+
+
/*@}*/
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>");
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);
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);
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);
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)) {
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;
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 */
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;
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;
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);