public inbox for nncp-devel@lists.stargrave.org
Atom feed
From: Eugene Medvedev <rn3aoh.g@gmail•com>
To: nncp-devel@lists.cypherpunks.su
Subject: Re: gemtext (was: So I made a thing: nncp-echomail)
Date: Wed, 15 Oct 2025 23:46:32 +0300	[thread overview]
Message-ID: <CAO-d-4r4--BuSbPuASB=gVyNHCmzyVbjxvyoU0gCBEvxQTwf1A@mail.gmail.com> (raw)
In-Reply-To: <aOFRzMs8JFq64nGj@stargrave.org>

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

On Sat, 4 Oct 2025 at 19:58, Sergey Matveev <stargrave@stargrave•org> wrote:

> Yeah, that should be fixed easily, as that information actually exists
> in packets/NNCP-utilities.

So I took a stab at this, patch enclosed.

Thoughts? I might have easily misunderstood something.

-- 
Eugene Medvedev

[-- Attachment #2: origin.patch --]
[-- Type: text/x-patch, Size: 1248 bytes --]

diff -r -u nncp-8.13.0/src/node.go nncp-8.13.0-patched/src/node.go
--- nncp-8.13.0/src/node.go	1981-01-01 03:00:00.000000000 +0300
+++ nncp-8.13.0-patched/src/node.go	2025-10-15 22:56:13.944830866 +0300
@@ -57,6 +57,7 @@
 	OnlineDeadline time.Duration
 	MaxOnlineTime  time.Duration
 	Calls          []*Call
+	Origin         *NodeId
 
 	Busy bool
 	sync.Mutex
diff -r -u nncp-8.13.0/src/toss.go nncp-8.13.0-patched/src/toss.go
--- nncp-8.13.0/src/toss.go	1981-01-01 03:00:00.000000000 +0300
+++ nncp-8.13.0-patched/src/toss.go	2025-10-15 23:06:32.799861865 +0300
@@ -185,10 +185,16 @@
 		}
 		if !opts.DryRun {
 			cmd := exec.Command(cmdline[0], append(cmdline[1:], args...)...)
+			origin := sender.Id.String()
+			if sender.Origin != nil {
+				origin = sender.Origin.String()
+			}
 			cmd.Env = append(
 				cmd.Env,
 				"NNCP_SELF="+ctx.Self.Id.String(),
 				"NNCP_SENDER="+sender.Id.String(),
+				"NNCP_PACKET="+pktName,
+				"NNCP_ORIGIN="+origin,
 				"NNCP_NICE="+strconv.Itoa(int(pkt.Nice)),
 			)
 			if pkt.Type == PktTypeExec {
@@ -903,6 +909,7 @@
 				Name:     area.Name,
 				Incoming: area.Incoming,
 				Exec:     area.Exec,
+				Origin:   pktEnc.Sender,
 			}
 			copy(areaNode.Id[:], area.Id[:])
 			pktName := fmt.Sprintf(

  parent reply	other threads:[~2025-10-15 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-04 13:52 So I made a thing: nncp-echomail Eugene Medvedev
2025-10-04 16:56 ` gemtext (was: So I made a thing: nncp-echomail) Sergey Matveev
2025-10-04 17:51   ` Eugene Medvedev
2025-10-04 18:20     ` Sergey Matveev
2025-10-04 18:39       ` Eugene Medvedev
2025-10-04 19:23         ` Sergey Matveev
2025-10-04 19:34           ` Eugene Medvedev
2025-10-15 20:46   ` Eugene Medvedev [this message]
2025-10-26 11:13     ` NNCP_PACKET and NNCP_ORIGIN Sergey Matveev