openssl: fix error handling
The recent thread-safety change wasn't right.
This commit is contained in:
parent
8055d9f5f8
commit
fc2eb1c11c
|
@ -312,9 +312,9 @@
|
|||
;; so that this library is thread-safe (at the level of Racket threads)
|
||||
(atomically
|
||||
(define v (thunk))
|
||||
(define e (if (negative? v)
|
||||
(SSL_get_error ssl v)
|
||||
0))
|
||||
(define e (if (positive? v)
|
||||
0
|
||||
(SSL_get_error ssl v)))
|
||||
(define estr
|
||||
(cond
|
||||
[(= e SSL_ERROR_SSL)
|
||||
|
@ -649,7 +649,7 @@
|
|||
[else
|
||||
(set! must-read-len #f)
|
||||
((mzssl-error mzssl) 'read-bytes
|
||||
"SSL read failed ~a"
|
||||
"SSL read failed ~a ~a"
|
||||
estr)]))))))]
|
||||
[top-read
|
||||
(lambda (buffer)
|
||||
|
|
6
collects/tests/openssl/github.rkt
Normal file
6
collects/tests/openssl/github.rkt
Normal file
|
@ -0,0 +1,6 @@
|
|||
#lang racket/base
|
||||
(require net/url)
|
||||
|
||||
(unless (input-port? (get-pure-port (string->url "https://api.github.com/")))
|
||||
(error "failed for https://api.github.com/"))
|
||||
|
Loading…
Reference in New Issue
Block a user