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

examples/json does not work with http/2 #215

Closed
Lingli05 opened this issue May 8, 2018 · 4 comments
Closed

examples/json does not work with http/2 #215

Lingli05 opened this issue May 8, 2018 · 4 comments

Comments

@Lingli05
Copy link

Lingli05 commented May 8, 2018

Tested the examples/json using the following curl commands:

  1. curl --verbose -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/

  2. curl --verbose -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/mjsonrust

  3. curl --verbose -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/manual

  4. curl --verbose -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/extractor

Everything worked as expected. However adding --http2-prior-knowledge to the above commands would trigger failure:

  1. curl --verbose --http2-prior-knowledge -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/>

  2. curl --verbose --http2-prior-knowledge -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/mjsonrust

  3. curl --verbose --http2-prior-knowledge -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/manual

  4. curl --verbose --http2-prior-knowledge -d '{"name":"value1", "number":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/extractor

I was hoping index_mjsonrust() and index_manual() would work with http/2, but saw the following after dumping req in each function:

index_jsonrust_
HttpRequest HTTP/2.0 POST:/mjsonrust
headers:
"user-agent": "curl/7.58.0"
"accept": "/"
"content-type": "application/json"
"content-length": "31"

ERROR 2018-05-08T21:12:31Z: actix_web::pipeline: Error occured during request handling: user error: release capacity too big
INFO 2018-05-08T21:12:31Z: actix_web::middleware::logger: 127.0.0.1:37984 [08/May/2018:17:12:31 -0400] "POST /mjsonrust HTTP/2.0" 500 0 "-" "curl/7.58.0" 0.000642

fafhrd91 added a commit that referenced this issue May 8, 2018
@fafhrd91
Copy link
Member

fafhrd91 commented May 8, 2018

could you try master?

@fafhrd91
Copy link
Member

fafhrd91 commented May 9, 2018

Please, reopen if you still see same behavior

@fafhrd91 fafhrd91 closed this as completed May 9, 2018
fafhrd91 added a commit that referenced this issue May 9, 2018
@Lingli05
Copy link
Author

Lingli05 commented May 9, 2018

Tested and it worked well now. Highly appreciated!

@fafhrd91
Copy link
Member

fafhrd91 commented May 9, 2018

fix is part of 0.6.1 release

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

No branches or pull requests

2 participants