Skip to content

Commit 9ca19b0

Browse files
committed
修改几处bug: socket_strerror()函数的几处非法调用
1 parent cf77f03 commit 9ca19b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmds.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,12 @@ public static function SW_blocksDecrypt( $socket,
191191
socket_write($socket, $str, strlen($str));
192192
$rsp=socket_read($socket,2);
193193
if($rsp == FALSE){
194-
throw new Exception(socket_strerror());
194+
throw new Exception(socket_strerror(socket_last_error()));
195195
}
196196
$len = Bytes::bytesToShortBigEnd(Bytes::getBytes($rsp), 0);
197197
$rsp = socket_read($socket, $len);
198198
if($rsp == FALSE){
199-
throw new Exception(socket_strerror());
199+
throw new Exception(socket_strerror(socket_last_error()));
200200
}
201201

202202
$rv = intval(substr($rsp, 2, 2));
@@ -286,12 +286,12 @@ public static function S3_Encrypt($socket,
286286
socket_write($socket, $str, strlen($str));
287287
$rsp=socket_read($socket,2);
288288
if($rsp == FALSE){
289-
throw new Exception(socket_strerror());
289+
throw new Exception(socket_strerror(socket_last_error()));
290290
}
291291
$len = Bytes::bytesToShortBigEnd(Bytes::getBytes($rsp), 0);
292292
$rsp = socket_read($socket, $len);
293293
if($rsp == FALSE){
294-
throw new Exception(socket_strerror());
294+
throw new Exception(socket_strerror(socket_last_error()));
295295
}
296296
$errCode = ($rsp[2]&0xF) * 10 + ($rsp[3]&0xF);
297297
if($errCode != 0){

0 commit comments

Comments
 (0)