Skip to content

Commit

Permalink
without curlwrappers we get a hanging request (one step further) when…
Browse files Browse the repository at this point in the history
… protocol is set to 1.1, error when using default HTTP 1.0.
  • Loading branch information
beberlei committed Mar 26, 2012
1 parent 54d91b8 commit b80d237
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
17 changes: 9 additions & 8 deletions lib/Doctrine/KeyValueStore/Http/StreamClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class StreamClient implements Client
* @var array
*/
private $options = array(
'timeout' => 5,
'timeout' => 2,
);

/**
Expand Down Expand Up @@ -70,13 +70,14 @@ public function request($method, $url, $body = null, array $headers)
// TODO SSL support?
$opts = array(
'http' => array(
'method' => $method,
'content' => $body,
'ignore_errors' => true,
'max_redirects' => 0,
'user_agent' => 'Doctrine KeyValueStore',
'timeout' => $this->options['timeout'],
'header' => $header,
'method' => $method,
'content' => $body,
'ignore_errors' => true,
'max_redirects' => 0,
'user_agent' => 'Doctrine KeyValueStore',
'timeout' => $this->options['timeout'],
'header' => $header,
'protocol_version' => '1.1',
),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ public function createTable($tableName)

$url = $this->baseUrl . '/Tables';
$response = $this->request('POST', $url, $xml, $headers);

return $response;
}

private function serializeKeys($propertiesNode, $key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public function testCrud()
$auth
);

$storage->createTable("test");
$response = $storage->createTable("test");
var_dump($reponse);
#$storage->insert("test", array("dist" => "foo", "range" => 100), array("foo" => "bar"));
}
}

0 comments on commit b80d237

Please sign in to comment.