Skip to content

Instantly share code, notes, and snippets.

Roger Pack rdp

Block or report user

Report or block rdp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cashes crystal play
require "openssl"
NAME = "Boy"
cipher = OpenSSL::Cipher.new("AES-256-CBC")
cipher.encrypt
key = cipher.random_key
iv = cipher.random_iv
# Username
s2 = IO::Memory.new
View 8481_2.diff
diff --git a/spec/std/openssl/ssl/socket_spec.cr b/spec/std/openssl/ssl/socket_spec.cr
index df3a34a61..b1d931c34 100644
--- a/spec/std/openssl/ssl/socket_spec.cr
+++ b/spec/std/openssl/ssl/socket_spec.cr
@@ -42,7 +42,7 @@ describe OpenSSL::SSL::Socket do
# in tls 1.3, if clients don't read anything and close the connection
# the server still try and write to it a ticket, resulting in a "pipe failure"
# this context method disables the tickets which allows the behavior:
- server_context.disable_session_resume_tickets
+ #server_context.disable_session_resume_tickets
View fix 84841.diff
iff --git a/spec/std/openssl/ssl/socket_spec.cr b/spec/std/openssl/ssl/socket_spec.cr
index 1b6675327..9ba587f1f 100644
--- a/spec/std/openssl/ssl/socket_spec.cr
+++ b/spec/std/openssl/ssl/socket_spec.cr
@@ -20,6 +20,27 @@ describe OpenSSL::SSL::Socket do
end
end
+ it "accepts clients that don't read anything and close the connection" do
+ tcp_server = TCPServer.new(0)
@rdp
rdp / server.cr
Last active Dec 4, 2019 — forked from jgaskins/server.cr
Serve a sample JSON payload in Crystal
View server.cr
require "http"
require "uuid"
require "uuid/json"
class App
include HTTP::Handler
def call(context)
Fiber.yield # Simulate getting data from the DB
response_payload.to_json context.response
View faster_http.patch
diff --git a/src/http/request.cr b/src/http/request.cr
index f942c33f3..ade289eb1 100644
--- a/src/http/request.cr
+++ b/src/http/request.cr
@@ -110,7 +110,7 @@ class HTTP::Request
request = new line.method, line.resource, headers, body, line.http_version, internal: nil
if io.responds_to?(:remote_address)
- request.remote_address = io.remote_address.try &.to_s
+ #request.remote_address = io.remote_address.try &.to_s
View use_libevent_dns.cr
require "socket" # works with 0.31.1 FWIW
struct Socket::Addrinfo
class DnsRequestCbArg
getter value : Int32 | Pointer(LibC::Addrinfo) | Nil
@fiber : Fiber
def initialize
@fiber = Fiber.current
View gist:2ebd7fbed16dd5e2bb0ff5151b3b644b
require "socket"
struct Socket::Addrinfo
class DnsRequestCbArg
getter value : Int32 | Pointer(LibC::Addrinfo) | Nil
@fiber : Fiber
def initialize
@fiber = Fiber.current
View gist:918af45b0ad68cd9bf2e0dc54cad5638
diff --git a/src/debug/dwarf/line_numbers.cr b/src/debug/dwarf/line_numbers.cr
index b4a11139b..790748d88 100644
--- a/src/debug/dwarf/line_numbers.cr
+++ b/src/debug/dwarf/line_numbers.cr
@@ -284,7 +284,9 @@ module Debug
operation_advance = adjusted_opcode // sequence.line_range
increment_address_and_op_index(operation_advance)
registers.line &+= sequence.line_base + (adjusted_opcode % sequence.line_range)
- register_to_matrix(sequence, registers)
+ if (registers.is_stmt || (registers.line.to_i > 0 && registers.column.to_i > 0))
View gist:9e954c12905ed5a16bfae78a200894cb
diff --git a/src/debug/dwarf/line_numbers.cr b/src/debug/dwarf/line_numbers.cr
index b4a11139b..ebbfebbaa 100644
--- a/src/debug/dwarf/line_numbers.cr
+++ b/src/debug/dwarf/line_numbers.cr
@@ -284,7 +284,9 @@ module Debug
operation_advance = adjusted_opcode // sequence.line_range
increment_address_and_op_index(operation_advance)
registers.line &+= sequence.line_base + (adjusted_opcode % sequence.line_range)
- register_to_matrix(sequence, registers)
+ if (registers.is_stmt)
View gist:cde091f6eeb6d1d5daf9384c457d5113
Linux:
Using compiled compiler at `.build/crystal'
["src/crystal/main.cr:47:14 in 'main'",
"src/unicode/data.cr:1554:7 in 'casefold_ranges'",
"_start",
"???"]
You can’t perform that action at this time.