summaryrefslogtreecommitdiff
path: root/plugins/common/RESTSupport.vala
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/common/RESTSupport.vala')
-rw-r--r--plugins/common/RESTSupport.vala18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/common/RESTSupport.vala b/plugins/common/RESTSupport.vala
index b76bead..1a9052b 100644
--- a/plugins/common/RESTSupport.vala
+++ b/plugins/common/RESTSupport.vala
@@ -246,21 +246,21 @@ public class Transaction {
protected void check_response(Soup.Message message) throws Spit.Publishing.PublishingError {
switch (message.status_code) {
- case Soup.Status.OK:
- case Soup.Status.CREATED: // HTTP code 201 (CREATED) signals that a new
- // resource was created in response to a PUT or POST
+ case Soup.KnownStatusCode.OK:
+ case Soup.KnownStatusCode.CREATED: // HTTP code 201 (CREATED) signals that a new
+ // resource was created in response to a PUT or POST
break;
- case Soup.Status.CANT_RESOLVE:
- case Soup.Status.CANT_RESOLVE_PROXY:
+ case Soup.KnownStatusCode.CANT_RESOLVE:
+ case Soup.KnownStatusCode.CANT_RESOLVE_PROXY:
throw new Spit.Publishing.PublishingError.NO_ANSWER("Unable to resolve %s (error code %u)",
get_endpoint_url(), message.status_code);
- case Soup.Status.CANT_CONNECT:
- case Soup.Status.CANT_CONNECT_PROXY:
+ case Soup.KnownStatusCode.CANT_CONNECT:
+ case Soup.KnownStatusCode.CANT_CONNECT_PROXY:
throw new Spit.Publishing.PublishingError.NO_ANSWER("Unable to connect to %s (error code %u)",
get_endpoint_url(), message.status_code);
- case Soup.Status.SSL_FAILED:
+ case Soup.KnownStatusCode.SSL_FAILED:
throw new Spit.Publishing.PublishingError.SSL_FAILED ("Unable to connect to %s: Secure connection failed",
get_endpoint_url ());
@@ -511,7 +511,7 @@ public class UploadTransaction : Transaction {
int payload_part_num = message_parts.get_length();
- Soup.Buffer bindable_data = new Soup.Buffer.take (payload.data);
+ Soup.Buffer bindable_data = new Soup.Buffer(Soup.MemoryUse.COPY, payload.data[0:payload_length]);
message_parts.append_form_file("", publishable.get_serialized_file().get_path(), mime_type,
bindable_data);