This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch master in repository x2gowebrpc. from d2803d6 debian/x2gowebrpc.{postinst,postrm}: Make sure x2gorpc.cgi is executable for www-data user. new ebfc658 Improve JSON parsing. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: x2gorpc.cgi | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gowebrpc.git
This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository x2gowebrpc. commit ebfc6585f797d672fec95bf2eee2f7af8bd352cd Author: Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> Date: Mon Jun 21 18:26:10 2021 -0500 Improve JSON parsing. --- x2gorpc.cgi | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/x2gorpc.cgi b/x2gorpc.cgi index 07e5456..b86e4ac 100755 --- a/x2gorpc.cgi +++ b/x2gorpc.cgi @@ -101,7 +101,7 @@ sub suspendTerminateSession }; $robj->{'err'}=@out[1]; my $jsontext =JSON->new->utf8->encode ($robj); - print $jsontext; + print "__STARTJSON__".$jsontext; } sub startSession @@ -214,7 +214,7 @@ sub startSession finish: my $jsontext =JSON->new->utf8->encode ($robj); - print $jsontext; + print "__STARTJSON__".$jsontext; } @@ -247,6 +247,20 @@ sub openChannel } } + +sub simplifyOutput +{ + my $stout=shift; + $stout=~s/\[//g; + $stout=~s/\]//g; + $stout=~s/\{//g; + $stout=~s/\}//g; + $stout=~s/\"//g; + $stout=~s/\'//g; + return $stout; +} + + sub runSSHCommand { my $command=shift; @@ -326,7 +340,7 @@ sub runSSHCommand return (1,"Can't connect to Server", $exp->exp_before().$exp->exp_match()); } - return $exp->exp_before().$exp->exp_match(); + return simplifyOutput($exp->exp_before().$exp->exp_match()); } sub connectToProxy @@ -356,8 +370,8 @@ sub parseOutput my $err=$listout[0]; my $stout=$listout[1]; $stout=(split("STDOUT_END",$stout))[0]; - $robj->{'stdout'}=$stout; - $robj->{'stderr'}=$err; + $robj->{'stdout'}=simplifyOutput($stout); + $robj->{'stderr'}=simplifyOutput($err); } sub getFreePort -- Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2gowebrpc.git