Closed cage2 closed 2 years ago
Hi!
After inspecting the source seems that, in file util.lisp
the function make-ssl-stream
could be the cause of the leak.
I noticed that the callback :close-callback
is not called when the certificate verification process fails, so the TLS context in not freed (i.e. the function cl+ssl:ssl-ctx-free
is not called).
If i set the keyword value :auto-free-p
to t
in this line:
https://github.com/edicl/drakma/blob/master/util.lisp#L337
(cl+ssl:with-global-context (ctx)
with:
(cl+ssl:with-global-context (ctx :auto-free-p t)
The leak seems gone but now i wonder, if the callback is not called, if the stream is properly closed (seems yes but i can not understand where, maybe in the cleanup form of the unwind-protect
of the function http-request
?).
Hope this helps! Bye! C.
Hi!
I am bit confused about what is happening but if i perform some requests using TLS to an host that presents an invalid certificate (in my case a self signed one), the system seems suffering from a memory leak or something and the ram used has a steady increase.
I paste here the code to reproduce the problem and a plot.
Honestly i do not know if the problem is in drakma or in cl+ssl (or in my code perhaps!).
Important note: I am using
cl+ssl
from the git repository, not from quicklisp because the latest version of the library fixed this problem:https://github.com/cl-plus-ssl/cl-plus-ssl/issues/151
Bye! C.