Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap
Commits
e79ecf54
Commit
e79ecf54
authored
6 years ago
by
Anatolii Kurotych
Browse files
Options
Downloads
Patches
Plain Diff
[*] Remove abort. Fix crash
parent
9d942da8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
core/dap_circular_buffer.c
+14
-4
14 additions, 4 deletions
core/dap_circular_buffer.c
core/dap_circular_buffer.h
+1
-1
1 addition, 1 deletion
core/dap_circular_buffer.h
test/libdap-test
+1
-1
1 addition, 1 deletion
test/libdap-test
with
16 additions
and
6 deletions
core/dap_circular_buffer.c
+
14
−
4
View file @
e79ecf54
...
...
@@ -62,13 +62,13 @@ size_t circular_buffer_get_data_size(circular_buffer_t cBuf)
return
cBuf
->
dataSize
;
}
void
circular_buffer_push
(
circular_buffer_t
cBuf
,
void
*
src
,
size_t
length
)
void
circular_buffer_push
(
circular_buffer_t
cBuf
,
const
void
*
src
,
size_t
length
)
{
if
(
length
==
0
)
return
;
size_t
writableLen
=
length
;
void
*
pSrc
=
src
;
const
void
*
pSrc
=
src
;
if
(
writableLen
>
cBuf
->
capacity
)
//in case of size overflow
{
...
...
@@ -164,8 +164,18 @@ int circular_buffer_write_In_socket(circular_buffer_t cBuf, int sockfd)
{
if
(
cBuf
->
headOffset
+
cBuf
->
dataSize
<=
cBuf
->
capacity
)
{
log_it
(
L_CRITICAL
,
"We always trying write all data!"
);
abort
();
rdLen
=
send
(
sockfd
,
&
cBuf
->
buffer
[
cBuf
->
headOffset
],
cBuf
->
dataSize
,
MSG_DONTWAIT
|
MSG_NOSIGNAL
);
if
(
rdLen
<
0
)
{
log_it
(
L_ERROR
,
"Can't write data in socket. %s"
,
strerror
(
errno
));
return
-
1
;
}
cBuf
->
headOffset
+=
rdLen
;
if
(
cBuf
->
headOffset
==
cBuf
->
capacity
)
cBuf
->
headOffset
=
0
;
}
else
{
...
...
This diff is collapsed.
Click to expand it.
core/dap_circular_buffer.h
+
1
−
1
View file @
e79ecf54
...
...
@@ -34,7 +34,7 @@ extern size_t circular_buffer_get_capacity(circular_buffer_t cBuf);
extern
size_t
circular_buffer_get_data_size
(
circular_buffer_t
cBuf
);
// Push data to the tail of a circular buffer from 'src' with 'length' size in byte.
extern
void
circular_buffer_push
(
circular_buffer_t
cBuf
,
void
*
src
,
size_t
length
);
extern
void
circular_buffer_push
(
circular_buffer_t
cBuf
,
const
void
*
src
,
size_t
length
);
// Pop data from a circular buffer to 'dataOut' with wished 'length' size in byte,return the actual data size in byte popped out,which is less or equal to the input 'length parameter.
extern
size_t
circular_buffer_pop
(
circular_buffer_t
cBuf
,
size_t
length
,
void
*
dataOut
);
...
...
This diff is collapsed.
Click to expand it.
libdap-test
@
d40ba897
Compare
d2257789
...
d40ba897
Subproject commit d
2257789e0c796a5a3b637e14dcbaf8a8c7880cc
Subproject commit d
40ba8973440b7c712d5a64df03a312adcf7c2fd
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment