Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
a4a3fef0
Commit
a4a3fef0
authored
Mar 19, 2005
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup some debug code
git-svn-id:
https://svn.musicpd.org/mpd/trunk@3102
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
9193766c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
interface.c
src/interface.c
+11
-14
No files found.
src/interface.c
View file @
a4a3fef0
...
...
@@ -524,9 +524,17 @@ void closeOldInterfaces() {
int
i
;
for
(
i
=
0
;
i
<
interface_max_connections
;
i
++
)
{
if
(
interfaces
[
i
].
open
&&
(
interfaces
[
i
].
expired
||
(
time
(
NULL
)
-
interfaces
[
i
].
lastTime
>
interface_timeout
)))
{
DEBUG
(
"interface %i: timeout
\n
"
,
i
);
closeInterface
(
&
(
interfaces
[
i
]));
if
(
interfaces
[
i
].
open
)
{
if
(
interfaces
[
i
].
expired
)
{
DEBUG
(
"interface %i: expired
\n
"
,
i
);
closeInterface
(
&
(
interfaces
[
i
]));
}
else
if
(
time
(
NULL
)
-
interfaces
[
i
].
lastTime
>
interface_timeout
)
{
DEBUG
(
"interface %i: timeout
\n
"
,
i
);
closeInterface
(
&
(
interfaces
[
i
]));
}
}
}
}
...
...
@@ -629,15 +637,11 @@ void printInterfaceOutBuffer(Interface * interface) {
char
*
buffer
;
int
ret
;
DEBUG
(
"enter print interface out buffer
\n
"
);
if
(
!
interface
->
open
||
interface
->
expired
||
!
interface
->
outBuflen
)
{
DEBUG
(
"nothing todo, leaving
\n
"
);
return
;
}
if
(
interface
->
bufferList
)
{
DEBUG
(
"we have a bufferList
\n
"
);
interface
->
outputBufferSize
+=
sizeof
(
ListNode
);
interface
->
outputBufferSize
+=
interface
->
outBuflen
+
1
;
if
(
interface
->
outputBufferSize
>
...
...
@@ -662,12 +666,9 @@ void printInterfaceOutBuffer(Interface * interface) {
}
}
else
{
DEBUG
(
"no bufferList, just generic buffer
\n
"
);
DEBUG
(
"attempting to write
\n
"
);
if
((
ret
=
write
(
interface
->
fd
,
interface
->
outBuffer
,
interface
->
outBuflen
))
<
0
)
{
DEBUG
(
"write unsuccessful
\n
"
);
if
(
errno
==
EAGAIN
||
errno
==
EINTR
)
{
buffer
=
malloc
(
interface
->
outBuflen
+
1
);
memcpy
(
buffer
,
interface
->
outBuffer
,
...
...
@@ -685,7 +686,6 @@ void printInterfaceOutBuffer(Interface * interface) {
}
}
else
if
(
ret
<
interface
->
outBuflen
)
{
DEBUG
(
"returned less than outBufLen
\n
"
);
buffer
=
malloc
(
interface
->
outBuflen
-
ret
+
1
);
memcpy
(
buffer
,
interface
->
outBuffer
+
ret
,
interface
->
outBuflen
-
ret
);
...
...
@@ -702,10 +702,7 @@ void printInterfaceOutBuffer(Interface * interface) {
(
char
*
)
interface
->
bufferList
->
firstNode
->
data
)
+
1
;
}
DEBUG
(
"done writing
\n
"
);
}
interface
->
outBuflen
=
0
;
DEBUG
(
"leaving print interface out buffer
\n
"
);
}
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