duo icon indicating copy to clipboard operation
duo copied to clipboard

Error: undefined constant Stream::State::Idle

Open Dan-Do opened this issue 2 years ago • 5 comments

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 avatar Nov 30 '21 07:11 Dan-Do

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 avatar Nov 30 '21 07:11 Dan-Do

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

Dan-Do avatar Nov 30 '21 12:11 Dan-Do

@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 avatar May 07 '22 15:05 eliasjpr

Allow me a few days to look into this issue.

eliasjpr avatar Nov 27 '23 15:11 eliasjpr

@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.

Dan-Do avatar Dec 01 '23 14:12 Dan-Do