Tcl Library Source Code

View Ticket
Login
Ticket UUID: 577ed0d10b9d631678921416d55805d80c4c6bd2
Title: Variables not unset unless ::websocket::upgrade not invoked
Type: Bug Version: 1.3
Submitter: anonymous Created on: 2014-08-11 08:24:44
Subsystem: websocket Assigned To: emmanuel
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2014-08-12 13:25:08
Resolution: None Closed By: nobody
    Closed on:
Description:
::websocket::test creates Client variable to communicate request values to ::websocket::upgrade. Only the latter unsets this temporary variable. Failing to invoke ::websocket::upgrade, creates a memory leak as requests come in.

In my opinion if there is no reason to invoke ::websocket::test without later upgrading, both should be merged in a single procedure. Otherwise no temporary variables should be created.
User Comments: emmanuel added on 2014-08-12 13:25:08:
I have an actual usecase for separating the test and upgrade in a server implementation. However, I think that you are right. One solution would be to document the variable created and change the calling/return interface: websocket::test would return fullyqualified name of the variable as an identification of success, otherwise an empty string. It would be up to the caller to remove (unset) the variable if no upgrade is to be performed.

What do you think?