[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Gnatsweb attachment handling broken by gnatsd

From: Yngve Svendsen
Subject: Gnatsweb attachment handling broken by gnatsd
Date: Thu, 22 Mar 2001 22:56:06 +0100

The handling of attachments by Gnatsweb currently seems to be broken, and this seems to be due to a "feature" in gnatsd. Gnatsweb stores attachments in the "Unformatted" field, and according to the GNATS ChangeLog:

Tue Feb  1 17:47:45 2000  Bob Manson  <address@hidden>

        * pr.c (addLineToPR): Add spaces to the beginning of Unformatted:
        field entries if they don't have one already.  Ignore text that
        looks like a field name if it isn't a valid name.

This means that every line of data in the "Unformatted" field gets a leading space, and this breaks Gnatsweb's functions for decoding and handling attachments by embedding them in the PR data.

By doing the following to addLineToPR in pr.c (basically commenting out the space-adding code) and rebuilding gnatsd, attachment handling worked again:

Index: pr.c
RCS file: /cvs/gnats/gnats/gnats/pr.c,v
retrieving revision 1.57
diff -u -p -r1.57 pr.c
--- pr.c        2000/08/23 19:55:22     1.57
+++ pr.c        2001/03/22 21:51:58
@@ -435,9 +435,11 @@ addLineToPR (PR *pr, char *buffer, char
          /* Insert a space if there isn't one already.  */
          if (prv->multiFieldIndex == UNFORMATTED (pr->database)
              && line[0] != ' ')
+               /* YS: */
-             prv->buffer[prv->bufferLen] = ' ';
-             prv->bufferLen++;
+                 /*          prv->buffer[prv->bufferLen] = ' '; */
+                 /*          prv->bufferLen++; */
          memcpy (prv->buffer + prv->bufferLen, line, linelen);
          prv->bufferLen += linelen;

Now, the question is: why was this "feature" added to gnatsd in the first place? Anynone care to take a look and see what they think?

The easiest way to fix Gnatsweb would be to remove this code from pr.c. Working around it in Gnatsweb would take a bit of coding and very likely affect performance a lot.

Yngve Svendsen
IS Engineer
Clustra AS, Trondheim, Norway

reply via email to

[Prev in Thread] Current Thread [Next in Thread]