[phodav/wip/feborges/port-to-libsoup3] WIP




commit 2804912e5c7ef6231c61e259dc0a0b73b71319a7
Author: Felipe Borges <felipeborges gnome org>
Date:   Mon Jun 27 13:40:14 2022 +0200

    WIP

 bin/chezdav.c                      |  8 +++---
 libphodav/phodav-if.c              | 12 ++++----
 libphodav/phodav-method-get.c      | 22 ++++++++-------
 libphodav/phodav-method-lock.c     |  9 +++---
 libphodav/phodav-method-movecopy.c | 17 ++++++------
 libphodav/phodav-method-propfind.c | 12 ++++----
 libphodav/phodav-method-put.c      | 15 +++++-----
 libphodav/phodav-method-unlock.c   |  2 +-
 libphodav/phodav-multistatus.c     |  6 ++--
 libphodav/phodav-server.c          | 56 ++++++++++++++++++++------------------
 libphodav/phodav-utils.c           |  4 +--
 libphodav/phodav-utils.h           |  2 +-
 meson.build                        |  2 +-
 tests/virtual-dir.c                |  4 +--
 14 files changed, 89 insertions(+), 82 deletions(-)
---
diff --git a/bin/chezdav.c b/bin/chezdav.c
index 543c045..077e54c 100644
--- a/bin/chezdav.c
+++ b/bin/chezdav.c
@@ -188,10 +188,10 @@ main (int argc, char *argv[])
       if (!g_file_get_contents (htdigest, &htdigest, NULL, &error))
         my_error (_ ("Failed to open htdigest: %s\n"), error->message);
 
-      auth = soup_auth_domain_digest_new (SOUP_AUTH_DOMAIN_REALM, realm,
-                                          SOUP_AUTH_DOMAIN_ADD_PATH, "/",
-                                          SOUP_AUTH_DOMAIN_DIGEST_AUTH_CALLBACK, digest_auth_callback,
-                                          SOUP_AUTH_DOMAIN_DIGEST_AUTH_DATA, NULL,
+      auth = soup_auth_domain_digest_new ("realm", realm,
+                                          "add-path", "/",
+                                          "auth-callback", digest_auth_callback,
+                                          "auth-data", NULL,
                                           NULL);
       server = phodav_server_get_soup_server (dav);
       soup_server_add_auth_domain (server, auth);
diff --git a/libphodav/phodav-if.c b/libphodav/phodav-if.c
index 5d3e79e..b7608df 100644
--- a/libphodav/phodav-if.c
+++ b/libphodav/phodav-if.c
@@ -232,17 +232,17 @@ eval_if_lists (PathHandler *handler, IfState *state)
 static gboolean
 eval_if_tag (PathHandler *handler, IfState *state)
 {
-  SoupURI *uri;
+  GUri *uri;
   const gchar *path;
   const gchar *ref = accept_ref (state);
 
   g_return_val_if_fail (ref != NULL, FALSE);
 
-  uri = soup_uri_new (ref);
-  path = soup_uri_get_path (uri);
+  uri = g_uri_parse (ref, SOUP_HTTP_URI_FLAGS, NULL);
+  path = g_uri_get_path (uri);
   g_free (state->path);
   state->path = g_strdup (path);
-  soup_uri_free (uri);
+  g_uri_unref (uri);
 
   return eval_if_lists (handler, state);
 }
@@ -270,9 +270,9 @@ phodav_check_if (PathHandler *handler, SoupMessage *msg, const gchar *path, GLis
   PhodavServer *server = handler_get_server (handler);
   gboolean success = TRUE;
   gint status;
-  gchar *str = g_strdup (soup_message_headers_get_one (msg->request_headers, "If"));
+  gchar *str = g_strdup (soup_message_headers_get_one (soup_message_get_request_headers (msg), "If"));
   IfState state = { .cur = str, .path = g_strdup (path) };
-  gboolean copy = msg->method == SOUP_METHOD_COPY;
+  gboolean copy = soup_message_get_method (msg) == SOUP_METHOD_COPY;
 
   if (!str)
     goto end;
diff --git a/libphodav/phodav-method-get.c b/libphodav/phodav-method-get.c
index f9a967d..78b42f1 100644
--- a/libphodav/phodav-method-get.c
+++ b/libphodav/phodav-method-get.c
@@ -89,6 +89,7 @@ method_get (SoupMessage *msg, GFile *file,
   gint status = SOUP_STATUS_NOT_FOUND;
   GFileInfo *info;
   const gchar *etag;
+  SoupMessageHeaders *response_headers = soup_message_get_response_headers (msg);
 
   info = g_file_query_info (file, "standard::*,etag::*",
                             G_FILE_QUERY_INFO_NONE, cancellable, &error);
@@ -114,17 +115,17 @@ method_get (SoupMessage *msg, GFile *file,
   if (etag)
     {
       gchar *tmp = g_strdup_printf ("\"%s\"", etag);
-      soup_message_headers_append (msg->response_headers, "ETag", tmp);
+      soup_message_headers_append (response_headers, "ETag", tmp);
       g_free (tmp);
     }
 
-  soup_message_headers_set_content_type (msg->response_headers,
+  soup_message_headers_set_content_type (response_headers,
                                          g_file_info_get_content_type (info), NULL);
 
-  if (msg->method == SOUP_METHOD_GET)
+  if (soup_message_get_method (msg) == SOUP_METHOD_GET)
     {
       GMappedFile *mapping;
-      SoupBuffer *buffer;
+      GBytes *buffer;
       gchar *path = g_file_get_path (file);
 
       mapping = g_mapped_file_new (path, FALSE, NULL);
@@ -135,14 +136,15 @@ method_get (SoupMessage *msg, GFile *file,
           goto end;
         }
 
-      buffer = soup_buffer_new_with_owner (g_mapped_file_get_contents (mapping),
+      buffer = g_bytes_new_with_free_func (g_mapped_file_get_contents (mapping),
                                            g_mapped_file_get_length (mapping),
-                                           mapping, (GDestroyNotify) g_mapped_file_unref);
-      soup_message_body_append_buffer (msg->response_body, buffer);
-      soup_buffer_free (buffer);
+                                           (GDestroyNotify) g_mapped_file_unref,
+                                           mapping);
+      soup_message_body_append_bytes (msg->response_body, buffer);
+      g_bytes_unref (buffer);
       status = SOUP_STATUS_OK;
     }
-  else if (msg->method == SOUP_METHOD_HEAD)
+  else if (soup_message_get_method (msg) == SOUP_METHOD_HEAD)
     {
       gchar *length;
 
@@ -151,7 +153,7 @@ method_get (SoupMessage *msg, GFile *file,
        * But we'll optimize and avoid the extra I/O.
        */
       length = g_strdup_printf ("%" G_GUINT64_FORMAT, g_file_info_get_size (info));
-      soup_message_headers_append (msg->response_headers, "Content-Length", length);
+      soup_message_headers_append (response_headers, "Content-Length", length);
 
       g_free (length);
       status = SOUP_STATUS_OK;
diff --git a/libphodav/phodav-method-lock.c b/libphodav/phodav-method-lock.c
index 76c290c..1ae82cd 100644
--- a/libphodav/phodav-method-lock.c
+++ b/libphodav/phodav-method-lock.c
@@ -140,17 +140,18 @@ phodav_method_lock (PathHandler *handler, SoupMessage *msg,
   gchar *ltoken = NULL, *uuid = NULL, *token = NULL;
   DAVLock *lock = NULL;
   gint status = SOUP_STATUS_BAD_REQUEST;
+  SoupMessageHeaders *request_headers = soup_message_get_request_headers (msg);
   gboolean created;
 
-  depth = depth_from_string (soup_message_headers_get_one (msg->request_headers, "Depth"));
-  timeout = timeout_from_string (soup_message_headers_get_one (msg->request_headers, "Timeout"));
+  depth = depth_from_string (soup_message_headers_get_one (request_headers, "Depth"));
+  timeout = timeout_from_string (soup_message_headers_get_one (request_headers, "Timeout"));
 
   if (depth != DEPTH_ZERO && depth != DEPTH_INFINITY)
     goto end;
 
   if (!msg->request_body->length)
     {
-      const gchar *hif = soup_message_headers_get_one (msg->request_headers, "If");
+      const gchar *hif = soup_message_headers_get_one (request_headers, "If");
       gint len = strlen (hif);
 
       if (len <= 4 || hif[0] != '(' || hif[1] != '<' || hif[len - 2] != '>' || hif[len - 1] != ')')
@@ -205,7 +206,7 @@ phodav_method_lock (PathHandler *handler, SoupMessage *msg,
   uuid = g_uuid_string_random ();
   token = g_strdup_printf ("urn:uuid:%s", uuid);
   ltoken = g_strdup_printf ("<%s>", token);
-  soup_message_headers_append (msg->response_headers, "Lock-Token", ltoken);
+  soup_message_headers_append (soup_message_get_response_headers (msg), "Lock-Token", ltoken);
 
   lpath = server_get_path (handler_get_server (handler), path);
   lock = dav_lock_new (lpath, token, scope, type, depth, owner, timeout);
diff --git a/libphodav/phodav-method-movecopy.c b/libphodav/phodav-method-movecopy.c
index b4ec78d..085ff25 100644
--- a/libphodav/phodav-method-movecopy.c
+++ b/libphodav/phodav-method-movecopy.c
@@ -79,14 +79,15 @@ do_movecopy_file (SoupMessage *msg, GFile *file,
   gboolean overwrite;
   DepthType depth;
   gint status = SOUP_STATUS_PRECONDITION_FAILED;
-  gboolean copy = msg->method == SOUP_METHOD_COPY;
+  gboolean copy = soup_message_get_method (msg) == SOUP_METHOD_COPY;
   GFileCopyFlags flags = G_FILE_COPY_ALL_METADATA;
+  SoupMessageHeaders *request_headers = soup_message_get_request_headers (msg);
   gboolean retry = FALSE;
   gboolean exists;
 
-  depth = depth_from_string (soup_message_headers_get_one (msg->request_headers, "Depth"));
+  depth = depth_from_string (soup_message_headers_get_one (request_headers, "Depth"));
   overwrite = !!g_strcmp0 (
-    soup_message_headers_get_one (msg->request_headers, "Overwrite"), "F");
+    soup_message_headers_get_one (request_headers, "Overwrite"), "F");
   if (overwrite)
     flags |= G_FILE_COPY_OVERWRITE;
   exists = g_file_query_exists (dest, cancellable);
@@ -155,17 +156,17 @@ phodav_method_movecopy (PathHandler *handler, SoupMessage *msg,
 {
   GFile *file = NULL, *dest_file = NULL;
   GCancellable *cancellable = handler_get_cancellable (handler);
-  SoupURI *dest_uri = NULL;
+  GUri *dest_uri = NULL;
   gint status = SOUP_STATUS_NOT_FOUND;
   const gchar *dest;
   gchar *udest;
   GList *submitted = NULL;
 
-  dest = soup_message_headers_get_one (msg->request_headers, "Destination");
+  dest = soup_message_headers_get_one (soup_message_get_request_headers (msg), "Destination");
   if (!dest)
     goto end;
-  dest_uri = soup_uri_new (dest);
-  dest = soup_uri_get_path (dest_uri);
+  dest_uri = g_uri_parse (dest, SOUP_HTTP_URI_FLAGS, NULL);
+  dest = g_uri_get_path (dest_uri);
   if (!dest || !*dest)
     goto end;
 
@@ -196,7 +197,7 @@ phodav_method_movecopy (PathHandler *handler, SoupMessage *msg,
 
 end:
   if (dest_uri)
-    soup_uri_free (dest_uri);
+    g_uri_unref (dest_uri);
   g_clear_object (&file);
   g_clear_object (&dest_file);
   g_list_free_full (submitted, (GDestroyNotify) lock_submitted_free);
diff --git a/libphodav/phodav-method-propfind.c b/libphodav/phodav-method-propfind.c
index d0dc0ae..61a8e3a 100644
--- a/libphodav/phodav-method-propfind.c
+++ b/libphodav/phodav-method-propfind.c
@@ -140,15 +140,15 @@ end:
 static void
 node_add_time (xmlNodePtr node, guint64 time, SoupDateFormat format)
 {
-  SoupDate *date;
+  GDateTime *date;
   gchar *text;
 
   g_warn_if_fail (time != 0);
-  date = soup_date_new_from_time_t (time);
-  text = soup_date_to_string (date, format);
+  date = g_date_time_new_from_unix_local (time);
+  text = soup_date_time_to_string (date, format);
   xmlAddChild (node, xmlNewText (BAD_CAST text));
   g_free (text);
-  soup_date_free (date);
+  g_date_time_unref (date);
 }
 
 static xmlNodePtr
@@ -197,7 +197,7 @@ prop_getlastmodified (PathHandler *handler, PropFind *pf,
   if (time == 0)
     status = SOUP_STATUS_NOT_FOUND;
   else
-    node_add_time (node, time, SOUP_DATE_ISO8601);
+    node_add_time (node, time, SOUP_DATE_HTTP); // FIXME: what about SOUP_DATE_ISO8601?
 
 end:
   PROP_SET_STATUS (node, status);
@@ -694,7 +694,7 @@ phodav_method_propfind (PathHandler *handler, SoupMessage *msg,
   gint status = SOUP_STATUS_NOT_FOUND;
   xmlNsPtr ns = NULL;
 
-  depth = depth_from_string (soup_message_headers_get_one (msg->request_headers, "Depth"));
+  depth = depth_from_string (soup_message_headers_get_one (soup_message_get_request_headers (msg), "Depth"));
   if (!msg->request_body || !msg->request_body->length)
     {
       /* Win kludge: http://code.google.com/p/sabredav/wiki/Windows */
diff --git a/libphodav/phodav-method-put.c b/libphodav/phodav-method-put.c
index 785996b..0b79834 100644
--- a/libphodav/phodav-method-put.c
+++ b/libphodav/phodav-method-put.c
@@ -31,7 +31,7 @@ method_put_finished (SoupMessage *msg,
 
 static void
 method_put_got_chunk (SoupMessage *msg,
-                      SoupBuffer  *chunk,
+                      GBytes      *chunk,
                       gpointer     user_data)
 {
   GFileOutputStream *output = user_data;
@@ -43,7 +43,7 @@ method_put_got_chunk (SoupMessage *msg,
   g_debug ("PUT got chunk");
 
   if (!g_output_stream_write_all (G_OUTPUT_STREAM (output),
-                                  chunk->data, chunk->length,
+                                  g_bytes_get_data (chunk, g_bytes_get_size (chunk)), g_bytes_get_size 
(chunk),
                                   &bytes_written, cancellable, &err))
     goto end;
 
@@ -64,7 +64,7 @@ put_start (SoupMessage *msg, GFile *file,
   GFileOutputStream *s = NULL;
   gchar *etag = NULL;
   gboolean created = TRUE;
-  SoupMessageHeaders *headers = msg->request_headers;
+  SoupMessageHeaders *headers = soup_message_get_request_headers (msg);
   gint status = SOUP_STATUS_INTERNAL_SERVER_ERROR;
 
   if (g_file_query_exists (file, cancellable))
@@ -95,11 +95,12 @@ phodav_method_put (PathHandler *handler, SoupMessage *msg, const gchar *path, GE
   GFile *file = NULL;
   GList *submitted = NULL;
   GFileOutputStream *output = NULL;
+  SoupMessageHeaders *request_headers = soup_message_get_request_headers (msg);
   gint status;
 
-  g_debug ("%s %s HTTP/1.%d %s %s", msg->method, path, soup_message_get_http_version (msg),
-           soup_message_headers_get_one (msg->request_headers, "X-Litmus") ? : "",
-           soup_message_headers_get_one (msg->request_headers, "X-Litmus-Second") ? : "");
+  g_debug ("%s %s HTTP/1.%d %s %s", soup_message_get_method (msg), path, soup_message_get_http_version (msg),
+           soup_message_headers_get_one (request_headers, "X-Litmus") ? : "",
+           soup_message_headers_get_one (request_headers, "X-Litmus-Second") ? : "");
 
   if (handler_get_readonly(handler))
     {
@@ -125,5 +126,5 @@ phodav_method_put (PathHandler *handler, SoupMessage *msg, const gchar *path, GE
 end:
   soup_message_set_status (msg, status);
   g_clear_object (&file);
-  g_debug ("  -> %d %s\n", msg->status_code, msg->reason_phrase);
+  g_debug ("  -> %d %s\n", soup_message_get_status (msg), soup_message_get_reason_phrase (msg));
 }
diff --git a/libphodav/phodav-method-unlock.c b/libphodav/phodav-method-unlock.c
index 8f51991..f144187 100644
--- a/libphodav/phodav-method-unlock.c
+++ b/libphodav/phodav-method-unlock.c
@@ -40,7 +40,7 @@ phodav_method_unlock (PathHandler *handler, SoupMessage *msg,
   gint status = SOUP_STATUS_BAD_REQUEST;
 
   gchar *token = remove_brackets (
-                                  soup_message_headers_get_one (msg->request_headers, "Lock-Token"));
+                                  soup_message_headers_get_one (soup_message_get_request_headers (msg), 
"Lock-Token"));
 
   g_return_val_if_fail (token != NULL, SOUP_STATUS_BAD_REQUEST);
 
diff --git a/libphodav/phodav-multistatus.c b/libphodav/phodav-multistatus.c
index 12a2594..f21f8d1 100644
--- a/libphodav/phodav-multistatus.c
+++ b/libphodav/phodav-multistatus.c
@@ -111,14 +111,14 @@ set_response_multistatus (SoupMessage *msg,
   while (g_hash_table_iter_next (&iter, (gpointer *) &path, (gpointer *) &resp))
     {
       xmlNodePtr response;
-      SoupURI *new_uri;
+      GUri *new_uri;
 
       response = xmlNewChild (root, ns, BAD_CAST "response", NULL);
-      new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), path);
+      // FIXMEnew_uri = g_uri_build (G_URI_FLAGS_NONE, soup_message_get_uri (msg), path);
       text = soup_uri_to_string (new_uri, FALSE);
       xmlNewChild (response, ns, BAD_CAST "href", BAD_CAST text);
       g_free (text);
-      soup_uri_free (new_uri);
+      g_uri_unref (new_uri);
 
       if (resp->props)
         add_propstat (response, ns, msg, path, resp->props);
diff --git a/libphodav/phodav-server.c b/libphodav/phodav-server.c
index b648ca9..382ec09 100644
--- a/libphodav/phodav-server.c
+++ b/libphodav/phodav-server.c
@@ -175,7 +175,7 @@ phodav_server_constructed (GObject *gobject)
 {
   PhodavServer *self = PHODAV_SERVER (gobject);
 
-  self->server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "PhodavServer ",
+  self->server = soup_server_new ("server-header", "PhodavServer ",
                                   NULL);
 
   update_root_handler (self);
@@ -448,11 +448,11 @@ got_headers (SoupMessage *msg,
              gpointer     user_data)
 {
   PhodavServer *self = user_data;
-  SoupURI *uri = soup_message_get_uri (msg);
-  const gchar *path = uri->path;
+  GUri *uri = soup_message_get_uri (msg);
+  const gchar *path = g_uri_get_path (uri);
   GError *err = NULL;
 
-  if (msg->method == SOUP_METHOD_PUT)
+  if (soup_message_get_method (msg) == SOUP_METHOD_PUT)
     phodav_method_put (self->root_handler, msg, path, &err);
 
   if (err)
@@ -481,19 +481,21 @@ server_callback (SoupServer *server, SoupMessage *msg,
   GError *err = NULL;
   PathHandler *handler = user_data;
   gint status = SOUP_STATUS_NOT_IMPLEMENTED;
-  SoupURI *uri = soup_message_get_uri (msg);
+  GUri *uri = soup_message_get_uri (msg);
+  const gchar *method = soup_message_get_method (msg);
+  SoupMessageHeaders *request_headers = soup_message_get_request_headers (msg);
   GHashTable *params;
 
-  g_debug ("%s %s HTTP/1.%d %s %s", msg->method, path, soup_message_get_http_version (msg),
-           soup_message_headers_get_one (msg->request_headers, "X-Litmus") ? : "",
-           soup_message_headers_get_one (msg->request_headers, "X-Litmus-Second") ? : "");
+  g_debug ("%s %s HTTP/1.%d %s %s", method, path, soup_message_get_http_version (msg),
+           soup_message_headers_get_one (request_headers, "X-Litmus") ? : "",
+           soup_message_headers_get_one (request_headers, "X-Litmus-Second") ? : "");
 
   if (!(path && *path == '/'))
     {
       g_debug ("path must begin with /");
       return;
     }
-  if (!(uri && uri->fragment == NULL))
+  if (!(uri && g_uri_get_fragment (uri) == NULL))
     {
       g_debug ("using fragments in query is not supported");
       return;
@@ -506,14 +508,14 @@ server_callback (SoupServer *server, SoupMessage *msg,
   g_hash_table_destroy (params);
 
   if (handler->self->readonly &&
-      (msg->method == SOUP_METHOD_PROPPATCH ||
-       msg->method == SOUP_METHOD_MKCOL ||
-       msg->method == SOUP_METHOD_DELETE ||
-       msg->method == SOUP_METHOD_MOVE ||
-       msg->method == SOUP_METHOD_COPY ||
-       msg->method == SOUP_METHOD_LOCK))
+      (method == SOUP_METHOD_PROPPATCH ||
+       method == SOUP_METHOD_MKCOL ||
+       method == SOUP_METHOD_DELETE ||
+       method == SOUP_METHOD_MOVE ||
+       method == SOUP_METHOD_COPY ||
+       method == SOUP_METHOD_LOCK))
       status = SOUP_STATUS_FORBIDDEN;
-  else if (msg->method == SOUP_METHOD_OPTIONS)
+  else if (method == SOUP_METHOD_OPTIONS)
     {
       soup_message_headers_append (msg->response_headers, "DAV", "1,2");
 
@@ -524,30 +526,30 @@ server_callback (SoupServer *server, SoupMessage *msg,
                                    "GET, HEAD, PUT, PROPFIND, PROPPATCH, MKCOL, DELETE, MOVE, COPY, LOCK, 
UNLOCK");
       status = SOUP_STATUS_OK;
     }
-  else if (msg->method == SOUP_METHOD_GET ||
-           msg->method == SOUP_METHOD_HEAD)
+  else if (method == SOUP_METHOD_GET ||
+           method == SOUP_METHOD_HEAD)
     status = phodav_method_get (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_PROPFIND)
+  else if (method == SOUP_METHOD_PROPFIND)
     status = phodav_method_propfind (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_PROPPATCH)
+  else if (method == SOUP_METHOD_PROPPATCH)
     status = phodav_method_proppatch (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_MKCOL)
+  else if (method == SOUP_METHOD_MKCOL)
     status = phodav_method_mkcol (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_DELETE)
+  else if (method == SOUP_METHOD_DELETE)
     status = phodav_method_delete (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_MOVE ||
-           msg->method == SOUP_METHOD_COPY)
+  else if (method == SOUP_METHOD_MOVE ||
+           method == SOUP_METHOD_COPY)
     status = phodav_method_movecopy (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_LOCK)
+  else if (method == SOUP_METHOD_LOCK)
     status = phodav_method_lock (handler, msg, path, &err);
-  else if (msg->method == SOUP_METHOD_UNLOCK)
+  else if (method == SOUP_METHOD_UNLOCK)
     status = phodav_method_unlock (handler, msg, path, &err);
   else
     g_warn_if_reached ();
 
   soup_message_set_status (msg, status);
 
-  g_debug ("  -> %d %s\n", msg->status_code, msg->reason_phrase);
+  g_debug ("  -> %d %s\n", soup_message_get_status (msg), soup_message_get_reason_phrase (msg));
   if (err)
     {
       g_warning ("error: %s", err->message);
diff --git a/libphodav/phodav-utils.c b/libphodav/phodav-utils.c
index 9362c30..f46c5d7 100644
--- a/libphodav/phodav-utils.c
+++ b/libphodav/phodav-utils.c
@@ -82,7 +82,7 @@ davdoc_parse (DavDoc *dd, SoupMessage *msg, SoupMessageBody *body,
 {
   xmlDocPtr doc;
   xmlNodePtr root;
-  SoupURI *uri;
+  GUri *uri;
 
   doc = parse_xml (body->data, body->length, &root, name);
   if (!doc)
@@ -93,7 +93,7 @@ davdoc_parse (DavDoc *dd, SoupMessage *msg, SoupMessageBody *body,
   dd->doc = doc;
   dd->root = root;
   dd->target = uri;
-  dd->path = g_uri_unescape_string (uri->path, "/");
+  dd->path = g_uri_unescape_string (g_uri_get_path (uri), "/");
 
   return TRUE;
 }
diff --git a/libphodav/phodav-utils.h b/libphodav/phodav-utils.h
index 1cbfd26..4d39e24 100644
--- a/libphodav/phodav-utils.h
+++ b/libphodav/phodav-utils.h
@@ -35,7 +35,7 @@ struct _DavDoc
   xmlDocPtr  doc;
   xmlNodePtr root;
 
-  SoupURI   *target;
+  GUri      *target;
   char      *path;
 };
 
diff --git a/meson.build b/meson.build
index b8ff125..517e654 100644
--- a/meson.build
+++ b/meson.build
@@ -34,7 +34,7 @@ else
   deps += dependency('gio-unix-2.0', version : '>= 2.44')
 endif
 
-deps += dependency('libsoup-2.4', version : '>= 2.48.0')
+deps += dependency('libsoup-3.0')
 deps += dependency('libxml-2.0')
 
 d1 = dependency('avahi-gobject', required : get_option('avahi'))
diff --git a/tests/virtual-dir.c b/tests/virtual-dir.c
index 7273b49..0a3e1b3 100644
--- a/tests/virtual-dir.c
+++ b/tests/virtual-dir.c
@@ -43,7 +43,7 @@ test_generic (gconstpointer data)
   if (test->method == SOUP_METHOD_COPY)
     {
       gchar *dest_uri = g_build_path ("/", SERVER_URI, test->destination, NULL);
-      soup_message_headers_append (msg->request_headers, "Destination", dest_uri);
+      soup_message_headers_append (soup_message_get_request_headers (msg), "Destination", dest_uri);
       g_free (dest_uri);
     }
 
@@ -55,7 +55,7 @@ test_generic (gconstpointer data)
 
   GInputStream *in = soup_session_send (session, msg, NULL, NULL);
 
-  g_assert_cmpint (msg->status_code, ==, test->status_code);
+  g_assert_cmpint (soup_message_get_status (msg), ==, soup_message_get_status (test));
 
   g_object_unref (in);
   g_object_unref (msg);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]