🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Piotr Kucharski Fri, 27 Jun 1997 22:10
Patch do listproca
#352
Author: Piotr Kucharski
Date: Fri, 27 Jun 1997 22:10
74 lines
3270 bytes
Hej

Zauważyłem ostatnio dość przykrą przypadłość ListProca 6.0c. Mianowicie
przy wysyłaniu na listę wiadomości MIME z takiego nagłówka:
Content-Type: multipart/report; report-type=delivery-status;
	boundary="TAB26997.867087254/hermes.sgh.waw.pl"
	
wycinał linijkę z "boundary". Wstawienie boundary w różnych wariantach
(<TAB>boundary, boundary, \tboundary i inne) do config w opcji 'header'
nic nie pomagało. Dodatkowo okazało się, po szybkim hacku, że nawet jak
zostawi linijkę z "boundary", to odwraca kolejność nagłówków, tak że
boundary pojawia się przed Content-type.

No dobrze, koniec tego wodolejstwa :-) Oto patch:

----- cut -----
diff -r -u src.org/list.c src/list.c
--- src.org/list.c	Fri Jun 27 22:32:39 1997
+++ src/list.c	Fri Jun 27 22:11:00 1997
@@ -1171,6 +1171,7 @@
   long int lines_to_skip = 0;	  /* skip lines of incoming message */
   long int sig_mask;
   MATCHED_PREC_HEADER *out_header = matched_prec_header;
+  MATCHED_PREC_HEADER *last_header = NULL;
   PRECIOUS_HEADER *pheader;
   int request_found, i;
 
@@ -1274,7 +1275,7 @@
     else {	/* Check if precious header line */
       pheader = sys.lists[listid].header;
       while (pheader) {
-        if (!strncmp (line, pheader->line, strlen (pheader->line))) {
+        if (!strncasecmp (line, pheader->line, strlen (pheader->line))) {
 	  if (! (out_header =
 		 (MATCHED_PREC_HEADER *) malloc (sizeof (MATCHED_PREC_HEADER))))
 	    report_progress (report, "\nprocess_message(): malloc() failed",
@@ -1286,8 +1287,12 @@
 			     TRUE),
 	    gexit (11);
 	  strcpy (out_header->line, line);
-	  out_header->next = matched_prec_header;
-	  matched_prec_header = out_header;
+	  out_header->next = NULL;
+	  if (!last_header)
+		matched_prec_header = out_header;
+	  else
+		last_header->next = out_header;
+	  last_header = out_header;
 	}
 	pheader = pheader->next;
       }
diff -r -u src.org/misc.c src/misc.c
--- src.org/misc.c	Fri Jun 27 22:32:41 1997
+++ src/misc.c	Fri Jun 27 22:05:00 1997
@@ -586,7 +586,8 @@
       sys->lists[id].header = NULL;
       while (!feof (config) && strcmp (sys->arg, "}")) {
 	RESET (sys->arg);
-	fscanf (config, "%s\n", sys->arg);
+	fgets (sys->arg, MAX_LINE, config);
+	sys->arg[strlen(sys->arg)-1]='\0';
 	if (sys->arg[0] == '#') {
 	  fgets (sys->arg, MAX_LINE - 2, config);
 	  continue;
----- cut -----

Dodatkowo strncasecmp załatwił sprawę podwójnego wpisywania headerów
w różnych wariantach (MIME-Version, Mime-Version).
Żeby patch zadziałał [:-)] to trzeba do headers dodać "<TAB>boundary".

pozdrawiam
-- P.

ps. podziękowania dla Marcina Cieślaka za pomoc :-)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads