Tcl Library Source Code

View Ticket
Login
Ticket UUID: 1485d64881ca47bb69d65295e859d8f57f6713ae
Title: Public procedures not exported
Type: Bug Version: 1.4
Submitter: anonymous Created on: 2015-04-16 08:20:29
Subsystem: websocket Assigned To: akupries
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-01-30 13:35:56
Resolution: Fixed Closed By: aku
    Closed on: 2023-01-30 13:21:35
Description:
commit 4d7710c4eca7a1abff10385769cf512e
Author: Adrián Medraño Calvo <[email protected]>
Date:   Thu Apr 16 10:15:15 2015 +0200

    [ws]: Export public procedures

diff --git a/src/websocket.tcl b/src/websocket.tcl
index 6d60537..a9e0624 100644
--- a/src/websocket.tcl
+++ b/src/websocket.tcl
@@ -65,6 +65,8 @@
 	variable libdir [file dirname [file normalize [info script]]]
 	${log}::setlevel $WS(loglevel)
     }
+    # Export all public procedures.
+    namespace export {[a-z]*}
 }
User Comments: oehhar added on 2023-01-30 13:35:56: (text/x-fossil-wiki)
Thanks, Andreas, for your great caring.
Yes, Keith did a lot here in the http package.
Maybe, a certain version of http is required (what should be in the script and docs).

Thanks,
Harald

aku added on 2023-01-30 13:21:35: (text/x-fossil-plain)
Integrated into trunk with commit [db549a5ec8].

aku added on 2023-01-30 13:18:41: (text/x-markdown)
It looks to be the `-keepalive 1` used in the package to ensure that there is no `Connection: close` header in the communication with the remove.

This option however also instructs the `http` package to reuse connections.
Thus for test `example-1.3` the second `open/geturl` reuses the socket from the first `open/geturl`, and then test fails.

My http package is version 2.9.1.

This is not something I am seeing myself fixing right now. It looks to be a clash between what the websocket package expects from http vs what http actually does.

I will ping Keith as the writer of these tests.

This ticket can be closed.

aku added on 2023-01-30 12:30:01: (text/x-fossil-plain)
Done with commit [086c7f3911].

Reworked initialization, moved into a single-shot apply block

Bumped Tcl requirement to 8.6 in all places.
Bumped version to 1.5

Note: Three tests are failing. Bisecting shows that they seem to have failed since they were added to the package.

  2021-06-27 11:04:54 c2d2a4b7e6 BAD
  2021-06-20 13:25:42 fe8f713296 GOOD

Because of this the fix for this ticket is on a branch for now.
Investigation into the failures is tracked here also.

aku added on 2022-10-15 15:13:26:
I am in favor of an ensemble. If the min required version of Tcl for the package is before we had ensembles, make the ensemble and bump the requirement. No sense in keeping requiring long-EOL versions of Tcl.

kjnash added on 2022-10-10 16:51:55:
Yes, that's a good idea.

Should we create the ensemble by default as part of the websocket package?  I don't know if Tcllib has style guidelines about this.

adrianmedranocalvo added on 2022-10-10 13:11:29:
The exported commands are made available when creating an ensemble of the namespace:

    namespace export {[a-z]*};
    namespace ensemble create;

adrianmedranocalvo added on 2022-10-10 13:04:57:
This only affects which commands are added when invoking `namespace import ::websocket`.  I don't know why someone would do that, and less so in the global namespace.  I don't have strong opinions on whether to close the ticket or apply the proposed changes.

Thank you for having a look.

kjnash added on 2022-10-10 09:57:44:
This may not be a good idea.  The command names open, close, and send conflict with names in the global namespace.