Skip to content

Commit

Permalink
Merge branch '5.x' into 7.x
Browse files Browse the repository at this point in the history
  • Loading branch information
fvennetier committed Oct 19, 2020
2 parents 68f770b + 2b85717 commit 9fd9644
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 87 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (NOT DEFINED OIOSDS_RELEASE)
set(OIOSDS_RELEASE master)
endif ()
if (NOT DEFINED OIOSDS_PROJECT_VERSION_SHORT)
set(OIOSDS_PROJECT_VERSION_SHORT "7.0")
set(OIOSDS_PROJECT_VERSION_SHORT "7.1")
endif ()

set(OIOSDS_PROJECT_VERSION "${OIOSDS_RELEASE}/${OIOSDS_PROJECT_VERSION_SHORT}")
Expand Down
27 changes: 12 additions & 15 deletions core/sds.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ License along with this library.

struct oio_sds_s
{
gchar *session_id;
gchar *ns;
gchar *proxy;
gchar *ecd; // Erasure Coding Daemon
Expand Down Expand Up @@ -478,7 +477,6 @@ oio_sds_init (struct oio_sds_s **out, const char *ns)
EXTRA_ASSERT (out != NULL);
EXTRA_ASSERT (ns != NULL);
*out = g_slice_new0 (struct oio_sds_s);
(*out)->session_id = g_strdup(oio_ext_get_reqid());
(*out)->ns = g_strdup (ns);
(*out)->proxy = oio_cfg_get_proxy_containers (ns);
(*out)->ecd = oio_cfg_get_ecd(ns);
Expand All @@ -495,7 +493,6 @@ void
oio_sds_free (struct oio_sds_s *sds)
{
if (!sds) return;
oio_str_clean (&sds->session_id);
oio_str_clean (&sds->ns);
oio_str_clean (&sds->proxy);
oio_str_clean(&sds->ecd);
Expand Down Expand Up @@ -1138,7 +1135,7 @@ oio_sds_download (struct oio_sds_s *sds, struct oio_sds_dl_src_s *dl,
{
if (!sds || !dl || !snk || !dl->url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("DL-");
oio_ext_set_admin (sds->admin);

snk->out_size = 0;
Expand Down Expand Up @@ -1261,7 +1258,7 @@ oio_sds_upload_init (struct oio_sds_s *sds, struct oio_sds_ul_dst_s *dst)
return NULL;
}

oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("UL-");
oio_ext_set_admin (sds->admin);

struct oio_sds_ul_s *ul = g_malloc0 (sizeof(*ul));
Expand Down Expand Up @@ -2287,7 +2284,7 @@ oio_sds_list (struct oio_sds_s *sds, struct oio_sds_list_param_s *param,
return (struct oio_error_s*) BADREQ("Missing argument");
if (!oio_url_has_fq_container (param->url))
return (struct oio_error_s*) BADREQ("Partial URI");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("LST-");
oio_ext_set_admin (sds->admin);

GRID_DEBUG("LIST prefix %s marker %s end %s max %"G_GSIZE_FORMAT,
Expand Down Expand Up @@ -2421,7 +2418,7 @@ oio_sds_truncate (struct oio_sds_s *sds, struct oio_url_s *url, size_t size)
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("TRC-");

GError *err;
CURL_DO(sds, H, err = oio_proxy_call_content_truncate(H, url, size));
Expand All @@ -2433,7 +2430,7 @@ oio_sds_drain(struct oio_sds_s *sds, struct oio_url_s *url)
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid(sds->session_id);
oio_ext_set_prefixed_random_reqid("DRAIN-");

GError *err;
CURL_DO(sds, H, err = oio_proxy_call_content_drain(H, url));
Expand All @@ -2445,7 +2442,7 @@ oio_sds_delete (struct oio_sds_s *sds, struct oio_url_s *url)
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("DEL-");
oio_ext_set_admin (sds->admin);

GError *err;
Expand All @@ -2458,7 +2455,7 @@ oio_sds_delete_container (struct oio_sds_s *sds, struct oio_url_s *url)
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("DEL-");
oio_ext_set_admin (sds->admin);

GError *err;
Expand All @@ -2475,7 +2472,7 @@ oio_sds_show_content (struct oio_sds_s *sds, struct oio_url_s *url,
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("SHOW-");
oio_ext_set_admin (sds->admin);

GError *err = NULL;
Expand Down Expand Up @@ -2521,7 +2518,7 @@ oio_sds_has (struct oio_sds_s *sds, struct oio_url_s *url, int *phas)
{
if (!sds || !url || !phas)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("HAS-");
oio_ext_set_admin (sds->admin);
GError *err;
CURL_DO(sds, H, err = oio_proxy_call_content_show (H, url, NULL, NULL));
Expand All @@ -2538,7 +2535,7 @@ _oio_sds_get_properties(struct oio_sds_s *sds, struct oio_url_s *url,
{
if (!sds || !url)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("PROPS-");
oio_ext_set_admin (sds->admin);

GString *value = NULL;
Expand Down Expand Up @@ -2577,7 +2574,7 @@ oio_sds_set_container_properties (struct oio_sds_s *sds, struct oio_url_s *url,
{
if (!sds || !url || !values)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("PROPS-");
oio_ext_set_admin (sds->admin);

GError *err;
Expand All @@ -2599,7 +2596,7 @@ oio_sds_set_content_properties (struct oio_sds_s *sds, struct oio_url_s *url,
{
if (!sds || !url || !values)
return (struct oio_error_s*) BADREQ("Missing argument");
oio_ext_set_reqid (sds->session_id);
oio_ext_set_prefixed_random_reqid("SET-");
oio_ext_set_admin (sds->admin);

GError *err;
Expand Down
Loading

0 comments on commit 9fd9644

Please sign in to comment.