Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Knot Resolver
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
142
Issues
142
List
Boards
Labels
Service Desk
Milestones
Merge Requests
9
Merge Requests
9
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Knot projects
Knot Resolver
Commits
49a868ec
Verified
Commit
49a868ec
authored
Sep 17, 2018
by
Grigorii Demidov
Committed by
Vladimír Čunát
Oct 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demon: fix lint errors
parent
e6abd28e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
+25
-25
daemon/session.c
daemon/session.c
+22
-22
daemon/session.h
daemon/session.h
+2
-2
daemon/worker.h
daemon/worker.h
+1
-1
No files found.
daemon/session.c
View file @
49a868ec
...
...
@@ -63,26 +63,26 @@ static void on_session_timer_close(uv_handle_t *timer)
}
}
void
session_free
(
struct
session
*
s
)
void
session_free
(
struct
session
*
s
ession
)
{
if
(
s
)
{
assert
(
s
->
tasks
.
len
==
0
&&
s
->
waiting
.
len
==
0
);
session_clear
(
s
);
free
(
s
);
if
(
s
ession
)
{
assert
(
s
ession
->
tasks
.
len
==
0
&&
session
->
waiting
.
len
==
0
);
session_clear
(
s
ession
);
free
(
s
ession
);
}
}
void
session_clear
(
struct
session
*
s
)
void
session_clear
(
struct
session
*
s
ession
)
{
assert
(
s
->
tasks
.
len
==
0
&&
s
->
waiting
.
len
==
0
);
if
(
s
->
handle
&&
s
->
handle
->
type
==
UV_TCP
)
{
free
(
s
->
wire_buf
);
assert
(
s
ession
->
tasks
.
len
==
0
&&
session
->
waiting
.
len
==
0
);
if
(
s
ession
->
handle
&&
session
->
handle
->
type
==
UV_TCP
)
{
free
(
s
ession
->
wire_buf
);
}
array_clear
(
s
->
tasks
);
array_clear
(
s
->
waiting
);
tls_free
(
s
->
tls_ctx
);
tls_client_ctx_free
(
s
->
tls_client_ctx
);
memset
(
s
,
0
,
sizeof
(
*
s
));
array_clear
(
s
ession
->
tasks
);
array_clear
(
s
ession
->
waiting
);
tls_free
(
s
ession
->
tls_ctx
);
tls_client_ctx_free
(
s
ession
->
tls_client_ctx
);
memset
(
s
ession
,
0
,
sizeof
(
*
session
));
}
struct
session
*
session_new
(
void
)
...
...
@@ -301,30 +301,30 @@ uv_handle_t *session_get_handle(struct session *session)
return
session
->
handle
;
}
int
session_set_handle
(
struct
session
*
session
,
uv_handle_t
*
h
)
int
session_set_handle
(
struct
session
*
session
,
uv_handle_t
*
h
andle
)
{
if
(
!
h
)
{
if
(
!
h
andle
)
{
return
kr_error
(
EINVAL
);
}
assert
(
session
->
handle
==
NULL
);
if
(
h
->
type
==
UV_TCP
)
{
if
(
h
andle
->
type
==
UV_TCP
)
{
uint8_t
*
wire_buf
=
malloc
(
KNOT_WIRE_MAX_PKTSIZE
);
if
(
!
wire_buf
)
{
return
kr_error
(
ENOMEM
);
}
session
->
wire_buf
=
wire_buf
;
session
->
wire_buf_size
=
KNOT_WIRE_MAX_PKTSIZE
;
}
else
if
(
h
->
type
==
UV_UDP
)
{
assert
(
h
->
loop
->
data
);
struct
worker_ctx
*
worker
=
h
->
loop
->
data
;
}
else
if
(
h
andle
->
type
==
UV_UDP
)
{
assert
(
h
andle
->
loop
->
data
);
struct
worker_ctx
*
worker
=
h
andle
->
loop
->
data
;
session
->
wire_buf
=
worker
->
wire_buf
;
session
->
wire_buf_size
=
sizeof
(
worker
->
wire_buf
);
}
session
->
handle
=
h
;
h
->
data
=
session
;
session
->
handle
=
h
andle
;
h
andle
->
data
=
session
;
return
kr_ok
();
}
...
...
daemon/session.h
View file @
49a868ec
...
...
@@ -27,9 +27,9 @@ struct session;
/* Allocate new session. */
struct
session
*
session_new
(
void
);
/* Clear and free given session. */
void
session_free
(
struct
session
*
s
);
void
session_free
(
struct
session
*
s
ession
);
/* Clear session. */
void
session_clear
(
struct
session
*
s
);
void
session_clear
(
struct
session
*
s
ession
);
/** Close session. */
void
session_close
(
struct
session
*
session
);
/** Start reading from underlying libuv IO handle. */
...
...
daemon/worker.h
View file @
49a868ec
...
...
@@ -47,7 +47,7 @@ int worker_submit(struct session *session, knot_pkt_t *query);
* End current DNS/TCP session, this disassociates pending tasks from this session
* which may be freely closed afterwards.
*/
int
worker_end_tcp
(
struct
session
*
s
);
int
worker_end_tcp
(
struct
session
*
s
ession
);
/**
* Start query resolution with given query.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment