From: Rafael Sadowski Subject: Re: slowcgi: preserve PARAMS order in the CGI environment To: tech@openbsd.org Date: Mon, 13 Jul 2026 21:50:07 +0200 On Mon Jul 13, 2026 at 07:25:12PM +0200, Florian Obser wrote: > On 2026-07-13 16:50 +02, Rafael Sadowski wrote: > > I fixed the order in httpd ("tail insert during read from conf" > > followed by "tail insert" during copying) but still had an incorrect > > order because of slowcgi. > > Out of idle curiosity, why is this important? > > slist_init(3) has this: > > Singly-linked lists are the simplest of the five data structures and > support only the above functionality. Singly-linked lists are ideal for > applications with large datasets and few or no removals, or for > implementing a LIFO queue. > > Simple queues and singly-linked tail queues add the following > functionality: > > 1. Entries can be added at the end of a list. > > However: > > 1. All list insertions must specify the head of the list. > 2. Each head entry requires two pointers rather than one. > 3. Code size is about 15% greater and operations run about 20% > slower than singly-linked lists. > > I'm not opposed to the change (it reads OK), but it does not come for > free. Btw. there is a copy of slowcgi.c in usr.sbin/bgplgd... > Thanks Florian, good point. I haven't found a use case where the order would matter. If anyone has a use case, we can go with that, but I doubt it. It was only important for my test(tm), but I could see from the logs that it was correct in httpd.