From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#53941: Last-minute socks.el improvements for Emacs 29? Date: Mon, 28 Nov 2022 19:12:19 +0200 Message-ID: <8335a3nguk.fsf@gnu.org> References: <87pmntfym7.fsf@example.com> <8735kl1v58.fsf@neverwas.me> <87a6emftzx.fsf@example.com> <87k0do5km1.fsf@neverwas.me> <87pmn5n3tu.fsf@neverwas.me> <87mti99j1f.fsf@neverwas.me> <87wnh7hkgi.fsf@gnu.org> <87pmmz947k.fsf@neverwas.me> <8735ju44sk.fsf@neverwas.me> <87lexikwu5.fsf@neverwas.me> <87mt8baygn.fsf_-_@neverwas.me> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38967"; mail-complaints-to="usenet@ciao.gmane.io" Cc: larsi@gnus.org, gnuhacker@member.fsf.org, 53941@debbugs.gnu.org To: "J.P." Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 28 18:12:17 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozhg0-0009tv-SD for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Nov 2022 18:12:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozhft-0000SV-US; Mon, 28 Nov 2022 12:12:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozhfm-0000Qg-LA for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 12:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozhfm-0002O9-El for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 12:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozhfm-0006NK-9E for bug-gnu-emacs@gnu.org; Mon, 28 Nov 2022 12:12:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Nov 2022 17:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53941 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 53941-submit@debbugs.gnu.org id=B53941.166965552024500 (code B ref 53941); Mon, 28 Nov 2022 17:12:02 +0000 Original-Received: (at 53941) by debbugs.gnu.org; 28 Nov 2022 17:12:00 +0000 Original-Received: from localhost ([127.0.0.1]:49799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozhfk-0006N6-0M for submit@debbugs.gnu.org; Mon, 28 Nov 2022 12:12:00 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:58436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozhfg-0006N0-E7 for 53941@debbugs.gnu.org; Mon, 28 Nov 2022 12:11:58 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozhfa-0002KG-P2; Mon, 28 Nov 2022 12:11:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MdHbX+/5Upwy/4NkCznjDlv2wufskl1ZlG4CAi/C+OM=; b=qN7jwXUiFq0z H3ABIo3UEWtFxbGootBuoANypArmhIctA/Vw9eXZHKn3pse6+AHysQxMP5cPQumjk0NnmWe35Vug3 PNqa/bRtrXCRoytpp/L5eALzAKaqN5XGmIvkr+U6srvY2/q6AX8xRgd4VqEATrqVh2z+1SxchxfCh jqvchK7FMEYxC0G0yLtftwbGSw7SEcKd2qPZtiEj/ELUvD2ntuo4VpSFtNvpHlP8lpfNcakmjq8C+ Q5o8L6PYL1HCxbs6+tToPQcKFmSWn57UO+8EjwvEZYTUszuaCsiQr1pEN1kirdy8T6+thNuCUHJkH Y39bURPmSBlDD+C6rEP/sw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozhfa-0000t9-4p; Mon, 28 Nov 2022 12:11:50 -0500 In-Reply-To: <87mt8baygn.fsf_-_@neverwas.me> (jp@neverwas.me) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249331 Archived-At: > From: "J.P." > Cc: Jacobo , Lars Ingebrigtsen , > Eli Zaretskii > 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.