Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Debian is like Suse with yast turned off, just better. :) -- Goswin Brederlow


devel / comp.lang.tcl / New (to me) geturl problem with meta()

SubjectAuthor
* New (to me) geturl problem with meta()ted@loft.tnolan.com (Ted Nolan
+* Re: New (to me) geturl problem with meta()Andreas Leitgeb
|`- Re: New (to me) geturl problem with meta()ted@loft.tnolan.com (Ted Nolan
+* Re: New (to me) geturl problem with meta()Schelte
|+* Re: New (to me) geturl problem with meta()saitology9
||+- Re: New (to me) geturl problem with meta()Gerald Lester
||`* Re: New (to me) geturl problem with meta()Schelte
|| `* Re: New (to me) geturl problem with meta()saitology9
||  `* Re: New (to me) geturl problem with meta()Schelte
||   +* Re: New (to me) geturl problem with meta()Alan Grunwald
||   |+* Re: New (to me) geturl problem with meta()Rich
||   ||`* Re: New (to me) geturl problem with meta()Schelte
||   || `- Re: New (to me) geturl problem with meta()Alan Grunwald
||   |`* Re: New (to me) geturl problem with meta()saitology9
||   | `* Re: New (to me) geturl problem with meta()Rich
||   |  `* Re: New (to me) geturl problem with meta()saitology9
||   |   +- Re: New (to me) geturl problem with meta()Schelte
||   |   `- Re: New (to me) geturl problem with meta()Rich
||   `* Re: New (to me) geturl problem with meta()saitology9
||    `* Re: New (to me) geturl problem with meta()Rich
||     `* Re: New (to me) geturl problem with meta()saitology9
||      `- Re: New (to me) geturl problem with meta()Rich
|`- Re: New (to me) geturl problem with meta()ted@loft.tnolan.com (Ted Nolan
`* Re: New (to me) geturl problem with meta()Keith Nash
 `* Re: New (to me) geturl problem with meta()ted@loft.tnolan.com (Ted Nolan
  +- Re: New (to me) geturl problem with meta()Rich
  `- Re: New (to me) geturl problem with meta()Harald Oehlmann

Pages:12
New (to me) geturl problem with meta()

<kk9rjeFsrm3U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22580&group=comp.lang.tcl#22580

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: New (to me) geturl problem with meta()
Date: 18 Aug 2023 18:29:03 GMT
Organization: loft
Lines: 23
Message-ID: <kk9rjeFsrm3U1@mid.individual.net>
X-Trace: individual.net ltwmJf+G6F8wNu6w2pWFCwDswOJ5jmvGO/VHm1Uc9VrY+tGj95
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:ZhFmTMvyGaGVHmA/x58aizPDP20= sha256:b9tg6lphwdSu9PJeq9Gnq2iyqdh1csF8Mxe6wJKH5xw=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
 by: ted@loft.tnolan.com - Fri, 18 Aug 2023 18:29 UTC

I have just started seeing an ineresting problem with program I have been
using to talk to a REST API for the past year or more. In particular
sometime very recently the indicies in the "meta()" array populated
after a geturl request have started, sometimes, being populated in
lower case. It's not consistent, so I suspect my requests are being
round-robined across different servers, but to give a particular
example, I had been doing something like:

if {[string match -nocase {application/json*} $meta(Content-Type)]} {
whatever
}

and now I am finding that sometimes "meta(Content-Type)" does not exist, but
"meta(content-type)" does. Googling around I'm seeing that apparently
servers are allowed to do this, but the meta() array seems almost useless
if this is going to happen. I can fix the program of course, I guess
looking at the man page, I should probably just check "state(type)",
instead. Should the "meta()" subscripts be lowercased in future
versions, or should there be a warning on the man page not to use them
other than for debugging?
--
columbiaclosings.com
What's not in Columbia anymore..

Re: New (to me) geturl problem with meta()

<slrnudvnq6.2d3.avl@logic.at>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22581&group=comp.lang.tcl#22581

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: avl@logic.at (Andreas Leitgeb)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Fri, 18 Aug 2023 21:14:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <slrnudvnq6.2d3.avl@logic.at>
References: <kk9rjeFsrm3U1@mid.individual.net>
Reply-To: avl@logic.at
Injection-Date: Fri, 18 Aug 2023 21:14:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="17aff8064bcad41426b4961dc0d7b34b";
logging-data="436817"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19FurqnjLu/dG8/avGDoy2y"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:dBAFCpGQqFMHXUYil0KSb93gGlQ=
 by: Andreas Leitgeb - Fri, 18 Aug 2023 21:14 UTC

Ted Nolan <tednolan> <ted@loft.tnolan.com> wrote:
> I have just started seeing an ineresting problem with program I have been
> using to talk to a REST API for the past year or more. In particular
> sometime very recently the indicies in the "meta()" array populated
> after a geturl request have started, sometimes, being populated in
> lower case. It's not consistent, so I suspect my requests are being
> round-robined across different servers, but to give a particular
> example, I had been doing something like:
> if {[string match -nocase {application/json*} $meta(Content-Type)]} {
> whatever
> }
> and now I am finding that sometimes "meta(Content-Type)" does not exist, but
> "meta(content-type)" does. Googling around I'm seeing that apparently
> servers are allowed to do this, but the meta() array seems almost useless
> if this is going to happen.

some random thoughts...

1.) Is Content-Type the only such field, or could this thing happen
for any other http-header?

2.) What's happening with headers that are allowed to occur multiple
times? would these also be allowed to appear in different casings?

If Content-Type is the only one, and all-lowercase "content-type" the
only variant of it, then the workaround would be straightforward:
if {![info exists meta(Content-Type)]} { set meta(Content-Type) $meta(content-type) }

Otherwise, you might need to loop over the keys of meta, and just
set a lowercase version of each key with original value in a new
array.

Re: New (to me) geturl problem with meta()

<kkade6F11apU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22582&group=comp.lang.tcl#22582

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: 18 Aug 2023 23:33:26 GMT
Organization: loft
Lines: 53
Message-ID: <kkade6F11apU1@mid.individual.net>
References: <kk9rjeFsrm3U1@mid.individual.net> <slrnudvnq6.2d3.avl@logic.at>
X-Trace: individual.net WFunysiY9cw3MGs/Tf7I1wccNJ6Vu6WJw/zbvXvluSlnxCg20Z
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:I/STRxTevjRJUe4me5CHBuqhmJU= sha256:OFjYeUlR71apo2IUg9gMW08KuUzCSzhSR4OR5sZwFAg=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
 by: ted@loft.tnolan.com - Fri, 18 Aug 2023 23:33 UTC

In article <slrnudvnq6.2d3.avl@logic.at>,
Andreas Leitgeb <avl@logic.at> wrote:
>Ted Nolan <tednolan> <ted@loft.tnolan.com> wrote:
>> I have just started seeing an ineresting problem with program I have been
>> using to talk to a REST API for the past year or more. In particular
>> sometime very recently the indicies in the "meta()" array populated
>> after a geturl request have started, sometimes, being populated in
>> lower case. It's not consistent, so I suspect my requests are being
>> round-robined across different servers, but to give a particular
>> example, I had been doing something like:
>> if {[string match -nocase {application/json*} $meta(Content-Type)]} {
>> whatever
>> }
>> and now I am finding that sometimes "meta(Content-Type)" does not exist, but
>> "meta(content-type)" does. Googling around I'm seeing that apparently
>> servers are allowed to do this, but the meta() array seems almost useless
>> if this is going to happen.
>
>some random thoughts...
>
>1.) Is Content-Type the only such field, or could this thing happen
> for any other http-header?
>
>2.) What's happening with headers that are allowed to occur multiple
> times? would these also be allowed to appear in different casings?
>
>If Content-Type is the only one, and all-lowercase "content-type" the
>only variant of it, then the workaround would be straightforward:
> if {![info exists meta(Content-Type)]} { set meta(Content-Type)
>$meta(content-type) }
>
>
>Otherwise, you might need to loop over the keys of meta, and just
>set a lowercase version of each key with original value in a new
>array.
>

Well, "Content-Type" is the only one I care about, but yeah, it can happen
to them all. I have resolved my issue, I think, by using "state(type)",
so I don't need to do any more groveling around in "meta()".

However, looking again at the man page, the behavior seems like a bug:

https://www.tcl.tk/man/tcl8.6/TclCmd/http.html

specifically lists "Content-Type", "Content-Length", & "Location" with
those casings, so arguably the package should map whatever comes in
for those to match the page.

Oh well.
--
columbiaclosings.com
What's not in Columbia anymore..

Re: New (to me) geturl problem with meta()

<nnd$578bb030$57f092eb@2f63b97640b55fc0>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22583&group=comp.lang.tcl#22583

  copy link   Newsgroups: comp.lang.tcl
Date: Sat, 19 Aug 2023 10:01:31 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New (to me) geturl problem with meta()
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
Content-Language: en-US
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <kk9rjeFsrm3U1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$578bb030$57f092eb@2f63b97640b55fc0>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 30
Injection-Date: Sat, 19 Aug 2023 10:01:31 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2150
 by: Schelte - Sat, 19 Aug 2023 08:01 UTC

On 18/08/2023 20:29, Ted Nolan <tednolan> wrote:
> I have just started seeing an ineresting problem with program I have been
> using to talk to a REST API for the past year or more. In particular
> sometime very recently the indicies in the "meta()" array populated
> after a geturl request have started, sometimes, being populated in
> lower case. It's not consistent, so I suspect my requests are being
> round-robined across different servers, but to give a particular
> example, I had been doing something like:
>
> if {[string match -nocase {application/json*} $meta(Content-Type)]} {
> whatever
> }
>
> and now I am finding that sometimes "meta(Content-Type)" does not exist, but
> "meta(content-type)" does. Googling around I'm seeing that apparently
> servers are allowed to do this, but the meta() array seems almost useless
> if this is going to happen. I can fix the program of course, I guess
> looking at the man page, I should probably just check "state(type)",
> instead. Should the "meta()" subscripts be lowercased in future
> versions, or should there be a warning on the man page not to use them
> other than for debugging?

This is just one of several issues with the http package that prompted
me to develop the www package
(https://chiselapp.com/user/schelte/repository/www)

Schelte.

Re: New (to me) geturl problem with meta()

<ubtlka$1fblo$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22591&group=comp.lang.tcl#22591

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Sun, 20 Aug 2023 14:21:59 -0400
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <ubtlka$1fblo$2@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Aug 2023 18:22:02 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="7338d2409030a088c3f996ef728c0bcf";
logging-data="1552056"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/pSnGMN2necZgJiwwRLZkK"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:iK+JbWZYHsXhZCxQdnEgnomDuBY=
Content-Language: en-US
In-Reply-To: <nnd$578bb030$57f092eb@2f63b97640b55fc0>
 by: saitology9 - Sun, 20 Aug 2023 18:21 UTC

On 8/19/2023 4:01 AM, Schelte wrote:
> On 18/08/2023 20:29, Ted Nolan <tednolan> wrote:
>
> This is just one of several issues with the http package that prompted
> me to develop the www package
> (https://chiselapp.com/user/schelte/repository/www)
>
>

This looks like a comprehensive and a well thought-out package. I read
a little bit of the documentation and may I kindly make a comment for
your consideration:

It says that it uses an in-memory sqlite database for managing cookies.
That sounds good but at the same time, this choice may interfere with
user scripts that use sqlite for their own purposes. Can you load
multiple different versions of sqlite simultaneously? Is it thread-safe?
I am not sure.

In any case, this would easily result in your package and user scripts
to fall out of sync with respect to sqlite versions they need.

IMO, sqlite use here is not really needed. I think for the purposes you
need it for, a plain dictionary might do the job here, which would make
the package more attractive.

Re: New (to me) geturl problem with meta()

<AbuEM.708435$TPw2.259857@fx17.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22596&group=comp.lang.tcl#22596

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx17.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Subject: Re: New (to me) geturl problem with meta()
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
From: Gerald.Lester@gmail.com (Gerald Lester)
In-Reply-To: <ubtlka$1fblo$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 42
Message-ID: <AbuEM.708435$TPw2.259857@fx17.iad>
X-Complaints-To: abuse@fastusenet.org
NNTP-Posting-Date: Sun, 20 Aug 2023 19:54:08 UTC
Organization: fastusenet - www.fastusenet.org
Date: Sun, 20 Aug 2023 14:54:08 -0500
X-Received-Bytes: 2167
 by: Gerald Lester - Sun, 20 Aug 2023 19:54 UTC

On 8/20/23 13:21, saitology9 wrote:
> On 8/19/2023 4:01 AM, Schelte wrote:
>> On 18/08/2023 20:29, Ted Nolan <tednolan> wrote:
>>
>> This is just one of several issues with the http package that prompted
>> me to develop the www package
>> (https://chiselapp.com/user/schelte/repository/www)
>>
>>
>
> This looks like a comprehensive and a well thought-out package.  I read
> a little bit of the documentation and may I kindly make a comment for
> your consideration:
>
> It says that it uses an in-memory sqlite database for managing cookies.
> That sounds good but at the same time, this choice may interfere with
> user scripts that use sqlite for their own purposes.

It should not.

> Can you load
> multiple different versions of sqlite simultaneously?

Why would you want to do that?

> Is it thread-safe?

Yes it is.

> I am not sure.
>
> In any case, this would easily result in your package and user scripts
> to fall out of sync with respect to sqlite versions they need.
>
> IMO, sqlite use here is not really needed. I think for the purposes you
> need it for, a plain dictionary might do the job here, which would make
> the package more attractive.

I agree, sqlite seems to be overkill here.

Re: New (to me) geturl problem with meta()

<nnd$7c3e629c$1fb24493@7e8965507bcea7e0>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22599&group=comp.lang.tcl#22599

  copy link   Newsgroups: comp.lang.tcl
Date: Sun, 20 Aug 2023 23:13:34 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New (to me) geturl problem with meta()
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
Content-Language: en-US
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <ubtlka$1fblo$2@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <nnd$7c3e629c$1fb24493@7e8965507bcea7e0>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe005.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 56
Injection-Date: Sun, 20 Aug 2023 23:13:34 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3168
 by: Schelte - Sun, 20 Aug 2023 21:13 UTC

On 20/08/2023 20:21, saitology9 wrote:
> On 8/19/2023 4:01 AM, Schelte wrote:
>> On 18/08/2023 20:29, Ted Nolan <tednolan> wrote:
>>
>> This is just one of several issues with the http package that prompted
>> me to develop the www package
>> (https://chiselapp.com/user/schelte/repository/www)
>>
>>
>
> This looks like a comprehensive and a well thought-out package.  I read
> a little bit of the documentation and may I kindly make a comment for
> your consideration:
>
> It says that it uses an in-memory sqlite database for managing cookies.

The www package uses an in-memory sqlite database, unless you configure
a file to preserve cookies across application restarts.

> That sounds good but at the same time, this choice may interfere with
> user scripts that use sqlite for their own purposes. Can you load
> multiple different versions of sqlite simultaneously? Is it thread-safe?
> I am not sure.
>
> In any case, this would easily result in your package and user scripts
> to fall out of sync with respect to sqlite versions they need.
>
The www package is happy to use the same version of sqlite3 that may be
required by other parts of the application. It doesn't use any advanced
features that require the latest sqlite3 version.

> IMO, sqlite use here is not really needed. I think for the purposes you
> need it for, a plain dictionary might do the job here, which would make
> the package more attractive.
>
Using plain dicts would have required a lot of extra code to do things
that can easily be done with sqlite, like searching based on different
items and storing the information on disk.

For example: Assuming a dict would be keyed on origin, then path, and
finally cookie name, the whole dict would have to be examined to find
expired cookies. Or can you suggest a directory structure that would
make that easier?

For storing cookies between application runs, it is of course possible
to simply dump the dict as a string to file. But then checks and error
handling would have to be added when reading it back.

Since sqlite makes all of these tasks easier and it comes bundled with
Tcl anyway, I chose to make use of it. You haven't yet persuaded me to
reverse that decision.

Schelte.

Re: New (to me) geturl problem with meta()

<ubu92a$1j5kh$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22601&group=comp.lang.tcl#22601

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Sun, 20 Aug 2023 19:53:43 -0400
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <ubu92a$1j5kh$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 20 Aug 2023 23:53:47 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ce139d1496819e458cdaaba24ef8e4ad";
logging-data="1676945"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9xZKtnH23TIh59LErP1PX"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:SjoVyiqvFdnWMIY3Bspzle/ON30=
Content-Language: en-US
In-Reply-To: <nnd$7c3e629c$1fb24493@7e8965507bcea7e0>
 by: saitology9 - Sun, 20 Aug 2023 23:53 UTC

On 8/20/2023 5:13 PM, Schelte wrote:

> The www package is happy to use the same version of sqlite3 that may be
> required by other parts of the application. It doesn't use any advanced
> features that require the latest sqlite3 version.

I suppose that helps. Once something is deployed, it is quite hard to
force frequent updates on users (and especially companies). It is
harder even to say, hey, one of the packages we use has a new version
with a bug fix, and we have to update the whole thing.

> Using plain dicts would have required a lot of extra code to do things
> that can easily be done with sqlite, like searching based on different
> items and storing the information on disk.

Just processing the cookies is a big enough help already. I mean, the
package could fetch the cookies, give it to the user when asked, and
pass it along, with whatever else the user provides, on to the next
request. I's say no need to worry about the long-term persistency. It
becomes user responsibility. They can save it to a file and read it back
easily on their own. I suspect many may not even bother.

> For example: Assuming a dict would be keyed on origin, then path, and
> finally cookie name, the whole dict would have to be examined to find
> expired cookies. Or can you suggest a directory structure that would
> make that easier?

I don't know about the internals of the package or what the ideal use
case is, so I am not sure how big of a problem this is. I'd assume that
expired cookies would only be relevant when a resource from the same
domain is requested again. Whenever I have used the http::geturl, it was
just one request per domain. Also, the number of cookies per site is
generally in single digits, so even a sequential search should be no
problem.

As for the general data structure, it may be better to use a simple list
stored with the requested object, or even an array, indexed by "$origin,
$path, $cookie-name". Expiration could be an integer containing seconds
for time left.

>
> For storing cookies between application runs, it is of course possible
> to simply dump the dict as a string to file. But then checks and error
> handling would have to be added when reading it back.

I am not sure it is a good idea, by default, to maintain state between
repeated runs of the user program. This makes it sound like a
full-fledged browser like FF or Chrome.

>
> Since sqlite makes all of these tasks easier and it comes bundled with
> Tcl anyway, I chose to make use of it. You haven't yet persuaded me to
> reverse that decision.

I am sorry - that was not my intention. I thought I'd bring up a point
that you may or may not have considered. Of course, it is your package
after all.

However, if you want to be persuaded :-), here is one: I believe your
package is pure Tcl code. Sqlite dependency makes it a binary extension.
Personally I try to avoid binary packages (notwithstanding the fact that
it is sqlite :-) ).

Re: New (to me) geturl problem with meta()

<kkg0f2Fs323U1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22602&group=comp.lang.tcl#22602

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: 21 Aug 2023 02:28:50 GMT
Organization: loft
Lines: 39
Message-ID: <kkg0f2Fs323U1@mid.individual.net>
References: <kk9rjeFsrm3U1@mid.individual.net> <nnd$578bb030$57f092eb@2f63b97640b55fc0>
X-Trace: individual.net cguuGylAWxaHU7Mlkrve/QP0/ObvYpbKS59aYJ3y8lVkY8yPLF
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:ZuRto3Vs3H7Sf1akohitbeNXVUo= sha256:gC/qnBmXpkw1PpHIQNF0lqHGCpKSwljRM79MVCrKP9g=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
 by: ted@loft.tnolan.com - Mon, 21 Aug 2023 02:28 UTC

In article <nnd$578bb030$57f092eb@2f63b97640b55fc0>,
Schelte <nospam@wanadoo.nl> wrote:
>On 18/08/2023 20:29, Ted Nolan <tednolan> wrote:
>> I have just started seeing an ineresting problem with program I have been
>> using to talk to a REST API for the past year or more. In particular
>> sometime very recently the indicies in the "meta()" array populated
>> after a geturl request have started, sometimes, being populated in
>> lower case. It's not consistent, so I suspect my requests are being
>> round-robined across different servers, but to give a particular
>> example, I had been doing something like:
>>
>> if {[string match -nocase {application/json*} $meta(Content-Type)]} {
>> whatever
>> }
>>
>> and now I am finding that sometimes "meta(Content-Type)" does not exist, but
>> "meta(content-type)" does. Googling around I'm seeing that apparently
>> servers are allowed to do this, but the meta() array seems almost useless
>> if this is going to happen. I can fix the program of course, I guess
>> looking at the man page, I should probably just check "state(type)",
>> instead. Should the "meta()" subscripts be lowercased in future
>> versions, or should there be a warning on the man page not to use them
>> other than for debugging?
>
>This is just one of several issues with the http package that prompted
>me to develop the www package
>(https://chiselapp.com/user/schelte/repository/www)
>
>
>Schelte.
>

Thanks! I'll save that link. I'm not sure if I'll be able to use it going
forward; I'm already getting some pushback about using packages not in the
distro package managers, and I've (I think) solved my issue, but it looks
interesting!
--
columbiaclosings.com
What's not in Columbia anymore..

Re: New (to me) geturl problem with meta()

<v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22604&group=comp.lang.tcl#22604

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date: Mon, 21 Aug 2023 19:30:36 +0000
Date: Mon, 21 Aug 2023 20:30:36 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
From: k.j.nash@usa.net (Keith Nash)
Subject: Re: New (to me) geturl problem with meta()
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
Content-Language: en-US
In-Reply-To: <kk9rjeFsrm3U1@mid.individual.net>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>
Lines: 63
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-dkCQ8A0hmORylFUTe4TDNdU21ju7uqvpm+jj8znlViQnXtlClJLP8BeLFBaFr3D9RAVdKsQO+4i6MAu!ic6e8HOvOfxu2Lwxy64y/b5WXOqXy2nrE78xNt+7g2e4sV6Xy/eSDLH5BIDSzfdHRiLKHi0/ESPK!n6qrt12rX0bOVB78KSLMFAUfRJc9
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Keith Nash - Mon, 21 Aug 2023 19:30 UTC

Hi Ted,

I hadn't noticed this incorrect information in the man page for Tcl 8.6.
Also the 8.6 man page unhelpfully suggests using

array set meta $state(meta)

but this operation will lose some headers if there are multiple headers
with the same name, and the case-sensitivity issue makes the array much
less useful than the original list.

The case-sensitivity issue is fixed in Tcl 8.7, and I believe the
documentation in 8.7 is accurate. When upgrading from 8.6 to 8.7 users
may need to alter their scripts to use the new commands and/or adjust
how they use the "meta" internal state. Tcl 8.6 and 8.7 handle these
issues differently.

In http 2.9.x (Tcl 8.6) the header name is stored as a list element name
in meta, which has the form "header value header value ...", and is
exactly what was sent by the server. As you point out, the meaning of
the header name is case-independent and the server can send any case it
likes. This is inconvenient when writing scripts because every attempt
to retrieve a header must do a case-insensitive search. As you point
out the man page gives incorrect information.

In http 2.10.x (Tcl 8.7) there is a change in both the API and the
internals of http. The header names stored in meta are lower case. New
commands are provided for retrieving header values:
::http::responseHeaders token ?headerName?
::http::responseHeaderValue token headerName
The value to be supplied by the script as "headerName" is
case-insensitive: the command converts it to lower case and then does a
direct comparison with meta.

It is possible to use http 2.10 with Tcl 8.6. As well as the module
file http-*.tm and the man page http.n, it may be helpful to copy the
tcl8.7/cookiejar0.2/ directory and the man pages cookiejar.n, idna.n
from Tcl 8.7.

Keith.

On 18/08/2023 19:29, Ted Nolan <tednolan> wrote:
> I have just started seeing an ineresting problem with program I have been
> using to talk to a REST API for the past year or more. In particular
> sometime very recently the indicies in the "meta()" array populated
> after a geturl request have started, sometimes, being populated in
> lower case. It's not consistent, so I suspect my requests are being
> round-robined across different servers, but to give a particular
> example, I had been doing something like:
>
> if {[string match -nocase {application/json*} $meta(Content-Type)]} {
> whatever
> }
>
> and now I am finding that sometimes "meta(Content-Type)" does not exist, but
> "meta(content-type)" does. Googling around I'm seeing that apparently
> servers are allowed to do this, but the meta() array seems almost useless
> if this is going to happen. I can fix the program of course, I guess
> looking at the man page, I should probably just check "state(type)",
> instead. Should the "meta()" subscripts be lowercased in future
> versions, or should there be a warning on the man page not to use them
> other than for debugging?

Re: New (to me) geturl problem with meta()

<kkinliFaqarU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22605&group=comp.lang.tcl#22605

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: @ednolan (ted@loft.tnolan.com (Ted Nolan)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: 22 Aug 2023 03:17:07 GMT
Organization: loft
Lines: 31
Message-ID: <kkinliFaqarU1@mid.individual.net>
References: <kk9rjeFsrm3U1@mid.individual.net> <v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>
X-Trace: individual.net gzMhOoebaJQrYxjFbkN1uAHybLG6dEJjc+Ca47+UAlFuzzbZzy
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:aUpUfC+Zw8mpZZaWxaP+7fmJyN0= sha256:YCskOMqXYjnTNmm9xGjMir1o8jDLKbIh2ahIw4UjdZ4=
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
 by: ted@loft.tnolan.com - Tue, 22 Aug 2023 03:17 UTC

In article <v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>,
Keith Nash <k.j.nash@usa.net> wrote:

Thanks for the info Keith!

>Hi Ted,
>
>I hadn't noticed this incorrect information in the man page for Tcl 8.6.
> Also the 8.6 man page unhelpfully suggests using
>
> array set meta $state(meta)
>

Which is what I was doing & why :-)

>The case-sensitivity issue is fixed in Tcl 8.7, and I believe the
>documentation in 8.7 is accurate. When upgrading from 8.6 to 8.7 users
>may need to alter their scripts to use the new commands and/or adjust
>how they use the "meta" internal state. Tcl 8.6 and 8.7 handle these
>issues differently.
>

The changes you describe sound nice, and I look forward to seeing Tcl 8.7
in our linux distro package managers! Unfortunately that may take a
while as our mix of distros is quite diverse.

Regards,
Ted Nolan
--
columbiaclosings.com
What's not in Columbia anymore..

Re: New (to me) geturl problem with meta()

<uc2bpb$2dpl4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22608&group=comp.lang.tcl#22608

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Tue, 22 Aug 2023 13:04:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <uc2bpb$2dpl4$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net> <v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk> <kkinliFaqarU1@mid.individual.net>
Injection-Date: Tue, 22 Aug 2023 13:04:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="30d9f7822feb4e1ea0b1deb553ae1fcb";
logging-data="2549412"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/OzUleGspX2WgSrYB6jpG9"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:MbvRD+8+U/3msrcMGoLnNhHaDbw=
 by: Rich - Tue, 22 Aug 2023 13:04 UTC

Ted Nolan <tednolan> <ted@loft.tnolan.com> wrote:
> The changes you describe sound nice, and I look forward to seeing Tcl
> 8.7 in our linux distro package managers! Unfortunately that may
> take a while as our mix of distros is quite diverse.

Compiling Tcl/Tk on Linux is usually trivial, so you could compile it
for yourself if you wanted it sooner than the packagers would provide.

The most irritating complication comes about not by Tcl/Tk, but by
distros that /hide/ the development packages behind a separately
installed -devel package, resulting in the need to install several
extra packages to get basic compiling to work in the first place.

Re: New (to me) geturl problem with meta()

<uc2ifl$2et43$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22609&group=comp.lang.tcl#22609

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: wortkarg3@yahoo.com (Harald Oehlmann)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Tue, 22 Aug 2023 16:59:01 +0200
Organization: A noiseless patient Spider
Lines: 39
Message-ID: <uc2ifl$2et43$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>
<kkinliFaqarU1@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 22 Aug 2023 14:59:01 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d0998a5fffc8c0600f1699a3cb06f042";
logging-data="2585731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18cbSWm+ZMyBthvkh09ja7K"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Cancel-Lock: sha1:mI2ElocENo8qRijxfB4vDmDBpHw=
In-Reply-To: <kkinliFaqarU1@mid.individual.net>
Content-Language: en-GB
 by: Harald Oehlmann - Tue, 22 Aug 2023 14:59 UTC

Am 22.08.2023 um 05:17 schrieb Ted Nolan <tednolan>:
> In article <v8udnctLKffBJn75nZ2dnZfqn_GdnZ2d@brightview.co.uk>,
> Keith Nash <k.j.nash@usa.net> wrote:
>
> Thanks for the info Keith!
>
>> Hi Ted,
>>
>> I hadn't noticed this incorrect information in the man page for Tcl 8.6.
>> Also the 8.6 man page unhelpfully suggests using
>>
>> array set meta $state(meta)
>>
>
> Which is what I was doing & why :-)
>
>> The case-sensitivity issue is fixed in Tcl 8.7, and I believe the
>> documentation in 8.7 is accurate. When upgrading from 8.6 to 8.7 users
>> may need to alter their scripts to use the new commands and/or adjust
>> how they use the "meta" internal state. Tcl 8.6 and 8.7 handle these
>> issues differently.
>>
>
> The changes you describe sound nice, and I look forward to seeing Tcl 8.7
> in our linux distro package managers! Unfortunately that may take a
> while as our mix of distros is quite diverse.
>
> Regards,
> Ted Nolan

The http package from TCL is a script only package.
By just grabbing the http and cookyjar packages from 8.7 and moving them
into a (sub-)folder of your auto_path would make them automatically work
in an 8.6 installation.

So, no need to compile.
Take care,
Harald

Re: New (to me) geturl problem with meta()

<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22617&group=comp.lang.tcl#22617

  copy link   Newsgroups: comp.lang.tcl
Date: Wed, 23 Aug 2023 20:08:13 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New (to me) geturl problem with meta()
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <ubu92a$1j5kh$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp002.abavia.com!news.kpn.nl!not-for-mail
Lines: 15
Injection-Date: Wed, 23 Aug 2023 20:08:14 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1407
 by: Schelte - Wed, 23 Aug 2023 18:08 UTC

On 21/08/2023 01:53, saitology9 wrote:
> I am not sure it is a good idea, by default, to maintain state between
> repeated runs of the user program.

I agree. That's why it doesn't do it by default. But it provides the
possibility, if you want it.

Elsewhere in the thread, someone mentioned that 8.7 adds a cookiejar
package for handling cookies for the http package. And guess what? It
uses an sqlite database to store the cookies.

Schelte.

Re: New (to me) geturl problem with meta()

<uc5lt0$32bjq$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22619&group=comp.lang.tcl#22619

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nospam.nurdglaw@gmail.com (Alan Grunwald)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Wed, 23 Aug 2023 20:15:30 +0100
Organization: A noiseless patient Spider
Lines: 35
Message-ID: <uc5lt0$32bjq$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 23 Aug 2023 19:15:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="cbe71a2a527ff2e514f904364b89e32d";
logging-data="3223162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18vr4bVn3/YH4CAw3ZU7VayawxoR0vqRw0="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:PIFl0SBa9lCR/6LUxDpbVIjG+5Q=
Content-Language: en-US
In-Reply-To: <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>
 by: Alan Grunwald - Wed, 23 Aug 2023 19:15 UTC

On 23/08/2023 19:08, Schelte wrote:
> On 21/08/2023 01:53, saitology9 wrote:
>> I am not sure it is a good idea, by default, to maintain state between
>> repeated runs of the user program.
>
> I agree. That's why it doesn't do it by default. But it provides the
> possibility, if you want it.
>
> Elsewhere in the thread, someone mentioned that 8.7 adds a cookiejar
> package for handling cookies for the http package. And guess what? It
> uses an sqlite database to store the cookies.
>
>
> Schelte.
>
May I offer an observation and a suggestion that I fear is so obvious
that it's already been considered and discarded?

I assume that the packages being discussed open a memory-only sqlite3
database by opening :memory:. This seems to me to risk interfering with
an application that also wants an in-memory sqlite database.

Would it not be better to use a disk-based database with published name
and location that an application writer can choose to interfere with or,
preferably, to keep well clear of?

I appreciate that there will be some performance impact by making the
database on-disk rather than in-memory but a) that will surely be
minimal and b) it can be reduced by doing all the package database
access within a database transaction that is never committed, making the
database essentially in-memory anyway.

Please be gentle as you explain why this is a rotten suggestion.

Alan

Re: New (to me) geturl problem with meta()

<uc5u2k$33pn3$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22620&group=comp.lang.tcl#22620

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Wed, 23 Aug 2023 21:35:16 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 53
Message-ID: <uc5u2k$33pn3$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net> <nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me> <nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me> <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me>
Injection-Date: Wed, 23 Aug 2023 21:35:16 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="ca390d96681c349a45956667dd4a6265";
logging-data="3270371"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4qnfxlf5p2B+fXJlmQJpH"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:jVJ7Kv/BGJTH1QuNQmbHd8p1oRQ=
 by: Rich - Wed, 23 Aug 2023 21:35 UTC

Alan Grunwald <nospam.nurdglaw@gmail.com> wrote:
> On 23/08/2023 19:08, Schelte wrote:
>> On 21/08/2023 01:53, saitology9 wrote:
>>> I am not sure it is a good idea, by default, to maintain state between
>>> repeated runs of the user program.
>>
>> I agree. That's why it doesn't do it by default. But it provides the
>> possibility, if you want it.
>>
>> Elsewhere in the thread, someone mentioned that 8.7 adds a cookiejar
>> package for handling cookies for the http package. And guess what? It
>> uses an sqlite database to store the cookies.
>>
>>
>> Schelte.
>>
> May I offer an observation and a suggestion that I fear is so obvious
> that it's already been considered and discarded?
>
> I assume that the packages being discussed open a memory-only sqlite3
> database by opening :memory:. This seems to me to risk interfering
> with an application that also wants an in-memory sqlite database.
> [snip]
> Please be gentle as you explain why this is a rotten suggestion.

It appears that each handle opened upon the :memory: pseudo file
creates separate databases.

Testing:

$ rlwrap tclsh
% package require sqlite3
3.37.2
% sqlite3 db1 :memory:
% db1 eval {create table db1 (id integer);}
% db1 eval {select * from db1;}
% sqlite3 db2 :memory:
% db2 eval {select * from db1;}
no such table: db1
% db2 eval {create table db2 (id integer);}
% db1 eval {select * from db2;}
no such table: db2
%

Handle db1 does not see the db2 table in db2, nor does handle db2 see
the db1 table in db1.

So opening :memory: would seem to be safe (to the extent that someone
does not explicitly write code to go fish the 'cookie jar' db handle
out of the loaded module).

Now, whether this is /documented/ behavior or just a happy side effect
I have not researched.

Re: New (to me) geturl problem with meta()

<nnd$36affa55$0b276155@764ea9c06e9f0d0b>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22621&group=comp.lang.tcl#22621

  copy link   Newsgroups: comp.lang.tcl
Date: Wed, 23 Aug 2023 23:58:48 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New (to me) geturl problem with meta()
Content-Language: en-US
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me>
<uc5u2k$33pn3$1@dont-email.me>
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <uc5u2k$33pn3$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$36affa55$0b276155@764ea9c06e9f0d0b>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 15
Injection-Date: Wed, 23 Aug 2023 23:58:48 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1632
 by: Schelte - Wed, 23 Aug 2023 21:58 UTC

On 23/08/2023 23:35, Rich wrote:
> So opening :memory: would seem to be safe (to the extent that someone
> does not explicitly write code to go fish the 'cookie jar' db handle out
> of the loaded module). Now, whether this is /documented/ behavior or
> just a happy side effect I have not researched.

It is documented behavior. https://www.sqlite.org/inmemorydb.html says:
"Every :memory: database is distinct from every other. So, opening two
database connections each with the filename ":memory:" will create two
independent in-memory databases."

Schelte.

Re: New (to me) geturl problem with meta()

<uc6bp3$35qod$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22623&group=comp.lang.tcl#22623

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Wed, 23 Aug 2023 21:29:06 -0400
Organization: A noiseless patient Spider
Lines: 13
Message-ID: <uc6bp3$35qod$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 24 Aug 2023 01:29:07 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a2b328a49b02a096729ef985a4d8f77";
logging-data="3336973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181xErRMB/AhtVTI8AsnTdP"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:qFtHHKzkIcgBap7HxgiQwR4uwaI=
Content-Language: en-US
In-Reply-To: <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4>
 by: saitology9 - Thu, 24 Aug 2023 01:29 UTC

On 8/23/2023 2:08 PM, Schelte wrote:
>
> Elsewhere in the thread, someone mentioned that 8.7 adds a cookiejar
> package for handling cookies for the http package. And guess what? It
> uses an sqlite database to store the cookies.
>

So, it too is a binary package then. No problem there. But it doesn't
change how I feel about binary extensions.

It may be that we are beating the same poor dead horse here :-)

Re: New (to me) geturl problem with meta()

<uc6caa$35qod$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22624&group=comp.lang.tcl#22624

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Wed, 23 Aug 2023 21:38:18 -0400
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <uc6caa$35qod$2@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 24 Aug 2023 01:38:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a2b328a49b02a096729ef985a4d8f77";
logging-data="3336973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18I/ubThlcyiXgbgvvMnMUh"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:qVop8nd1bnzRJGA14uhOzv8nigI=
Content-Language: en-US
In-Reply-To: <uc5lt0$32bjq$1@dont-email.me>
 by: saitology9 - Thu, 24 Aug 2023 01:38 UTC

On 8/23/2023 3:15 PM, Alan Grunwald wrote:
> May I offer an observation and a suggestion that I fear is so obvious
> that it's already been considered and discarded?
>
> I assume that the packages being discussed open a memory-only sqlite3
> database by opening :memory:. This seems to me to risk interfering with
> an application that also wants an in-memory sqlite database.
>

You make a great point above. It seems to a non-issue but this is just
another risk.

> Would it not be better to use a disk-based database with published name
> and location that an application writer can choose to interfere with or,
> preferably, to keep well clear of?
>

Well, I believe the package (as well as sqlite) has options to make an
in-memory database persist to a file. So at the end, there is no
distinction, I suppose.

Re: New (to me) geturl problem with meta()

<uc6ivb$3ahrf$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22626&group=comp.lang.tcl#22626

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Thu, 24 Aug 2023 03:31:55 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <uc6ivb$3ahrf$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net> <nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me> <nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me> <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc6bp3$35qod$1@dont-email.me>
Injection-Date: Thu, 24 Aug 2023 03:31:55 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="43ec98cacfeed1c0f04bf0c9729ee0c8";
logging-data="3491695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CtJauiLdZdKgqnyXDtya/"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:ZPPgAVZcLvsjf1eRgmKslKcc8Nk=
 by: Rich - Thu, 24 Aug 2023 03:31 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 8/23/2023 2:08 PM, Schelte wrote:
>>
>> Elsewhere in the thread, someone mentioned that 8.7 adds a cookiejar
>> package for handling cookies for the http package. And guess what?
>> It uses an sqlite database to store the cookies.
>
> So, it too is a binary package then. No problem there. But it
> doesn't change how I feel about binary extensions.

Given that sqlite ships as a built in part of Tcl (and has starting
with 8.6), calling a Tcl script only package that uses the built in sqlite
a "binary extension" is a stretch.

Re: New (to me) geturl problem with meta()

<uc6j4m$3ahrf$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22627&group=comp.lang.tcl#22627

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Thu, 24 Aug 2023 03:34:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 23
Message-ID: <uc6j4m$3ahrf$2@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net> <nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me> <nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me> <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me> <uc6caa$35qod$2@dont-email.me>
Injection-Date: Thu, 24 Aug 2023 03:34:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="43ec98cacfeed1c0f04bf0c9729ee0c8";
logging-data="3491695"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19qspqjqd0ZDgIgQyCz8Day"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:YZl21FZ+ZdHzM0+D0TfvPCuvchE=
 by: Rich - Thu, 24 Aug 2023 03:34 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 8/23/2023 3:15 PM, Alan Grunwald wrote:
>> May I offer an observation and a suggestion that I fear is so obvious
>> that it's already been considered and discarded?
>>
>> I assume that the packages being discussed open a memory-only sqlite3
>> database by opening :memory:. This seems to me to risk interfering with
>> an application that also wants an in-memory sqlite database.
>>
>
> You make a great point above. It seems to a non-issue but this is just
> another risk.

It turns out it is not. In message
<nnd$36affa55$0b276155@764ea9c06e9f0d0b> is a quote from the Sqlite
docs where it is documented that each DB handle open on the :memory:
pseudo file results in a fully separate database.

So there is no chance of accidental interference.

The only interference possibility is deliberate interference where an
author deliberately introspected the http module to extract the db
handle name in order to access the cookie database.

Re: New (to me) geturl problem with meta()

<uc6knn$3asn8$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22628&group=comp.lang.tcl#22628

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Thu, 24 Aug 2023 00:01:58 -0400
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <uc6knn$3asn8$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me>
<uc6caa$35qod$2@dont-email.me> <uc6j4m$3ahrf$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 24 Aug 2023 04:01:59 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a2b328a49b02a096729ef985a4d8f77";
logging-data="3502824"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19isF4JrULASqHADOBUy7f5"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:CbNFEOclJ1C2S+fpWISc/sWZYHg=
Content-Language: en-US
In-Reply-To: <uc6j4m$3ahrf$2@dont-email.me>
 by: saitology9 - Thu, 24 Aug 2023 04:01 UTC

On 8/23/2023 11:34 PM, Rich wrote:
>
> It turns out it is not. In message
> <nnd$36affa55$0b276155@764ea9c06e9f0d0b> is a quote from the Sqlite
> docs where it is documented that each DB handle open on the :memory:
> pseudo file results in a fully separate database.
>
> So there is no chance of accidental interference.
>
> The only interference possibility is deliberate interference where an
> author deliberately introspected the http module to extract the db
> handle name in order to access the cookie database.

I am not so sure. Have you considered user script transactions (e.g.,
looping over a bunch of url's) vs. the package transactions (i.e.,
saving thee cookies)?

From sqlite docs:

"SQLite supports multiple simultaneous read transactions coming from
**separate database connections**, possibly in separate threads or
processes, **but only one simultaneous write transaction**."

Perhaps you could write a small program to test it. Would be
interesting to find out.

Re: New (to me) geturl problem with meta()

<uc6la7$3asn8$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22629&group=comp.lang.tcl#22629

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: saitology9@gmail.com (saitology9)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Thu, 24 Aug 2023 00:11:50 -0400
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <uc6la7$3asn8$2@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc6bp3$35qod$1@dont-email.me>
<uc6ivb$3ahrf$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 24 Aug 2023 04:11:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="1a2b328a49b02a096729ef985a4d8f77";
logging-data="3502824"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/hR/xp/PSl67JkL2CIEFbL"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.11.0
Cancel-Lock: sha1:uyIRX+UV+Pby+QAPvberYdvx18E=
Content-Language: en-US
In-Reply-To: <uc6ivb$3ahrf$1@dont-email.me>
 by: saitology9 - Thu, 24 Aug 2023 04:11 UTC

On 8/23/2023 11:31 PM, Rich wrote:
>
> Given that sqlite ships as a built in part of Tcl (and has starting
> with 8.6), calling a Tcl script only package that uses the built in sqlite
> a "binary extension" is a stretch.
>

Well, sqlite is not loaded by default. To use it, you need to load it.
So it fits the package or extension criterion. And it is binary. QED :-)

In any case, it is totally OK for www to use sqlite. I don't know
anything about the www package. I liked the brief paragraph that I read
on its web page and I made a mental note to consider it in the future. I
believe I have expressed this fact more than once. I really don't have
anything else to say about it.

Re: New (to me) geturl problem with meta()

<nnd$2b9099ad$27baf14b@006df45cfd21abc7>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22630&group=comp.lang.tcl#22630

  copy link   Newsgroups: comp.lang.tcl
Date: Thu, 24 Aug 2023 10:58:03 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: New (to me) geturl problem with meta()
Newsgroups: comp.lang.tcl
References: <kk9rjeFsrm3U1@mid.individual.net>
<nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me>
<nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me>
<nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me>
<uc6caa$35qod$2@dont-email.me> <uc6j4m$3ahrf$2@dont-email.me>
<uc6knn$3asn8$1@dont-email.me>
Content-Language: en-US
From: nospam@wanadoo.nl (Schelte)
In-Reply-To: <uc6knn$3asn8$1@dont-email.me>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <nnd$2b9099ad$27baf14b@006df45cfd21abc7>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp003.abavia.com!news.kpn.nl!not-for-mail
Lines: 23
Injection-Date: Thu, 24 Aug 2023 10:58:03 +0200
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 1973
 by: Schelte - Thu, 24 Aug 2023 08:58 UTC

On 24/08/2023 06:01, saitology9 wrote:
> I am not so sure. Have you considered user script transactions (e.g.,
> looping over a bunch of url's) vs. the package transactions (i.e.,
> saving thee cookies)?
>
> From sqlite docs:
>
> "SQLite supports multiple simultaneous read transactions coming from
> **separate database connections**, possibly in separate threads or
> processes, **but only one simultaneous write transaction**."

This refers to multiple transactions on a single database. It is
irrelevant here, because cookies are stored in their own database.

It could only possibly become an issue if a script developer specifies a
database file for permanent cookie storage that they also use for other
purposes. If anyone decides to do that, it is up to them to make sure
this design won't cause problems.

Schelte.

Re: New (to me) geturl problem with meta()

<uc7m6l$3g0j4$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=22631&group=comp.lang.tcl#22631

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: rich@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: New (to me) geturl problem with meta()
Date: Thu, 24 Aug 2023 13:33:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 42
Message-ID: <uc7m6l$3g0j4$1@dont-email.me>
References: <kk9rjeFsrm3U1@mid.individual.net> <nnd$578bb030$57f092eb@2f63b97640b55fc0> <ubtlka$1fblo$2@dont-email.me> <nnd$7c3e629c$1fb24493@7e8965507bcea7e0> <ubu92a$1j5kh$1@dont-email.me> <nnd$055c8ec7$413ea2d8@e78bcb68ec4445d4> <uc5lt0$32bjq$1@dont-email.me> <uc6caa$35qod$2@dont-email.me> <uc6j4m$3ahrf$2@dont-email.me> <uc6knn$3asn8$1@dont-email.me>
Injection-Date: Thu, 24 Aug 2023 13:33:09 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="43ec98cacfeed1c0f04bf0c9729ee0c8";
logging-data="3670628"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18j8039UOUykZ5dy5sS4d1Q"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.117 (x86_64))
Cancel-Lock: sha1:r9Cub/1etAnrcFFVWt52VA7vcZQ=
 by: Rich - Thu, 24 Aug 2023 13:33 UTC

saitology9 <saitology9@gmail.com> wrote:
> On 8/23/2023 11:34 PM, Rich wrote:
>>
>> It turns out it is not. In message
>> <nnd$36affa55$0b276155@764ea9c06e9f0d0b> is a quote from the Sqlite
>> docs where it is documented that each DB handle open on the :memory:
>> pseudo file results in a fully separate database.
>>
>> So there is no chance of accidental interference.
>>
>> The only interference possibility is deliberate interference where an
>> author deliberately introspected the http module to extract the db
>> handle name in order to access the cookie database.
>
>
> I am not so sure. Have you considered user script transactions (e.g.,
> looping over a bunch of url's) vs. the package transactions (i.e.,
> saving thee cookies)?
>
> From sqlite docs:
>
> "SQLite supports multiple simultaneous read transactions coming from
> **separate database connections**, possibly in separate threads or
> processes, **but only one simultaneous write transaction**."
>
> Perhaps you could write a small program to test it. Would be
> interesting to find out.

The quote about separation is:

It is documented behavior. https://www.sqlite.org/inmemorydb.html
says: "Every :memory: database is distinct from every other. So,
opening two database connections each with the filename ":memory:"
will create two independent in-memory databases."

The way 'distinct' is used in the docs indicates that two different
openings of :memory: are identical to having done:

sqlite3 db1 file1
sqlite3 db2 file2

Which also works perfectly fine.


devel / comp.lang.tcl / New (to me) geturl problem with meta()

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor