Henrique Vicente de Oliveira Pinto
2018-06-15 14:11:48 UTC
Hi,
I'm trying to understand what is happening here...
If I pipe the curl output to another process, I get a different output than
if curl prints directly on stdout.
Example / How to reproduce:
1. curl -v google.com
2. curl -v google.com | cat
then diff both outputs.
On the second time besides getting the multiline progress bar I get some
extra info (especially when using --verbose) -- mostly, lots of "{ [219
bytes data]" blocks.
I have tried using --trace and --trace-ascii to avoid getting such info
lines but failed to figure out how to do so.
Question: What would be the most straight-forward way for me to get exactly
the same output I get when I use curl directly?
This code seems to be the culprit, but I haven't gone deeper into the
matter:
https://github.com/curl/curl/blob/c45360d4633850839bb9c2d77dbf8a8285e9ad49/src/tool_cb_dbg.c#L141-L153
Best regards,
Henrique Vicente
https://henvic.github.io/
https://github.com/henvic
http://flickr.com/photos/henriquev/
I'm trying to understand what is happening here...
If I pipe the curl output to another process, I get a different output than
if curl prints directly on stdout.
Example / How to reproduce:
1. curl -v google.com
2. curl -v google.com | cat
then diff both outputs.
On the second time besides getting the multiline progress bar I get some
extra info (especially when using --verbose) -- mostly, lots of "{ [219
bytes data]" blocks.
I have tried using --trace and --trace-ascii to avoid getting such info
lines but failed to figure out how to do so.
Question: What would be the most straight-forward way for me to get exactly
the same output I get when I use curl directly?
This code seems to be the culprit, but I haven't gone deeper into the
matter:
https://github.com/curl/curl/blob/c45360d4633850839bb9c2d77dbf8a8285e9ad49/src/tool_cb_dbg.c#L141-L153
Best regards,
Henrique Vicente
https://henvic.github.io/
https://github.com/henvic
http://flickr.com/photos/henriquev/