summaryrefslogtreecommitdiffstats
path: root/src/libknot/control/control.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:07 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-12 04:45:07 +0000
commit0335817ced71e8355806ea0445aa3b105a22364c (patch)
treedffe735f2668a4728d8567feaf7ccb2d73076bac /src/libknot/control/control.c
parentAdding upstream version 3.3.9. (diff)
downloadknot-0335817ced71e8355806ea0445aa3b105a22364c.tar.xz
knot-0335817ced71e8355806ea0445aa3b105a22364c.zip
Adding upstream version 3.4.0.upstream/3.4.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/libknot/control/control.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/libknot/control/control.c b/src/libknot/control/control.c
index 671896f..8cddd5d 100644
--- a/src/libknot/control/control.c
+++ b/src/libknot/control/control.c
@@ -36,9 +36,6 @@
#define CTL_BUFF_SIZE (256 * 1024)
#endif
-/*! Listen backlog size. */
-#define DEFAULT_LISTEN_BACKLOG 5
-
/*! Default socket operations timeout in milliseconds. */
#define DEFAULT_TIMEOUT (30 * 1000)
@@ -166,6 +163,18 @@ knot_ctl_t* knot_ctl_alloc(void)
}
_public_
+knot_ctl_t* knot_ctl_clone(knot_ctl_t *ctx)
+{
+ knot_ctl_t *res = knot_ctl_alloc();
+ if (res != NULL) {
+ res->timeout = ctx->timeout;
+ res->sock = ctx->sock;
+ ctx->sock = -1;
+ }
+ return res;
+}
+
+_public_
void knot_ctl_free(knot_ctl_t *ctx)
{
if (ctx == NULL) {
@@ -194,13 +203,7 @@ void knot_ctl_set_timeout(knot_ctl_t *ctx, int timeout_ms)
}
_public_
-int knot_ctl_bind(knot_ctl_t *ctx, const char *path)
-{
- return knot_ctl_bind2(ctx, path, DEFAULT_LISTEN_BACKLOG);
-}
-
-_public_
-int knot_ctl_bind2(knot_ctl_t *ctx, const char *path, unsigned backlog)
+int knot_ctl_bind(knot_ctl_t *ctx, const char *path, unsigned backlog)
{
if (ctx == NULL || path == NULL) {
return KNOT_EINVAL;