Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read timeout is to low #11

Closed
pchris7489 opened this issue Jun 6, 2024 · 1 comment
Closed

Read timeout is to low #11

pchris7489 opened this issue Jun 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@pchris7489
Copy link

pchris7489 commented Jun 6, 2024

Hello,

In the functions parse_ns_from_xpath and print_response

The part while read -r -u 3 -t 5 xline, the timeout is to low. If there is an antivirus or a slow computer, it will timeout everytime.

It is should possible to customise the timeout, for example :

local timelimit=30 ; [ -n "$timelimit" ] && timelimit=$1; while read -r -u 3 -t $timelimit xline

Where timelimit would be an argument

@mluis7 mluis7 self-assigned this Jun 17, 2024
@mluis7 mluis7 added the bug Something isn't working label Jun 17, 2024
@mluis7
Copy link
Owner

mluis7 commented Jun 17, 2024

@pchris7489
it could be possible to customize the timeout using an env variable. Will see what I can do.
Thanks for taking the time to read the code and suggest a fix.

FYI
The timeout can be reproduced with

{ sleep 3.5; "${lint_cmd[@]}" "$xml_file" 1>&3 <&4; } &

Output

xml2xpath.sh -a -n -x ~/tmp/S2.xml

xml2xpath: find XPath expressions on /home/lmc/tmp/S2.xml
================================================================================ (2024-06-17 16:04:51 -03)

   -a ; 'abs_path=1'
   -n ; default ns prefix: defaultns
   -x ; XML file: '/home/lmc/tmp/S2.xml'
Timeout reading from file descriptor 142 (parse ns stage1)
/home/lmc/projects/bin/xml2xpath.sh: line 528: ((: 1  ELEMENT root: syntax error in expression (error token is "ELEMENT root")
/home/lmc/projects/bin/xml2xpath.sh: line 528: ((: 2  ELEMENT ele1: syntax error in expression (error token is "ELEMENT ele1")
(redacted)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants