1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Check whether the socket is writable.

This commit is contained in:
Tim Düsterhus 2012-04-28 19:59:33 +02:00
parent e444cd5733
commit 49f8e67baf
2 changed files with 2 additions and 2 deletions

View File

@ -22,7 +22,7 @@ class ChatMessageEditor extends \wcf\data\DatabaseObjectEditor {
public static function create(array $parameters = array()) { public static function create(array $parameters = array()) {
try { try {
if (CHAT_SOCKET_IO_PATH) { if (CHAT_SOCKET_IO_PATH) {
if (file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { if (file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock') && is_writable(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) {
$sock = stream_socket_client('unix://'.WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock', $errno, $errstr, 1); $sock = stream_socket_client('unix://'.WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock', $errno, $errstr, 1);
fclose($sock); fclose($sock);
} }

View File

@ -45,7 +45,7 @@ final class ChatUtil {
*/ */
public static function getDiedUsers() { public static function getDiedUsers() {
$packageID = \wcf\util\ChatUtil::getPackageID(); $packageID = \wcf\util\ChatUtil::getPackageID();
if (CHAT_SOCKET_IO_PATH && file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { if (CHAT_SOCKET_IO_PATH && file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock') && is_writable(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) {
$sql = "SELECT $sql = "SELECT
time time
FROM FROM