HylaFAX The world's most advanced open source fax server

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

[hylafax-users] Am I being a pest yet? :) (awk conversion script infinite loop...)



So I got most of the new server version stuff figured out, and decided I'd try to have the system convert incoming faxes to PDFs and email them. (I moved the "high port assignment" range on the box and opened that range; this should be reasonably "safe" and allows the passive mode to work for remote clients. Not ideal but I can live with it.)

Encoding to PDFs is simple and supported, right?

Uh, not quite. The b64-encode.awk function goes into an infinite loop on my system (FreeBSD 6.2-STABLE) when presented an imput file. It does first encode the correct data file but then starts returning an infinite stream of nonsense.

Here's what I'm getting when invoked manually on a short file:

awk -f b64-encode.awk archive | more produces.....

IyEgL3Vzci9sb2NhbC9iaW4vYmFzaAoKIwojIFRoaXMgc2NyaXB0IGlzIGNhbGxlZCBieSBm
YXhxY2xlYW4gdG8gYXJjaGl2ZSB0aGUgam9iCiMKCkpPQklEPSQxCkFSQ0hJVkVUTz1hcmNo
aXZlLyRKT0JJRApGSUxFVFlQRVM9Il4hcG9zdHNjcmlwdDp8XiF0aWZmOnxeIXBjbDp8XiFw
ZGY6fF4hZGF0YToiClFGSUxFPWRvbmVxL3EkSk9CSUQKQ09NTUxPR1M9YGZpbmQgbG9nIC10
eXBlIGYgLW5hbWUgImMqIiAgLXByaW50IHwgeGFyZ3MgLW41MCAgZ3JlcCAtbCAiU0VORCBG
QVg6IEpPQiAkSk9CSUQiYApET0NTPWBncmVwIC1FICRGSUxFVFlQRVMgJFFGSUxFIHwgc2Vk
ICdzLy4qOi8vZydgCk5VTUJFUj1gZ3JlcCAiXm51bWJlcjoiICRRRklMRSB8IHNlZCAncy9e
bnVtYmVyOi8vZydgCgojCiMgRGVmYXVsdCBhcmNoaXZpbmcgaXMgdG8gY3JlYXRlIGEgZGly
ZWN0b3J5IGluIHRoZSBhcmNoaXZlIGRpcmVjdG9yeSAKIyBuYW1lZCBhcyB0aGUgam9iIG51
bWJlciwgbW92ZSB0aGUgcSBmaWxlIGFuZCB0aGUgZG9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goKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK
CgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoK

With the last part repeating until killed.

Needless to say this makes the translation not work!

I assume this has something to do with the read loop not detecting EOF correctly, although the code LOOKS ok......

Something that might need to be looked at..... I've set it back to send TIF files until this can be investigated.

--
Karl Denninger (karl@xxxxxxxxxxxxx)
http://www.denninger.net




%SPAMBLOCK-SYS: Matched [@hylafax.org], message ok



____________________ HylaFAX(tm) Users Mailing List _______________________ To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null *To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*




Project hosted by iFAX Solutions