another 2.5.1pre keywords-related coredump
Julien ÉLIE
julien at trigofacile.com
Fri Oct 9 19:07:38 UTC 2009
>> I wonder whether that code worked someday in INN (even INN 2.0 uses hc
>> and I do not find keyword generation in INN 1.7.2).
>
> Oh, there is a subtlety. In fact, it is "hp" and not "hc".
> INN 2.3 has it right and keyword generation was broken in INN 2.4.
And therefore was broken when
typedef struct _ARTHEADER {
STRING Name;
ARTHEADERTYPE Type;
int Size; /* Length of Name */
char *Value;
int Length; /* Length of Value */
int Found;
BOOL Allocated;
} ARTHEADER;
changed to only
typedef struct _ARTHEADER {
const char * Name;
ARTHEADERTYPE Type;
int Size; /* Length of Name. */
} ARTHEADER;
Well, I think the only thing that currently works is explicitly saying
it is HDR__KEYWORDS...
--- innd/art.c (révision 8646)
+++ innd/art.c (copie de travail)
@@ -1939,11 +1939,11 @@
/* Patch the old keywords back in. */
if (DO_KEYWORDS && innconf->keywords) {
if (key_old_value) {
- if (hc->Value)
- free(hc->Value); /* malloc'd within */
- hc->Value = key_old_value;
- hc->Length = key_old_length;
- key_old_value = NULL;
+ if (hc[HDR__KEYWORDS].Value)
+ free(hc[HDR__KEYWORDS].Value); /* malloc'd within. */
+ hc[HDR__KEYWORDS].Value = key_old_value;
+ hc[HDR__KEYWORDS].Length = key_old_length;
+ key_old_value = NULL;
}
}
Also updated inn.conf man page:
--- doc/pod/inn.conf.pod (révision 8646)
+++ doc/pod/inn.conf.pod (copie de travail)
@@ -777,9 +777,11 @@
Whether the keyword generation support should be enabled. This is a
boolean value and the default is false.
-FIXME: Currently, support for keyword generation is configured into INN
-semi-randomly (based on whether configure found the regex library); it
-should be an option to configure and that option should be mentioned here.
+In order to use this feature, the regex library should be available
+and INN configured with the B<--enable-keywords> flag. Otherwise,
+no keywords will be generated, even though this boolean value is set
+to true. You also have to add the integration of the Keywords: header
+into the overview with I<extraoverviewadvertised>.
and fix a gcc warning here:
--- innd/keywords.c (révision 8646)
+++ innd/keywords.c (copie de travail)
@@ -147,7 +147,7 @@
* now figure acceptable extents, and copy body to working string.
* (Memory-intensive for hefty articles: limit to non-ABSURD articles.)
*/
- if ((bodylen < 100) || (bodylen > innconf->keyartlimit)) /* too small/big to bother */
+ if ((bodylen < 100) || (bodylen > (size_t) innconf->keyartlimit)) /* Too small/big to bother. */
return;
/* Nul-terminate the body. orig_text will be freed later. */
(By the way, *elim_regexp contains twice the "will" keyword.
And keyword generation works better for English articles!)
--
Julien ÉLIE
« Les ordinateurs dans le futur ne pèseront peut-être pas plus de
1,5 tonne. » (Popular Mechanics, 1949)
More information about the inn-workers
mailing list