From: Eli Zaretskii <eliz@gnu.org>
To: "J.P." <jp@neverwas.me>
Cc: larsi@gnus.org, gnuhacker@member.fsf.org, 53941@debbugs.gnu.org
Subject: bug#53941: Last-minute socks.el improvements for Emacs 29?
Date: Mon, 28 Nov 2022 19:12:19 +0200 [thread overview]
Message-ID: <8335a3nguk.fsf@gnu.org> (raw)
In-Reply-To: <87mt8baygn.fsf_-_@neverwas.me> (jp@neverwas.me)
> From: "J.P." <jp@neverwas.me>
> Cc: Jacobo <gnuhacker@member.fsf.org>, Lars Ingebrigtsen <larsi@gnus.org>,
> Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 28 Nov 2022 07:30:16 -0800
>
> I've lifted some fixes and minor enhancements from my POC stuff posted
> to this thread earlier this year. Nothing is directly Tor related, so I
> can create a new bug report, if necessary.
>
> The second patch fixes a problem involving SOCKS 5 error handling. It
> also adds support for SOCKS 4a, which allows tools that don't speak
> SOCKS 5, like socat, to resolve host names. The third addresses a couple
> FIXMEs but no bugs, strictly speaking. The fourth is just a demo [1].
> Happy to explain whatever in detail.
I'm really uncomfortable with installing these changes before the release
branch is cut. The changes are hardly trivial, some controversial even to
my eyes, even though I'm no expert on network connections. For example:
> +(defun socks-open-connection (server-info &rest stream-params)
> + "Create and initialize a SOCKS process.
> +Perform authentication if needed. Expect SERVER-INFO to take the
> +form of `socks-server' and STREAM-PARAMS to be keyword params
> +accepted by `open-network-stream'."
> (interactive)
> + (unless (plist-member stream-params :coding)
> + (setf (plist-get stream-params :coding) '(binary . binary)))
AFAIU, this constitutes an incompatible change in behavior: the default for
:coding is was never 'binary' before, it was determined from the locale's
preferences. Why are we making this change here?
> @@ -446,7 +474,11 @@ socks-send-command
> nil ; Sweet sweet success!
> (delete-process proc)
> (error "SOCKS: %s"
> - (nth (or (process-get proc 'socks-reply) 1) socks-errors)))
> + (let ((no (or (process-get proc 'socks-reply) 99)))
> + (or (if (eq version 5) ; 99 - 90 >= length(errors)
> + (nth no socks-errors)
> + (nth (- no 90) socks--errors-4))
> + "Unknown error"))))
I don't really understand the semantics here (so maybe comments need to be
upgraded), but the old and the new versions don't look to me like equivalent
code -- why the change?
> -(when socks-override-functions
> - (advice-add 'open-network-stream :around #'socks--open-network-stream))
> +;; Libraries typically offer a "stream opener" option, such as ERC's
> +;; `erc-server-connect-function'. These provide a level of
> +;; flexibility tantamount to what this variable formerly offered.
> +(make-obsolete-variable
> + 'socks-override-functions
> + "see `socks-open-network-stream' and `socks-connect-function'." "29.1")
Why this last-minute obsolescence?
> +(defun socks-open-network-stream (name buffer host service &rest params)
> + "Open and return a connection, possibly proxied over SOCKS.
The changes in this public function are so significant that I don't
understand how they can be suggested so close to the branching.
If it is possible to add support for SOCKS 4a without affecting any
previously supported versions, I'm fine. Adding tests is also fine. But
for the rest, I think you should wait until after the release branch is cut
and install this on the master branch. Sorry, it really is too late for
such changes.
next prev parent reply other threads:[~2022-11-28 17:12 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 11:09 bug#53941: 27.2; socks + tor dont work with https Jacobo
2022-02-14 12:37 ` J.P.
2022-02-19 21:04 ` Jacobo
2022-02-21 15:01 ` J.P.
2022-03-01 14:29 ` J.P.
2022-03-02 2:37 ` J.P.
2022-03-06 2:40 ` Jacobo
2022-03-06 2:58 ` J.P.
2022-03-07 7:09 ` J.P.
2022-03-10 8:58 ` J.P.
2022-11-28 15:30 ` bug#53941: Last-minute socks.el improvements for Emacs 29? J.P.
2022-11-28 17:12 ` Eli Zaretskii [this message]
2022-11-29 14:24 ` J.P.
2022-11-29 14:36 ` Eli Zaretskii
2023-09-06 22:25 ` bug#53941: 27.2; socks + tor dont work with https Stefan Kangas
2023-09-07 5:53 ` Eli Zaretskii
2023-09-07 13:25 ` J.P.
2023-09-07 13:47 ` Stefan Kangas
2023-09-08 2:55 ` J.P.
2023-09-08 11:04 ` Stefan Kangas
2023-10-18 13:38 ` J.P.
2023-12-19 16:29 ` J.P.
2023-09-08 13:28 ` J.P.
2023-09-09 14:05 ` J.P.
2024-08-23 21:46 ` Christopher Howard
2024-09-14 13:33 ` Stefan Kangas
2024-09-16 1:59 ` J.P.
2024-09-16 13:34 ` Robert Pluim
2024-09-17 1:52 ` J.P.
2024-09-17 7:29 ` Robert Pluim
2024-09-17 12:41 ` Eli Zaretskii
2024-09-17 13:54 ` Robert Pluim
2024-09-18 1:10 ` J.P.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8335a3nguk.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=53941@debbugs.gnu.org \
--cc=gnuhacker@member.fsf.org \
--cc=jp@neverwas.me \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).