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
42b08abe
Commit
42b08abe
authored
Nov 14, 2004
by
Warren Dukes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a few bugs in read()'ing
git-svn-id:
https://svn.musicpd.org/mpd/trunk@2650
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
86afc13c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
interface.c
src/interface.c
+9
-8
No files found.
src/interface.c
View file @
42b08abe
...
...
@@ -43,13 +43,13 @@
#define GREETING "OK MPD"
#define INTERFACE_MAX_BUFFER_LENGTH
MAXPATHLEN+1024
#define INTERFACE_LIST_MODE_BEGIN "command_list_begin"
#define INTERFACE_LIST_OK_MODE_BEGIN "command_list_ok_begin"
#define INTERFACE_LIST_MODE_END "command_list_end"
#define INTERFACE_DEFAULT_OUT_BUFFER_SIZE
4096
#define INTERFACE_TIMEOUT_DEFAULT
60
#define INTERFACE_MAX_CONNECTIONS_DEFAULT
10
#define INTERFACE_MAX_BUFFER_LENGTH
(40960)
#define INTERFACE_LIST_MODE_BEGIN
"command_list_begin"
#define INTERFACE_LIST_OK_MODE_BEGIN
"command_list_ok_begin"
#define INTERFACE_LIST_MODE_END
"command_list_end"
#define INTERFACE_DEFAULT_OUT_BUFFER_SIZE
(4096)
#define INTERFACE_TIMEOUT_DEFAULT
(60)
#define INTERFACE_MAX_CONNECTIONS_DEFAULT
(10)
#define INTERFACE_MAX_COMMAND_LIST_DEFAULT (2048*1024)
#define INTERFACE_MAX_OUTPUT_BUFFER_SIZE_DEFAULT (2048*1024)
...
...
@@ -309,6 +309,7 @@ static int processBytesRead(Interface * interface, int bytesRead) {
if
(
interface
->
bufferPos
==
0
)
{
ERROR
(
"interface %i: buffer overflow
\n
"
,
interface
->
num
);
closeInterface
(
interface
);
return
1
;
}
interface
->
bufferLength
-=
interface
->
bufferPos
;
...
...
@@ -325,7 +326,7 @@ static int processBytesRead(Interface * interface, int bytesRead) {
int
interfaceReadInput
(
Interface
*
interface
)
{
int
bytesRead
=
read
(
interface
->
fd
,
interface
->
buffer
+
interface
->
bufferLength
,
INTERFACE_MAX_BUFFER_LENGTH
-
interface
->
bufferLength
+
1
);
INTERFACE_MAX_BUFFER_LENGTH
-
interface
->
bufferLength
);
if
(
bytesRead
>
0
)
return
processBytesRead
(
interface
,
bytesRead
);
else
if
(
bytesRead
==
0
&&
errno
!=
EINTR
)
closeInterface
(
interface
);
...
...
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