Skip to content

Commit

Permalink
Check the response to the CONNECT frame to see if there was an error
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Small committed Jun 2, 2016
1 parent a3bbff0 commit 8449534
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/resty/rabbitmqstomp.lua
Expand Up @@ -116,8 +116,18 @@ function _login(self)
return nil, err
end

local frame, err = _receive_frame(self)
if not frame then
return nil, err
end

-- We successfully received a frame, but it was an ERROR frame
if sub( frame, 1, len( 'ERROR' ) ) == 'ERROR' then
return nil, frame
end

self.state = STATE_CONNECTED
return _receive_frame(self)
return frame
end


Expand Down

0 comments on commit 8449534

Please sign in to comment.