Skip to content

Commit

Permalink
Version 2.4:
Browse files Browse the repository at this point in the history
 - Fix: WebSocketClient hat TLS-Pakete falsch zerlegt.
  • Loading branch information
Nall-chan committed Jun 14, 2020
1 parent c112639 commit c31cc55
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Version](https://img.shields.io/badge/Symcon-PHPModul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Version](https://img.shields.io/badge/Modul%20Version-2.3-blue.svg)]()
[![Version](https://img.shields.io/badge/Modul%20Version-2.4-blue.svg)]()
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Version](https://img.shields.io/badge/Symcon%20Version-4.3%20%3E-green.svg)](https://www.symcon.de/forum/threads/30857-IP-Symcon-4-3-%28Stable%29-Changelog)
[![StyleCI](https://styleci.io/repos/104255893/shield?style=flat)](https://styleci.io/repos/104255893)
Expand Down Expand Up @@ -72,6 +72,9 @@ Details sind in der Dokumentation der jeweiligen Module beschrieben.

### 2. Changlog

Version 2.4:
- Fix: WebSocketClient hat TLS-Pakete falsch zerlegt.

Version 2.3:
- Fix: DHCP-Sniffer hat während des Symcon Systemstart auf falsche DHCP Requests reagiert.

Expand Down
8 changes: 4 additions & 4 deletions WebSocketClient/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* @package Network
* @file module.php
* @author Michael Tröger <[email protected]>
* @copyright 2017 Michael Tröger
* @copyright 2020 Michael Tröger
* @license https://creativecommons.org/licenses/by-nc-sa/4.0/ CC BY-NC-SA 4.0
* @version 1.0
* @version 2.4
*/

/**
Expand Down Expand Up @@ -222,7 +222,7 @@ public function ApplyChanges()
}
$OldState = $this->State;
$this->SendDebug(__FUNCTION__, 'OldState:' . $OldState, 0);
if ((($OldState != WebSocketState::unknow) and ($OldState != WebSocketState::Connected)) or ($OldState == WebSocketState::init)) {
if ((($OldState != WebSocketState::unknow) and ( $OldState != WebSocketState::Connected)) or ( $OldState == WebSocketState::init)) {
return;
}

Expand Down Expand Up @@ -745,7 +745,7 @@ public function ReceiveData($JSONString)
break;
}
}
if (strlen($TLSData) > 0) {
if (strlen($TLSData) == 0) {
$this->TLSReceiveBuffer = '';
} else {
//$this->SendDebug('Receive TLS Part', $TLSData, 0);
Expand Down
4 changes: 2 additions & 2 deletions WebSocketServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ Implementierung eines Server mit Websocket Protokoll in IPS.
## 6. PHP-Befehlsreferenz

```php
bool WSS_SendPing(integer $InstanzeID, string $ClientIP, string $Text);
bool WSS_SendPing(integer $InstanzeID, string $ClientIP, int $ClientPort, string $Text);
```
Senden die in `$Text` übergeben Daten als Payload eines Ping an die `$ClientIP` eines WebSocket-Clients.
Senden die in `$Text` übergeben Daten als Payload eines Ping an den in `$ClientIP` & `$ClientPort` angegeben WebSocket-Client.
Der Rückgabewert ist `True`, wenn der Client verbunden ist und den Ping beantwortet.


Expand Down
4 changes: 2 additions & 2 deletions WebSocketServer/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,12 +1109,12 @@ public function KeepAlive()
* Versendet einen Ping an einen Client.
*
* @param string $ClientIP Die IP-Adresse des Client.
* @param string $ClientPort Der Port des Client.
* @param int $ClientPort Der Port des Client.
* @param string $Text Der Payload des Ping.
*
* @return bool True bei Erfolg, im Fehlerfall wird eine Warnung und false ausgegeben.
*/
public function SendPing(string $ClientIP, string $ClientPort, string $Text)
public function SendPing(string $ClientIP, int $ClientPort, string $Text)
{
$Client = $this->Multi_Clients->GetByIpPort(new Websocket_Client($ClientIP, $ClientPort));
if ($Client === false) {
Expand Down
6 changes: 3 additions & 3 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"version": "4.3",
"date": 1498241677
},
"version": "2.3",
"build": 300,
"date": 1590515480
"version": "2.4",
"build": 320,
"date": 1592137828
}

0 comments on commit c31cc55

Please sign in to comment.