Skip to content

Commit

Permalink
Livestatus\Connection: discover column headers...
Browse files Browse the repository at this point in the history
...in case the query doesn't know about
  • Loading branch information
Thomas-Gelf committed Nov 16, 2014
1 parent 8ec8c15 commit e755b37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions library/Icinga/Protocol/Livestatus/Connection.php
Expand Up @@ -248,6 +248,15 @@ protected function readFromSocket($length)
return $buffer;
}

protected function discoverColumnHeaders($query)
{
if ($query->hasColumns()) {
$this->headers = $query->getColumnAliases();
} else {
$this->headers = $this->splitLine($this->readLineFromSocket());
}
}

protected function readLineFromSocket()
{
if ($this->bytesRead === $this->responseSize) {
Expand Down

0 comments on commit e755b37

Please sign in to comment.