From 2fc714cc9ca547d10b7b33d6781e275f2d0dc9a1 Mon Sep 17 00:00:00 2001 From: mmelyp Date: Mon, 9 Mar 2015 15:32:16 +0100 Subject: [PATCH 1/2] fix close connection close method of RawConnection.php file leaves child processes of smbclient running which slows down the system. See [1] 1- http://php.net/manual/en/function.proc-terminate.php --- src/RawConnection.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/RawConnection.php b/src/RawConnection.php index 926ce37..7f69261 100644 --- a/src/RawConnection.php +++ b/src/RawConnection.php @@ -149,6 +149,14 @@ class RawConnection { return; } if ($terminate) { + $status = proc_get_status($this->process); + $ppid = $status['pid']; + $pids = preg_split('/\s+/', `ps -o pid --no-heading --ppid $ppid`); + foreach($pids as $pid) { + if(is_numeric($pid)) { + posix_kill($pid, 9); //9 is the SIGKILL signal + } + } proc_terminate($this->process); } proc_close($this->process); From 030e398c660d6fcc87748ffee93fbcdee24f612c Mon Sep 17 00:00:00 2001 From: mmelyp Date: Tue, 10 Mar 2015 13:11:22 +0100 Subject: [PATCH 2/2] change package name in composer.json --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 92f4280..9773686 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,15 @@ { - "name" : "icewind/smb", + "name" : "mmelyp/smb", "description" : "php wrapper for smbclient and libsmbclient-php", "license" : "MIT", "authors" : [ { "name" : "Robin Appelman", "email": "icewind@owncloud.com" + }, + { + "name" : "Manuel Mely", + "email": "mmely@mmely.de" } ], "require" : {