Skip to content

Commit

Permalink
Merge pull request #44 from fcastilloes/fix-meta-calls
Browse files Browse the repository at this point in the history
Fix meta byte for communicating calls
  • Loading branch information
fcastilloes committed Jul 10, 2017
2 parents 17c0072 + bad86fa commit a5f8bb1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 24 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

##Upcoming
## Fixed
- Fix meta byte for communicating calls

## [1.1.5] - 2017-07-02
## Fixed
- Fixed url methods return type when a part is not found
Expand Down
48 changes: 25 additions & 23 deletions src/Mapper/CompactTransportMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -607,30 +607,32 @@ public function merge(Transport $transport, array $mergeData)
// Merge calls
foreach ($mergeData['C'] as $service => $sCalls) {
foreach ($sCalls as $version => $vCalls) {
if (isset($vCalls['g'])) {
$call = new RemoteCall(
new ServiceOrigin($service, $version),
$vCalls['C'],
$vCalls['g'],
$vCalls['n'],
new VersionString($vCalls['v']),
$vCalls['a'],
$vCalls['D'] ?? 0,
$vCalls['t'],
isset($vCalls['p'])? array_map([$this, 'getParam'], $vCalls['p']) : []
);
} else {
$call = new DeferCall(
new ServiceOrigin($service, $version),
$vCalls['C'],
$vCalls['n'],
new VersionString($vCalls['v']),
$vCalls['a'],
$vCalls['D'] ?? 0,
isset($vCalls['p'])? array_map([$this, 'getParam'], $vCalls['p']) : []
);
foreach ($vCalls as $vCall) {
if (isset($vCall['g'])) {
$call = new RemoteCall(
new ServiceOrigin($service, $version),
$vCall['C'],
$vCall['g'],
$vCall['n'],
new VersionString($vCall['v']),
$vCall['a'],
$vCall['D'] ?? 0,
$vCall['t'],
isset($vCall['p']) ? array_map([$this, 'getParam'], $vCall['p']) : []
);
} else {
$call = new DeferCall(
new ServiceOrigin($service, $version),
$vCall['C'],
$vCall['n'],
new VersionString($vCall['v']),
$vCall['a'],
$vCall['D'] ?? 0,
isset($vCall['p']) ? array_map([$this, 'getParam'], $vCall['p']) : []
);
}
$transport->addCall($call);
}
$transport->addCall($call);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/Messaging/Responder/ZeroMqMultipartResponder.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ private function sendActionResponse(ActionApi $action, PayloadWriterInterface $m
$payload = $this->serializer->serialize($message);

$controlString = '';
if ($action->getTransport()->hasCalls()) {
$transportCalls = $action->getTransport()->getCalls()->getArray($action->getName());
if (isset($transportCalls[$action->getVersion()])) {
$controlString .= "\x01";
}

Expand Down

0 comments on commit a5f8bb1

Please sign in to comment.