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

Error: undefined constant Stream::State::Idle #2

Open
Dan-Do opened this issue Nov 30, 2021 · 5 comments
Open

Error: undefined constant Stream::State::Idle #2

Dan-Do opened this issue Nov 30, 2021 · 5 comments

Comments

@Dan-Do
Copy link

Dan-Do commented Nov 30, 2021

When compiling the client

client.request(headers) do |headers, body|
             ^------
Error: instantiating 'Duo::Client#request(HTTP::Headers)'

In lib/duo/src/duo/client.cr:57:36

 57 | stream = @connection.streams.create
                                   ^-----
Error: instantiating 'Duo::Streams#create()'

In lib/duo/src/duo/streams.cr:47:24

 47 | def create(state = Stream::State::Idle)
                         ^------------------
Error: undefined constant Stream::State::Idle
@Dan-Do
Copy link
Author

Dan-Do commented Nov 30, 2021

After changing to Duo::State::Idle, it compiled ok. But there is exeption:

Unhandled exception:  (Duo::Error)
  from /home/ali33/lib/duo/src/duo/connection.cr:217:9 in 'read_frame_header'
  from /home/ali33/lib/duo/src/duo/connection.cr:62:7 in 'call'
  from /home/ali33/lib/duo/src/duo/client.cr:33:7 in 'initialize'
  from /home/ali33/lib/duo/src/duo/client.cr:10:5 in 'new'

Is the client usable when connecting to other host other than localhost?

@Dan-Do
Copy link
Author

Dan-Do commented Nov 30, 2021

I manually changed the max_frame_size value, then it can connect to the server. But the server responded with message HTTP/1.1 400 Bad Request\r\nDate: Tue, 30 Nov 2021 09:11:31 GMT\r\nContent-Type: text/html; charset=UTF-8\r\nContent-Length: 166\r\nConnection: close\r\n\r\n<html>\r\n<head><title>400 Bad Request</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>400 Bad Request</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n

@eliasjpr
Copy link
Contributor

eliasjpr commented May 7, 2022

@Dan-Do thanks for reporting this. Let me know if you have a fix for this if yes feel free to create a PR

@eliasjpr
Copy link
Contributor

Allow me a few days to look into this issue.

@Dan-Do
Copy link
Author

Dan-Do commented Dec 1, 2023

@Dan-Do thanks for reporting this. Let me know if you have a fix for this if yes feel free to create a PR

No, I tried but no solutions works. Now I have to move to libcurl.

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