fixed 'not well-formed...' error caused my ESP chararater passed to XMLin function

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4330 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2009-10-09 17:51:31 +00:00
parent cc05e2710c
commit cdeb9db913

View File

@ -161,7 +161,17 @@ sub submit_request {
while (<$client>) {
$response .= $_;
if (m/<\/xcatresponse>/) {
#replace ESC with xxxxESCxxx because XMLin cannot handle it
$response =~ s/\e/xxxxESCxxxx/g;
$rsp = XMLin($response,SuppressEmpty=>undef,ForceArray=>1);
#add ESC back
foreach my $key (keys %$rsp) {
if (ref($rsp->{$key}) eq 'ARRAY') { foreach my $text (@{$rsp->{$key}}) { $text =~ s/xxxxESCxxxx/\e/g; } }
else { $rsp->{$key} =~ s/xxxxESCxxxx/\r/g; }
}
$response='';
$callback->($rsp);
if ($rsp->{serverdone}) {