Skip to content

Commit

Permalink
修改几处bug: socket_strerror()函数的几处非法调用
Browse files Browse the repository at this point in the history
  • Loading branch information
idleGG committed Mar 13, 2017
1 parent cf77f03 commit 9ca19b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmds.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ public static function SW_blocksDecrypt( $socket,
socket_write($socket, $str, strlen($str));
$rsp=socket_read($socket,2);
if($rsp == FALSE){
throw new Exception(socket_strerror());
throw new Exception(socket_strerror(socket_last_error()));
}
$len = Bytes::bytesToShortBigEnd(Bytes::getBytes($rsp), 0);
$rsp = socket_read($socket, $len);
if($rsp == FALSE){
throw new Exception(socket_strerror());
throw new Exception(socket_strerror(socket_last_error()));
}

$rv = intval(substr($rsp, 2, 2));
Expand Down Expand Up @@ -286,12 +286,12 @@ public static function S3_Encrypt($socket,
socket_write($socket, $str, strlen($str));
$rsp=socket_read($socket,2);
if($rsp == FALSE){
throw new Exception(socket_strerror());
throw new Exception(socket_strerror(socket_last_error()));
}
$len = Bytes::bytesToShortBigEnd(Bytes::getBytes($rsp), 0);
$rsp = socket_read($socket, $len);
if($rsp == FALSE){
throw new Exception(socket_strerror());
throw new Exception(socket_strerror(socket_last_error()));
}
$errCode = ($rsp[2]&0xF) * 10 + ($rsp[3]&0xF);
if($errCode != 0){
Expand Down

0 comments on commit 9ca19b0

Please sign in to comment.