[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smtpserver busylooping
On Mon, May 27, 2002 at 04:08:21PM +0400, Eugene Crosser wrote:
> CVS copy out of May 23 eventually starts busylooping here. I tracked it
> down to this point (smtpserver/smtpserver.c:1493):
Do you use the deprecated ssmtp port ? In that mode there
apparently is too late init of the sslwrspace variable, and
sslwrbuf buffer, which may indeed manifest as what you state.
Although... of sslwrspace is zero, then sslwrbuf is likely
NULL also, which in my thinking should lead to SEGV...
(unless memcpy() does something clever..)
/Matti Aarnio
> Z_write(SS, ptr, len)
> SmtpState * SS;
> const void *ptr;
> int len;
> {
> int i, rc = 0;
> char *buf = (char *)ptr;
>
> while (len > 0) {
> i = SS->sslwrspace - SS->sslwrin; /* space */
> if (i == 0) {
> /* The buffer is full! Flush it */
> typeflush(SS);
> if (gotalarm) break;
> i = SS->sslwrspace;
> }
> /* Copy only as much as can fit into current space */
> if (i > len) i = len;
> memcpy(SS->sslwrbuf + SS->sslwrin, buf, i);
> SS->sslwrin += i;
> buf += i;
> len -= i;
> rc += i;
> }
>
> /* how much written out ? */
> return rc;
> }
>
> somehow SS->sslwrspace is zero on entry to this function, and len is
> non-zero. At the bottom, len is decremented by zero so the "while (len>0)"
> loop runs forever. Any comment?
>
> --
> Eugene Crosser, head of Internet Applications section, +7 501 787 1000
> ROL, Teleross, Golden Telecom, http://user.rol.ru/~crosser/
>
> -
> To unsubscribe from this list: send the line "unsubscribe zmailer" in
> the body of a message to majordomo@nic.funet.fi
--
/Matti Aarnio <mea@nic.funet.fi>
FUNET: Finnish Academic and Research Network
Network Information/Software Archival Service
-
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi