Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /naja/src/php/rpc/NajaServer.class.php

naja
Discussion topic

Back to topic list

CVS update: /naja/src/php/rpc/NajaServer.class.php

Reply

Author pablo_cabrera
Full name Pablo J. Cabrera Munoz
Date 2006-05-27 13:13:11 PDT
Message User: pablo_cabrera
Date: 2006-05-27 13:13:11-0700
Log:
 no message

File Changes:

Directory: /naja/src/php/rpc/
=============================

File [changed]: NajaServer.class.php
Url: http://naja.tigris.o​rg/source/browse/naj​a/src/php/rpc/NajaSe​rver.class.php?r1=1.​1&r2=1.2
Delta lines: +22 -2
--------------------
--- NajaServer.class.php 2006-05-23 22:06:10-0700 1.1
+++ NajaServer.class.php 2006-05-27 13:13:09-0700 1.2
@@ -261,6 +261,10 @@
                     $message->setHas​hCode((string) $attrValue);
                     break;
                 }
+ case ("TRANSPORT") : {
+ $message->setTra​nsport((string) $attrValue);
+ break;
+ }
                 case ("TYPE") : {
                     $message->setType((string) $attrValue);
                     break;
@@ -347,8 +351,21 @@
         if (!empty($messageParams)) {
             $encoding = $pMessage->getEncoding();
             $serializer = $this->getSerial​izer($encoding);
+ $transport = $pMessage->getTransport();
+
+ $msgParams = $messageParams;
+ if ($transport == "BASE64") {
+ for ($i = 0; $i < count($msgParams); $i++) {
+ $msgParams[$i] = base64_decode($msgParams[$i]);
+ }
+ } else if ($transport == "URLENCODED") {
+ for ($i = 0; $i < count($msgParams); $i++) {
+ $msgParams[$i] = urldecode($msgParams[$i]);
+ }
+ }
+
 
- foreach ($messageParams as $param) {
+ foreach ($msgParams as $param) {
                 $params[] = $serializer->uns​erialize($param);
             }
         }
@@ -480,16 +497,19 @@
         $message = new NajaMessage();
 
         $replyValue = $pValue;
+ $transport = "PLAIN";
         $encoding = $this->getUsable​ClientEncoding($pEn​coding);
         if ($pEncoding != "PLAIN") {
             $serializer = $this->getSerial​izer($encoding);
+ $transport = $serializer->getTransport();
             $replyValue = $serializer->ser​ialize($replyValue)​;
         }
 
         $message->setTyp​e("RESPONSE");
+ $message->setTra​nsport($transport);​
         $message->setEnc​oding($encoding);
         $message->setRep​ly($replyValue);
- $message->setRes​ponse($this->get​UsableServerEncoding​($pEncoding));
+ $message->setRes​ponse(implode(";", $this->getEncodings()));
         $message->createMessage();
 
         return $message;

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /naja/src/php/rpc/NajaServer.class.php pablo_cabrera Pablo J. Cabrera Munoz 2006-05-27 13:13:11 PDT
Messages per page: