From 809aafb5a9dfe2c8cb7e4a0103e32e03d0959f0c Mon Sep 17 00:00:00 2001
From: Marcus Agehall <agehall@gmail.com>
Date: Tue, 22 Aug 2017 20:24:32 +0200
Subject: [PATCH] The id variable will be overridden by the local variable, so
 the id passed to onopen() will be the Stdio.File object which seems wrong.

---
 lib/modules/Protocols.pmod/WebSocket.pmod | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/modules/Protocols.pmod/WebSocket.pmod b/lib/modules/Protocols.pmod/WebSocket.pmod
index 914efd2a2d..bd74ac3907 100644
--- a/lib/modules/Protocols.pmod/WebSocket.pmod
+++ b/lib/modules/Protocols.pmod/WebSocket.pmod
@@ -358,7 +358,7 @@ class Connection {
 		  // websocket callback handlers
           masking = 1; // RFC6455 dictates that clients always use masking!
           state = OPEN;
-          if (onopen) onopen(id || this);
+          if (onopen) onopen(this_program::id || this);
 
           if (sizeof(http_buffer))
             websocket_in(id, http_buffer->read());
-- 
GitLab