Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/debug/server_cdp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def initialize s
@sock = s
end

def handshake
def handshake
req = @sock.readpartial 4096
$stderr.puts '[>]' + req if SHOW_PROTOCOL

if req.match /^Sec-WebSocket-Key: (.*)\r\n/
accept = Base64.strict_encode64 Digest::SHA1.digest "#{$1}258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
@sock.print "HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: #{accept}\r\n\r\n"
Expand All @@ -36,7 +36,7 @@ def send **msg
fin = 0b10000000
opcode = 0b00000001
frame << fin + opcode

mask = 0b00000000 # A server must not mask any frames in a WebSocket Protocol.
bytesize = msg.bytesize
if bytesize < 126
Expand All @@ -48,7 +48,7 @@ def send **msg
payload_len = 0b01111111
ex_payload_len = [bytesize].pack('Q>').bytes
end

frame << mask + payload_len
frame.push *ex_payload_len if ex_payload_len
frame.push *msg.bytes
Expand Down Expand Up @@ -482,7 +482,7 @@ def process_cdp args
res = {}
fid, expr = args
frame = @target_frames[fid]

if frame && (b = frame.binding)
b = b.dup
special_local_variables current_frame do |name, var|
Expand All @@ -504,7 +504,7 @@ def process_cdp args
} and (result = Exception.new("Error: Not defined global variable: #{expr.inspect}"))
when /(\A[A-Z][a-zA-Z]*)/
unless result = search_const(b, $1)
result = Exception.new("Error: Not defined constans: #{expr.inspect}")
result = Exception.new("Error: Not defined constant: #{expr.inspect}")
end
else
begin
Expand Down
6 changes: 3 additions & 3 deletions lib/debug/server_dap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def process
rescue PostmortemError
send_response req,
success: false, message: 'postmortem mode',
result: "'Next' is not supported while postrmotem mode"
result: "'Next' is not supported while postmortem mode"
end
when 'stepIn'
begin
Expand All @@ -237,7 +237,7 @@ def process
rescue PostmortemError
send_response req,
success: false, message: 'postmortem mode',
result: "'stepIn' is not supported while postrmotem mode"
result: "'stepIn' is not supported while postmortem mode"
end
when 'stepOut'
begin
Expand All @@ -247,7 +247,7 @@ def process
rescue PostmortemError
send_response req,
success: false, message: 'postmortem mode',
result: "'stepOut' is not supported while postrmotem mode"
result: "'stepOut' is not supported while postmortem mode"
end
when 'terminate'
send_response req
Expand Down