From: Wilfried Göesgens Date: Mon, 8 Dec 2008 22:08:25 +0000 (+0000) Subject: * if we need the first urlpart, we musn't move it just left, but add another one... X-Git-Tag: v7.86~1733 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=749c2a7e25006217b60af84c3854760454f1f013 * if we need the first urlpart, we musn't move it just left, but add another one at the end. --- diff --git a/webcit/context_loop.c b/webcit/context_loop.c index b7416f0ac..7af1790c1 100644 --- a/webcit/context_loop.c +++ b/webcit/context_loop.c @@ -48,6 +48,7 @@ void DestroySession(struct wcsession **sessions_to_kill) DeleteHash(&((*sessions_to_kill)->ServCfg)); FreeStrBuf(&((*sessions_to_kill)->UrlFragment1)); FreeStrBuf(&((*sessions_to_kill)->UrlFragment2)); + FreeStrBuf(&((*sessions_to_kill)->UrlFragment3)); FreeStrBuf(&((*sessions_to_kill)->WBuf)); FreeStrBuf(&((*sessions_to_kill)->HBuf)); FreeStrBuf(&((*sessions_to_kill)->CLineBuf)); diff --git a/webcit/downloads.c b/webcit/downloads.c index 23bf5f801..d980ce1d3 100644 --- a/webcit/downloads.c +++ b/webcit/downloads.c @@ -391,7 +391,7 @@ void download_file(void) /* Setting to nonzero forces a MIME type of application/octet-stream */ int force_download = 1; - safestrncpy(buf, ChrPtr(WC->UrlFragment1), sizeof buf); + safestrncpy(buf, ChrPtr(WC->UrlFragment2), sizeof buf); unescape_input(buf); serv_printf("OPEN %s", buf); serv_getln(buf, sizeof buf); diff --git a/webcit/messages.c b/webcit/messages.c index 0713591e7..2286a0421 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -249,7 +249,7 @@ void embed_message(void) { long msgnum = 0L; const StrBuf *Tmpl = sbstr("template"); - msgnum = StrTol(WC->UrlFragment1); + msgnum = StrTol(WC->UrlFragment2); if (StrLength(Tmpl) > 0) read_message(WC->WBuf, SKEY(Tmpl), msgnum, 0, NULL); else @@ -265,7 +265,7 @@ void embed_message(void) { void print_message(void) { long msgnum = 0L; - msgnum = StrTol(WC->UrlFragment1); + msgnum = StrTol(WC->UrlFragment2); output_headers(0, 0, 0, 0, 0, 0); hprintf("Content-type: text/html\r\n" @@ -286,7 +286,7 @@ void print_message(void) { */ void mobile_message_view(void) { long msgnum = 0L; - msgnum = StrTol(WC->UrlFragment1); + msgnum = StrTol(WC->UrlFragment2); output_headers(1, 0, 0, 0, 0, 1); begin_burst(); do_template("msgcontrols", NULL); @@ -303,7 +303,7 @@ void display_headers(void) { long msgnum = 0L; char buf[1024]; - msgnum = StrTol(WC->UrlFragment1); + msgnum = StrTol(WC->UrlFragment2); output_headers(0, 0, 0, 0, 0, 0); hprintf("Content-type: text/plain\r\n" diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index 005288380..48f32507f 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -176,8 +176,7 @@ int summcmp_rdate(const void *s1, const void *s2) { /*----------------------------------------------------------------------------*/ - - +///void examine_subj(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) void examine_nhdr(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundCharset) { diff --git a/webcit/roomops.c b/webcit/roomops.c index f8a5e4c0e..35a150e3f 100644 --- a/webcit/roomops.c +++ b/webcit/roomops.c @@ -3201,7 +3201,7 @@ void set_floordiv_expanded(void) { StrBuf *FloorDiv; FloorDiv = NewStrBuf(); - StrBufAppendBuf(FloorDiv, WCC->UrlFragment1, 0); + StrBufAppendBuf(FloorDiv, WCC->UrlFragment2, 0); set_preference("floordiv_expanded", FloorDiv, 1); WCC->floordiv_expanded = FloorDiv; } diff --git a/webcit/webcit.c b/webcit/webcit.c index 1bd1e1ee5..d6aa8a0d2 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -927,7 +927,7 @@ void display_vcard_photo_img(void) const char *contentType; struct wcsession *WCC = WC; - msgnum = StrTol(WCC->UrlFragment1); + msgnum = StrTol(WCC->UrlFragment2); vcard = load_mimepart(msgnum,"1"); v = vcard_load(vcard); @@ -1811,8 +1811,11 @@ void session_loop(HashList *HTTPHeaders, StrBuf *ReqLine, StrBuf *request_method WCC->UrlFragment1 = NewStrBuf(); if (WCC->UrlFragment2 == NULL) WCC->UrlFragment2 = NewStrBuf(); + if (WCC->UrlFragment3 == NULL) + WCC->UrlFragment3 = NewStrBuf(); StrBufPrintf(WCC->UrlFragment1, "%s", index[0]); StrBufPrintf(WCC->UrlFragment2, "%s", index[1]); + StrBufPrintf(WCC->UrlFragment3, "%s", index[2]); } if ((Handler->Flags & AJAX) != 0) begin_ajax_response(); @@ -1864,6 +1867,8 @@ void diagnostics(void) StrEscPuts(WC->UrlFragment1); wprintf("
\n"); StrEscPuts(WC->UrlFragment2); + wprintf("
\n"); + StrEscPuts(WC->UrlFragment3); wprintf("
\n"); wprintf("Variables:
\n");
 	dump_vars();
@@ -1872,26 +1877,26 @@ void diagnostics(void)
 }
 
 void view_mimepart(void) {
-	mimepart(ChrPtr(WC->UrlFragment1),
-		 ChrPtr(WC->UrlFragment2),
+	mimepart(ChrPtr(WC->UrlFragment2),
+		 ChrPtr(WC->UrlFragment3),
 		 0);
 }
 
 void download_mimepart(void) {
-	mimepart(ChrPtr(WC->UrlFragment1),
-		 ChrPtr(WC->UrlFragment2),
+	mimepart(ChrPtr(WC->UrlFragment2),
+		 ChrPtr(WC->UrlFragment3),
 		 1);
 }
 
 void view_postpart(void) {
-	postpart(WC->UrlFragment1,
-		 WC->UrlFragment2,
+	postpart(WC->UrlFragment2,
+		 WC->UrlFragment3,
 		 0);
 }
 
 void download_postpart(void) {
-	postpart(WC->UrlFragment1,
-		 WC->UrlFragment2,
+	postpart(WC->UrlFragment2,
+		 WC->UrlFragment3,
 		 1);
 }
 
@@ -1956,8 +1961,10 @@ void tmplput_url_part(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *
 	if (WCC != NULL) {
 		if (Tokens->Params[0]->lvalue == 0)
 			UrlBuf = WCC->UrlFragment1;
-		else
+		else if (Tokens->Params[0]->lvalue == 1)
 			UrlBuf = WCC->UrlFragment2;
+		else
+			UrlBuf = WCC->UrlFragment3;
 
 		StrBufAppendTemplate(Target, nArgs, Tokens, Context, ContextType,
 				     UrlBuf, 1);
diff --git a/webcit/webcit.h b/webcit/webcit.h
index 371aac8da..a2eb57c92 100644
--- a/webcit/webcit.h
+++ b/webcit/webcit.h
@@ -617,6 +617,7 @@ struct wcsession {
 	int time_format_cache;                  /**< which timeformat does our user like? */
 	StrBuf *UrlFragment1;                   /**< first urlfragment, if NEED_URL is specified by the handler*/
 	StrBuf *UrlFragment2;                   /**< second urlfragment, if NEED_URL is specified by the handler*/
+	StrBuf *UrlFragment3;                   /**< third urlfragment, if NEED_URL is specified by the handler*/
 	StrBuf *WBuf;                           /**< Our output buffer */
 	StrBuf *HBuf;                           /**< Our HeaderBuffer */
 	StrBuf *CLineBuf;                       /**< linebuffering client stuff */