INN commit: trunk/nnrpd (article.c)

INN Commit rra at isc.org
Sat Dec 26 00:06:18 UTC 2009


    Date: Friday, December 25, 2009 @ 16:06:18
  Author: iulius
Revision: 8861

Use "!!" as diag-match in the Path: header after the name
of the virtualhost when virtualhost: is set to true in
readers.conf and it is added at the beginning of the header.

Modified:
  trunk/nnrpd/article.c

-----------+
 article.c |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Modified: article.c
===================================================================
--- article.c	2009-12-25 22:42:21 UTC (rev 8860)
+++ article.c	2009-12-26 00:06:18 UTC (rev 8861)
@@ -406,6 +406,7 @@
 	    return;
 	}
 	/* r points to the first space in the Xref: header. */
+
 	for (s = path, lastchar = '\0';
 	    s + VirtualPathlen + 1 < endofpath;
 	    lastchar = *s++) {
@@ -430,9 +431,11 @@
 	        SendIOv(s, p - s);
 	    }
 	} else {
+            /* Double the '!' (thus, adding one '!') in Path: header. */
 	    if (xref > path) {
 	        SendIOv(q, path - q);
 	        SendIOv(VirtualPath, VirtualPathlen);
+                SendIOv("!", 1);
 	        SendIOv(path, xref - path);
 	        SendIOv(VirtualPath, VirtualPathlen - 1);
 	        SendIOv(r, p - r);
@@ -441,6 +444,7 @@
 	        SendIOv(VirtualPath, VirtualPathlen - 1);
 	        SendIOv(r, path - r);
 	        SendIOv(VirtualPath, VirtualPathlen);
+                SendIOv("!", 1);
 	        SendIOv(path, p - path);
 	    }
 	}
@@ -525,7 +529,9 @@
 		else if (strncasecmp("Xref", header, headerlen) == 0)
 		    xrefheader = true;
 		if (retval == NULL) {
-		    retlen = q - p + VirtualPathlen + 1;
+                    /* Possibly add '!' (a second one) at the end of the virtual path.
+                     * So it is +2 because of '\0'. */
+		    retlen = q - p + VirtualPathlen + 2;
 		    retval = xmalloc(retlen);
 		} else {
 		    if ((q - p + VirtualPathlen + 1) > retlen) {
@@ -558,8 +564,9 @@
 			*(retval + (int)(q - s)) = '\0';
 		    } else {
 			memcpy(retval, VirtualPath, VirtualPathlen);
-			memcpy(retval + VirtualPathlen, p, q - p);
-			*(retval + (int)(q - p) + VirtualPathlen) = '\0';
+                        *(retval + VirtualPathlen) = '!';
+			memcpy(retval + VirtualPathlen + 1, p, q - p);
+			*(retval + (int)(q - p) + VirtualPathlen + 1) = '\0';
 		    }
 		} else if (xrefheader && (VirtualPathlen > 0)) {
 		    if ((r = memchr(p, ' ', q - p)) == NULL)




More information about the inn-committers mailing list