Skip to content

Commit

Permalink
Merge pull request #41 from nulogy/master
Browse files Browse the repository at this point in the history
Adds default SSL port implementation
  • Loading branch information
michaelklishin committed Feb 28, 2012
2 parents 2b83680 + bf2048a commit 9ea7a70
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions ext/amqp-0.9.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"minor-version": 9,
"revision": 1,
"port": 5672,
"ssl_port": 5671,
"copyright": [
"Copyright (C) 2008-2009 LShift Ltd, Cohesive Financial Technologies LLC,\n",
"and Rabbit Technologies Ltd\n",
Expand Down
6 changes: 4 additions & 2 deletions ext/qparser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def spec_details(spec)
meta['minor'] = spec['minor-version']
meta['revision'] = spec['revision']
meta['port'] = spec['port']
meta['ssl_port'] = spec['ssl_port']
meta['comment'] = "AMQ Protocol version #{meta['major']}.#{meta['minor']}.#{meta['revision']}"

meta
Expand Down Expand Up @@ -188,6 +189,7 @@ module Protocol
VERSION_MINOR = <%= spec_info['minor'] %>
REVISION = <%= spec_info['revision'] %>
PORT = <%= spec_info['port'] %>
SSL_PORT = <%= spec_info['ssl_port'] %>
RESPONSES = {
<%- other_constants.each do |value, name| -%>
Expand Down Expand Up @@ -373,10 +375,10 @@ def == frame
end
end
def self.parse buf
def self.parse(buf, cancellator = nil)
buf = Transport::Buffer.new(buf) unless buf.is_a? Transport::Buffer
buf.extract do
id, channel, payload, footer = buf.read(:octet, :short, :longstr, :octet)
id, channel, payload, footer = buf.read(cancellator, :octet, :short, :longstr, :octet)
Qrack::Transport.const_get(@types[id]).new(payload, channel) if footer == FOOTER
end
end
Expand Down
5 changes: 3 additions & 2 deletions lib/qrack/protocol/spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@


#:stopdoc:
# this file was autogenerated on 2011-07-21 07:23:28 +0100
# using amqp-0.9.1.json (mtime: 2011-07-20 19:10:34 +0100)
# this file was autogenerated on 2012-02-28 11:22:27 -0500
# using amqp-0.9.1.json (mtime: 2012-02-28 10:50:44 -0500)
#
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')

Expand All @@ -15,6 +15,7 @@ module Protocol
VERSION_MINOR = 9
REVISION = 1
PORT = 5672
SSL_PORT = 5671

RESPONSES = {
200 => :REPLY_SUCCESS,
Expand Down
2 changes: 1 addition & 1 deletion lib/qrack/transport/frame.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


#:stopdoc:
# this file was autogenerated on 2011-07-21 07:23:28 +0100
# this file was autogenerated on 2012-02-28 11:22:27 -0500
#
# DO NOT EDIT! (edit ext/qparser.rb and config.yml instead, and run 'ruby qparser.rb')

Expand Down
5 changes: 5 additions & 0 deletions spec/spec_09/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@
}.should_not raise_error(Exception)
end

it "should know the default port of a SSL connection" do
b = Bunny.new(:ssl => true)
b.port.should eql(5671)
end

end

0 comments on commit 9ea7a70

Please sign in to comment.