{"action":"created","issue":{"url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/39","repository_url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl","labels_url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/39/comments","events_url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/39/events","html_url":"https://github.com/cl-plus-ssl/cl-plus-ssl/issues/39","id":193315761,"number":39,"title":"[question] ssl-stream closes provided handle","user":{"login":"dkochmanski","id":6871201,"avatar_url":"https://avatars.githubusercontent.com/u/6871201?v=3","gravatar_id":"","url":"https://api.github.com/users/dkochmanski","html_url":"https://github.com/dkochmanski","followers_url":"https://api.github.com/users/dkochmanski/followers","following_url":"https://api.github.com/users/dkochmanski/following{/other_user}","gists_url":"https://api.github.com/users/dkochmanski/gists{/gist_id}","starred_url":"https://api.github.com/users/dkochmanski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkochmanski/subscriptions","organizations_url":"https://api.github.com/users/dkochmanski/orgs","repos_url":"https://api.github.com/users/dkochmanski/repos","events_url":"https://api.github.com/users/dkochmanski/events{/privacy}","received_events_url":"https://api.github.com/users/dkochmanski/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-03T21:51:46Z","updated_at":"2016-12-04T09:37:37Z","closed_at":null,"body":"When `ssl-stream` is created and `make-ssl-client-stream` takes a file descriptor (like in Drakma case) as its first argument, its `close` method calls `close-socket` (on POSIX that leads to call of C function \"close\").\r\n\r\nSince `close-callback` is set to the closure calling `close` on the original stream, we call C function \"close\" once again what leads to \"Bad file descriptor\" condition.\r\n\r\nMy question is whenever ssl-stream `close` method should close the socket if it's a descriptor (`integerp` `cond` branch in close method).\r\n\r\nAnother one is that if its OK to pass a flexi-stream as a socket to `make-ssl-client-stream`? If yes, then I'll make a pull request on `drakma` to pass a stream instead of `(cl+ssl:stream-fd s)` as the first argument. This seems to work.\r\n\r\nI'll also harden ECL's close to avoid crash from the issue linked below (linked for context).\r\n\r\nFor the underlying issue see: https://gitlab.com/embeddable-common-lisp/ecl/issues/267#note_19385251/267#note_19385251"},"comment":{"url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/comments/264693654","html_url":"https://github.com/cl-plus-ssl/cl-plus-ssl/issues/39#issuecomment-264693654","issue_url":"https://api.github.com/repos/cl-plus-ssl/cl-plus-ssl/issues/39","id":264693654,"user":{"login":"avodonosov","id":2444,"avatar_url":"https://avatars.githubusercontent.com/u/2444?v=3","gravatar_id":"","url":"https://api.github.com/users/avodonosov","html_url":"https://github.com/avodonosov","followers_url":"https://api.github.com/users/avodonosov/followers","following_url":"https://api.github.com/users/avodonosov/following{/other_user}","gists_url":"https://api.github.com/users/avodonosov/gists{/gist_id}","starred_url":"https://api.github.com/users/avodonosov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avodonosov/subscriptions","organizations_url":"https://api.github.com/users/avodonosov/orgs","repos_url":"https://api.github.com/users/avodonosov/repos","events_url":"https://api.github.com/users/avodonosov/events{/privacy}","received_events_url":"https://api.github.com/users/avodonosov/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T09:37:37Z","updated_at":"2016-12-04T09:37:37Z","body":"cc @deadtrickster \r\n\r\n1) Closing the file descriptor was implemented in the scope of #20. Now revisiting this I think it might be a wrong solution, because our docs [say] (https://common-lisp.net/project/cl-plus-ssl/): \"If fd-or-stream is a lisp stream, the SSL stream will close it automatically. File descriptors are not closed automatically.\"\r\n\r\n2) Passing a flexi-stream will enable cl+ssl's Lisp BIO (BIO is a stream-like abstraction in OpenSSL, We provide a CL-implemented BIO to OpenSSL and it calls us to read / write bytes). As far as I remember LispBIO remains buggy for years and no-one fixed that."}}
{"actor":{"display_login":"avodonosov"}}