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

fix headers/body order in console #55

Merged
merged 1 commit into from
May 8, 2023
Merged

fix headers/body order in console #55

merged 1 commit into from
May 8, 2023

Conversation

mateusz834
Copy link
Contributor

Normally curlie returns output like that (as expected):

[mateusz@arch curlie (fix)]$ curlie localhost:8080
HTTP/1.1 200 OK
Date: Fri, 20 May 2022 19:35:04 GMT
Content-Length: 30
Content-Type: text/plain; charset=utf-8

Hello
Hello
Hello
Hello
Hello

But sometimes it returns like so: (around 5% of responses)

[mateusz@arch curlie (fix)]$ curlie localhost:8080
Hello
Hello
Hello
Hello
Hello
HTTP/1.1 200 OK
Date: Fri, 20 May 2022 19:35:40 GMT
Content-Length: 30
Content-Type: text/plain; charset=utf-8

For me it only happens when querying localhost (probably because of the low latency??).
This PR fixes it.

@blackheaven
Copy link
Contributor

can it be merged?

@rs rs merged commit e63e657 into rs:master May 8, 2023
js-everts added a commit to js-everts/curlie that referenced this pull request Jul 2, 2023
This reverts commit e63e657.

The commit above introduced sane-ordering to the terminal output by
prioritizing headers first and then the response body. But unfortunately
it introduces a deadlock in cases where we have no headers to print.

Commands like `curlie` or `curlie -h` will hang.

Sometimes it also causes the program to deadlock even when headers are
present. It probably has something to do with the code failing to
properly detect where the headers' section ends. But this is difficult
to reproduce.
rs pushed a commit that referenced this pull request Jul 3, 2023
This reverts commit e63e657.

The commit above introduced sane-ordering to the terminal output by
prioritizing headers first and then the response body. But unfortunately
it introduces a deadlock in cases where we have no headers to print.

Commands like `curlie` or `curlie -h` will hang.

Sometimes it also causes the program to deadlock even when headers are
present. It probably has something to do with the code failing to
properly detect where the headers' section ends. But this is difficult
to reproduce.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants