>
> ----- Original Message -----
> From: "Claudio Jeker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, February 05, 2004 8:21 PM
> Subject: Re: QMQP problem
>
> ...
>
> > > If I do a flush on the sending side it starts up ten delivries at
once.
> Some
> > > of them return with the "communication_with_mail_server_failed"
message.
> On
> > > the receiving side I see that some of them end with status 28416 as
> above.
> > > Some of them simply end with status 0 however I don't get an OK
messages
> on
> > > the receiving side (e.g. ...ok 1075813267 qp 23974 ddc saved 43
percent)
> for
> > > all of the ending connections with status 0.
> > >
> > > Let me know what could be the cause of this problem or how I should
> analyze
> > > the log-files. Thanks.
> > >
> >
> > Hmm. I will try to find out why qmail-qmqpd blocks after printing the OK
> > line. Seems very strange.
>
Hi Claudio,
Remember this thread about the communication problem in QMQP on slow WAN
connections? Anyway, I started analyzing the code of qmqpc and remote and I
noticed that qmqpc uses a read / write timeout of 60 secs and remote a
timeout of 1200 secs. I wrote a patch (below) to make the read / write
timeout configurable in a similar fashion as with remote in a control file
named "timeoutqmqpc" (for remote it is "timeoutremote"). Setting this
timeout to 1200 solved my problem and connection problems disappear.
After applying the patch, default behavior of qmqpc stays the same. This
means that if the control/timeoutqmqpc does not exist, the timeout is still
60 secs. I was wondering if you could add this patch to the distribution. It
might help some people in the future.
Thanks.
regards
Frank
--- qmail-qmqpc.c.orig 2004-04-14 02:16:01.000000000 +0700
+++ qmail-qmqpc.c 2004-04-14 02:15:05.000000000 +0700
@@ -39,6 +39,7 @@
void die_format(void) { _exit(91); }
int timeoutconnect = 60;
+int timeout = 60;
int lasterror = 55;
int qmqpfd;
@@ -65,7 +66,7 @@
switch (r) {
case Z_OK:
if (stream.avail_out == 0) {
- r = timeoutwrite(60,qmqpfd,zbuf,sizeof(zbuf));
+ r = timeoutwrite(timeout,qmqpfd,zbuf,sizeof(zbuf));
if (r <= 0) die_conn();
stream.avail_out = sizeof(zbuf);
stream.next_out = zbuf;
@@ -80,7 +81,7 @@
} while (r!=Z_STREAM_END);
if (stream.avail_out != sizeof(zbuf)) {
/* write left data */
- r = timeoutwrite(60,qmqpfd,zbuf,sizeof(zbuf)-stream.avail_out);
+ r = timeoutwrite(timeout,qmqpfd,zbuf,sizeof(zbuf)-stream.avail_out);
if (r <= 0) die_conn();
}
if (deflateEnd(&stream) != Z_OK) die_format();
@@ -90,7 +91,7 @@
int saferead(int fd, void *buf, int len)
{
int r;
- r = timeoutread(60,qmqpfd,buf,len);
+ r = timeoutread(timeout,qmqpfd,buf,len);
if (r <= 0) die_conn();
return r;
}
@@ -105,7 +106,7 @@
switch (r) {
case Z_OK:
if (stream.avail_out == 0) {
- r = timeoutwrite(60,qmqpfd,zbuf,sizeof(zbuf));
+ r = timeoutwrite(timeout,qmqpfd,zbuf,sizeof(zbuf));
if (r <= 0) die_conn();
stream.avail_out = sizeof(zbuf);
stream.next_out = zbuf;
@@ -117,7 +118,7 @@
} while (stream.avail_in != 0);
return len;
#endif
- r = timeoutwrite(60,qmqpfd,buf,len);
+ r = timeoutwrite(timeout,qmqpfd,buf,len);
if (r <= 0) die_conn();
return r;
}
@@ -253,6 +254,9 @@
if (control_readint(&timeoutconnect,"control/timeoutconnect") == -1)
die_control();
+ if (control_readint(&timeout,"control/timeoutqmqpc") == -1)
+ die_control();
+
if (control_rldef(&outgoingip, "control/qmqpcip", 0, "0.0.0.0") == -1)
die_control();
if (!stralloc_0(&outgoingip)) nomem();