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

stackoverflowErorr for long curl, where we are calling getArgsFromCommand() #20

Open
saurabh1mishra opened this issue Jan 18, 2019 · 1 comment
Assignees
Labels

Comments

@saurabh1mishra
Copy link

Describe the bug
we are getting StackOverflow bug where curl has a big payload for the post & put commands.
after debugging found that line 44 in ReadArguments.class is throwing the error
where it's finding regex pattern for Body ie -d {}.

image

@libetl
Copy link
Owner

libetl commented Jan 21, 2019

Hi Saurabh,

Thanks for the feedback and for appreciating this lib.

Java impl for parsing regexs is using recursion to such an extend that we frequently notice stackoverflow errors.
What I tried to do was to make a powerful regex that is able to parse both simple quotes and double quotes.
I have no idea how to improve the regex without degrading it.
Instead, I implemented a placeholder feature to write text that will not be catched by the regex matcher.

Take a look at the placeholders unit test

this.assertOk (this.curl ("-k --cert-type $curl_placeholder_0 --cert $curl_placeholder_1 --key-type $curl_placeholder_2 --key $curl_placeholder_3 https://localhost:%d/public/",

For the biggest slices of arguments, you can consider putting them as placeholders.

Good luck and tell me if you are not satisfied with that solution.
We can think of having several regexs for more efficiency.

@libetl libetl self-assigned this Jan 21, 2019
@libetl libetl added the bug label Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants