Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionServeController.php
| Show First 20 Lines • Show All 530 Lines • ▼ Show 20 Lines | if ($cmd == 'getbundle' || | ||||
| $body = gzcompress($stdout); | $body = gzcompress($stdout); | ||||
| } else if ($cmd == 'unbundle') { | } else if ($cmd == 'unbundle') { | ||||
| // This includes diagnostic information and anything echoed by commit | // This includes diagnostic information and anything echoed by commit | ||||
| // hooks. We ignore `stdout` since it just has protocol garbage, and | // hooks. We ignore `stdout` since it just has protocol garbage, and | ||||
| // substitute `stderr`. | // substitute `stderr`. | ||||
| $body = strlen($stderr)."\n".$stderr; | $body = strlen($stderr)."\n".$stderr; | ||||
| } else { | } else { | ||||
| list($length, $body) = explode("\n", $stdout, 2); | list($length, $body) = explode("\n", $stdout, 2); | ||||
| if ($cmd == 'capabilities') { | |||||
| $body = DiffusionMercurialWireProtocol::filterBundle2Capability($body); | |||||
| } | |||||
| } | } | ||||
| return id(new DiffusionMercurialResponse())->setContent($body); | return id(new DiffusionMercurialResponse())->setContent($body); | ||||
| } | } | ||||
| private function getMercurialArguments() { | private function getMercurialArguments() { | ||||
| // Mercurial sends arguments in HTTP headers. "Why?", you might wonder, | // Mercurial sends arguments in HTTP headers. "Why?", you might wonder, | ||||
| // "Why would you do this?". | // "Why would you do this?". | ||||
| $args_raw = array(); | $args_raw = array(); | ||||
| for ($ii = 1;; $ii++) { | for ($ii = 1;; $ii++) { | ||||
| $header = 'HTTP_X_HGARG_'.$ii; | $header = 'HTTP_X_HGARG_'.$ii; | ||||
| if (!array_key_exists($header, $_SERVER)) { | if (!array_key_exists($header, $_SERVER)) { | ||||
| ▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines | |||||