diff --git a/services/capture/deltacast-bridge/fc_writer.c b/services/capture/deltacast-bridge/fc_writer.c index d0d8287..1644116 100644 --- a/services/capture/deltacast-bridge/fc_writer.c +++ b/services/capture/deltacast-bridge/fc_writer.c @@ -196,8 +196,15 @@ fc_writer_t *fc_writer_open(const char *fc_url, char resp[1024] = {0}; int status = http_request("POST", host, port, "/slots", body, resp, sizeof resp); - if (status != 201) { - fprintf(stderr, "[fc_writer:%s] POST /slots failed (HTTP %d): %s\n", + if (status == 409) { + /* Already exists, fetch slot details */ + char path[256]; + snprintf(path, sizeof path, "/slots/%s", slot_id); + status = http_request("GET", host, port, path, NULL, resp, sizeof resp); + } + + if (status != 200 && status != 201) { + fprintf(stderr, "[fc_writer:%s] POST/GET /slots failed (HTTP %d): %s\n", slot_id, status, resp); return NULL; }