Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
djoos committed May 19, 2011
2 parents f965c4d + 6d96f3a commit e88cb2a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions cloudfiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function authenticate($version=DEFAULT_CF_API_VERSION)
if ($status == 401) {
throw new AuthenticationException("Invalid username or access key.");
}
if ($status != 204) {
if ($status < 200 || $status > 299) {
throw new InvalidResponseException(
"Unexpected response (".$status."): ".$reason);
}
Expand Down Expand Up @@ -1792,7 +1792,7 @@ function delete_object($obj,$container=NULL)
*
* Given an Object whos name contains '/' path separators, this function
* will create the "directory marker" Objects of one byte with the
* Content-Type of "application/folder".
* Content-Type of "application/directory".
*
* It assumes the last element of the full path is the "real" Object
* and does NOT create a remote storage Object for that last element.
Expand Down
15 changes: 8 additions & 7 deletions cloudfiles_http.php
Original file line number Diff line number Diff line change
Expand Up @@ -395,13 +395,13 @@ function head_cdn_container($container_name)

if (!$return_code) {
$this->error_str .= ": Failed to obtain valid HTTP response.";
return array(0,$this->error_str,NULL,NULL,NULL,NULL,NULL,NULL);
return array(0,$this->error_str,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
if ($return_code == 401) {
return array($return_code,"Unauthorized",NULL,NULL,NULL,NULL,NULL,NULL);
return array($return_code,"Unauthorized",NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
if ($return_code == 404) {
return array($return_code,"Account not found.",NULL,NULL,NULL,NULL,NULL,NULL);
return array($return_code,"Account not found.",NULL,NULL,NULL,NULL,NULL,NULL,NULL);
}
if ($return_code == 204) {
return array($return_code,$this->response_reason,
Expand All @@ -416,7 +416,8 @@ function head_cdn_container($container_name)
NULL,NULL,NULL,
$this->_cdn_log_retention,
$this->_cdn_acl_user_agent,
$this->_cdn_acl_referrer
$this->_cdn_acl_referrer,
NULL
);
}

Expand Down Expand Up @@ -894,12 +895,12 @@ function head_object(&$obj)
if (!$return_code) {
$this->error_str .= ": Failed to obtain valid HTTP response.";
return array(0, $this->error_str." ".$this->response_reason,
NULL, NULL, NULL, NULL, array());
NULL, NULL, NULL, NULL, array(), NULL);
}

if ($return_code == 404) {
return array($return_code, $this->response_reason,
NULL, NULL, NULL, NULL, array());
NULL, NULL, NULL, NULL, array(), NULL);
}
if ($return_code == 204 || $return_code == 200) {
return array($return_code,$this->response_reason,
Expand All @@ -912,7 +913,7 @@ function head_object(&$obj)
}
$this->error_str = "Unexpected HTTP return code: $return_code";
return array($return_code, $this->error_str." ".$this->response_reason,
NULL, NULL, NULL, NULL, array());
NULL, NULL, NULL, NULL, array(), NULL);
}

# COPY /v1/Account/Container/Object
Expand Down

0 comments on commit e88cb2a

Please sign in to comment.