trying to figure out why one of the DC servers is really bad.
[ga4php.git] / gaas / lib / gaasdClient.php
index 4226368..c8eb7ba 100644 (file)
@@ -51,6 +51,7 @@ class GAASClient {
                // first check we got something that makes sense
                if(preg_match("/^AS:.*:EOD/", $recvd) < 1) {
                        socket_close($socket);
+                       echo "Returned data is not in right format\n";
                        // we have a problem jim
                        return false;
                }
@@ -60,6 +61,7 @@ class GAASClient {
                $component =  unserialize(base64_decode($xps[1]));
                
                if($component["type"] != $message_type) {
+                       echo "Message type was not the same as original message\n";
                        // we have a problem jim
                        socket_close($socket);
                        return false;
@@ -84,8 +86,11 @@ class GAASClient {
                $function_recv = $MESSAGES[$st_defined]."_clientrecv";
                //echo "real function is $function_send, $function_recv\n";
                
-               if(function_exists($function_send) && function_exists($function_recv)) {
-                       $function_recv($this->sendReceive($st_defined, $function_send($params)));
+               if(function_exists($function_send)) {
+                       $fromsend = $this->sendReceive($st_defined, $function_send($params)));
+                       if(function_exists($function_recv)) {
+                               return $function_recv($fromsend);
+                       } else return $fromsend;
                } else {
                        error_log("Function, $function does not exist!");
                }