inn-STABLE-200211xx: Out of memory during ridiculously large request
Katsuhiro Kondou
Katsuhiro_Kondou at isc.org
Sun Nov 24 01:58:51 UTC 2002
In article <20021122.080553.41628538.kondou at isc.org>,
Katsuhiro Kondou <Katsuhiro_Kondou at isc.org> wrote;
} I'll try to fix. Thanks for your reporting the problem.
Miroslaw, could you try attached?
--
Katsuhiro Kondou
Index: perl.c
===================================================================
RCS file: /home/kondou/news/inn/repository/inn/nnrpd/perl.c,v
retrieving revision 1.13.2.1
diff -u -r1.13.2.1 perl.c
--- perl.c 21 Jun 2000 02:43:08 -0000 1.13.2.1
+++ perl.c 22 Nov 2002 00:37:18 -0000
@@ -47,7 +47,6 @@
extern char **OtherHeaders;
extern int OtherCount;
extern BOOL HeadersModified;
-static int HeaderLen;
/* #define DEBUG_MODIFY only if you want to see verbose outout */
#ifdef DEBUG_MODIFY
@@ -62,7 +61,7 @@
HV *hdr;
SV *body;
int rc;
- char *p;
+ char *p, *q;
static char buf[256];
register int i;
register char *s,*t;
@@ -123,7 +122,6 @@
HeadersModified = FALSE;
if (SvTRUE(modswitch)) {
HeadersModified = TRUE;
- HeaderLen = 0;
i = 0;
#ifdef DEBUG_MODIFY
@@ -145,7 +143,14 @@
for (hp = Table; hp < EndOfTable; hp++) {
if (caseEQn(p, hp->Name, hp->Size)) {
hp->Value = COPY(s);
- HeaderLen += strlen(s) + hp->Size + 3;
+ hp->Len = TrimSpaces(hp->Value);
+ for (q = hp->Value ; ISWHITE(*q) || *q == '\n' ; q++)
+ continue;
+ hp->Body = q;
+ if (hp->Len == 0) {
+ DISPOSE(hp->Value);
+ hp->Value = hp->Body = NULL;
+ }
break;
}
}
@@ -160,7 +165,6 @@
t = NEW(char, x);
sprintf(t,"%s: %s",p,s);
OtherHeaders[i++] = t;
- HeaderLen += x;
}
OtherCount = i;
#ifdef DEBUG_MODIFY
Index: post.c
===================================================================
RCS file: /home/kondou/news/inn/repository/inn/nnrpd/post.c,v
retrieving revision 1.50.2.11
diff -u -r1.50.2.11 post.c
--- post.c 14 Jul 2002 16:42:53 -0000 1.50.2.11
+++ post.c 24 Nov 2002 01:48:22 -0000
@@ -149,7 +149,7 @@
/*
** Trim trailing spaces, return pointer to first non-space char.
*/
-STATIC int
+int
TrimSpaces(char *p)
{
char *start;
More information about the inn-workers
mailing list