Skip to content

Commit

Permalink
Set OS specific \r\n and \n
Browse files Browse the repository at this point in the history
  • Loading branch information
frost-nzcr4 committed Sep 11, 2016
1 parent 1df9620 commit d585a91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions http/http_client.php
Expand Up @@ -103,10 +103,10 @@ public function on_response($raw)

protected function send_request()
{
$this->client->send($this->line()."\r\n");
$this->client->send($this->ua()."\r\n");
$this->client->send($this->host()."\r\n");
$this->client->send("\r\n");
$this->client->send($this->line().HTTPServer::HTTP_CRLF);
$this->client->send($this->ua().HTTPServer::HTTP_CRLF);
$this->client->send($this->host().HTTPServer::HTTP_CRLF);
$this->client->send(HTTPServer::HTTP_CRLF);
}

//
Expand Down
2 changes: 1 addition & 1 deletion http/http_request.php
Expand Up @@ -225,7 +225,7 @@ public function wait_for_body($event, $args)
if ($this->multipart) {
// boundary start, content_disposition, form data, boundary start, ....., boundary end
// these define various states of a multipart/form-data
$form_data = explode("\r\n", $rcvd);
$form_data = explode(HTTPServer::HTTP_CRLF, $rcvd);
foreach ($form_data as $data) {
//_debug("passing $data to multipart fsm");
if (!$this->multipart->process($data)) {
Expand Down
8 changes: 4 additions & 4 deletions jaxlctl
Expand Up @@ -112,12 +112,12 @@ class JAXLCtl
public static function printHelp()
{
global $exe;
_colorize("Usage: $exe command [options...]\n", JAXLLogger::INFO);
_colorize("Usage: $exe command [options...]".PHP_EOL, JAXLLogger::INFO);
_colorize("Commands:", JAXLLogger::NOTICE);
_colorize(" help This help text", JAXLLogger::DEBUG);
_colorize(" debug Attach a debug console to a running JAXL daemon", JAXLLogger::DEBUG);
_colorize(" shell Open up Jaxl shell emulator", JAXLLogger::DEBUG);
echo "\n";
echo PHP_EOL;
}

protected function help()
Expand Down Expand Up @@ -174,7 +174,7 @@ class JAXLCtl
{
$ret = unserialize($raw);
print_r($ret);
echo "\n";
echo PHP_EOL;
JAXLCli::prompt();
}

Expand All @@ -197,4 +197,4 @@ if ($argc < 2) {
}

$ctl = new JAXLCtl($command, $params);
echo "done\n";
echo "done".PHP_EOL;

0 comments on commit d585a91

Please sign in to comment.