Hylafax Mailing List Archives

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

Can not open document file



Hi all

There is a bug in Hylafax v4.0pl1 that occurs when sending faxes to
multiple destinations. Basically it involves "faxq" prematurely
deleting the fax image and then "faxsend" failing when it tries
to access this image.
"faxsend" raises the following alarm:
SEND: Can not open document file "docq/docNN.ps;00", dirnum 0

Basically what goes wrong is that the "unrefDoc" function in
faxQueueApp.c++ prematurely deletes the image file.
It tests for the existence of the base Postscript file
"docq/docNN.ps". If it doesnt exist then it deletes the image
file.
The problem is that the base postscript file is only created
after the first successful transfer. There are cases where it
doesnt exist but when the image file is required.

The problem can be demonstrated by sending a fax to two destinations
using a single modem and having the following occur:
	1. call to first destination fails (eg number busy)
	2. call to second destination successful
	3. retry of call to first destination will fail after connection with
		FaxSend[3422]: SEND: Can not open document file
					 "docq/doc63.ps;00", dirnum 0

Example in more detail:

1. Send to two destinations:
		sendfax -n -d 4673 -d 4128 /tmp/ies1

(files in "docq")
-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps.90
-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps.91

2. Fax image (;00) is created (by faxq) before attempt to call first
 number (4673):

-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps.90
-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps.91
-rw-------   1 uucp     daemon      8495 Mar  3 01:25 doc63.ps;00

3. Attempt to call 4673 fails (number busy)

Docq entries don't change

4. Successful send (to 4128)

After successful send "docq" files look as follows.
In particular note that the fax image (;00) has been deleted.

-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps
-rw-rw----   2 uucp     59999       7328 Mar  3 01:23 doc63.ps.90

5. Attempt retry to first number called (4673) faxsend fails because
there is no fax image:

Mar  3 01:31:53 comms2 FaxSend[3422]: SEND: Can not open document
file "docq/doc63.ps;00", dirnum 0

NOTE:
Step four is where the error occurs. After the successful send
to the second number (4128) "faxq" deletes the fax image because
it mistakenly believes it is no longer required.
	
faxQueueApp.c++ (function: unrefDoc)
..
if (Sys::stat(doc, sb) < 0 || sb.st_nlink == 1) {
..
	(void) Sys::unlink(files.token(l, ' '));
..
}

At this stage the "doc" (docq/doc63.ps) does not exist.
It is only created after unrefDoc.
Consequently the above "if" statement is true and so the image
is deleted (unlink).


Simply changing this "if" statement is a temporary way of stopping the
error but it means that in some cases the fax image is never
deleted (except by faxqclean).
Alternatively faxq could be chnaged to re-image the file if no fax 
image exists.


Cheers
Ian Senior



Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services