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
c426bbcf
Commit
c426bbcf
authored
Jul 28, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: moved struct client to client_internal.h
Prepare splitting client.c into several sources.
parent
6d71094c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
44 deletions
+70
-44
Makefile.am
Makefile.am
+1
-0
client.c
src/client.c
+1
-44
client_internal.h
src/client_internal.h
+68
-0
No files found.
Makefile.am
View file @
c426bbcf
...
...
@@ -87,6 +87,7 @@ mpd_headers = \
src/icy_server.h
\
src/icy_metadata.h
\
src/client.h
\
src/client_internal.h
\
src/listen.h
\
src/log.h
\
src/ls.h
\
...
...
src/client.c
View file @
c426bbcf
...
...
@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "client.h"
#include "client
_internal
.h"
#include "fifo_buffer.h"
#include "command.h"
#include "conf.h"
...
...
@@ -56,49 +56,6 @@ static int client_timeout;
static
size_t
client_max_command_list_size
;
static
size_t
client_max_output_buffer_size
;
struct
deferred_buffer
{
size_t
size
;
char
data
[
sizeof
(
long
)];
};
struct
client
{
GIOChannel
*
channel
;
guint
source_id
;
/** the buffer for reading lines from the #channel */
struct
fifo_buffer
*
input
;
unsigned
permission
;
/** the uid of the client process, or -1 if unknown */
int
uid
;
/**
* How long since the last activity from this client?
*/
GTimer
*
last_activity
;
GSList
*
cmd_list
;
/* for when in list mode */
int
cmd_list_OK
;
/* print OK after each command execution */
size_t
cmd_list_size
;
/* mem cmd_list consumes */
GQueue
*
deferred_send
;
/* for output if client is slow */
size_t
deferred_bytes
;
/* mem deferred_send consumes */
unsigned
int
num
;
/* client number */
char
send_buf
[
4096
];
size_t
send_buf_used
;
/* bytes used this instance */
/** is this client waiting for an "idle" response? */
bool
idle_waiting
;
/** idle flags pending on this client, to be sent as soon as
the client enters "idle" */
unsigned
idle_flags
;
/** idle flags that the client wants to receive */
unsigned
idle_subscriptions
;
};
static
GList
*
clients
;
static
unsigned
num_clients
;
static
guint
expire_source_id
;
...
...
src/client_internal.h
0 → 100644
View file @
c426bbcf
/*
* Copyright (C) 2003-2009 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_CLIENT_INTERNAL_H
#define MPD_CLIENT_INTERNAL_H
#include "client.h"
struct
deferred_buffer
{
size_t
size
;
char
data
[
sizeof
(
long
)];
};
struct
client
{
GIOChannel
*
channel
;
guint
source_id
;
/** the buffer for reading lines from the #channel */
struct
fifo_buffer
*
input
;
unsigned
permission
;
/** the uid of the client process, or -1 if unknown */
int
uid
;
/**
* How long since the last activity from this client?
*/
GTimer
*
last_activity
;
GSList
*
cmd_list
;
/* for when in list mode */
int
cmd_list_OK
;
/* print OK after each command execution */
size_t
cmd_list_size
;
/* mem cmd_list consumes */
GQueue
*
deferred_send
;
/* for output if client is slow */
size_t
deferred_bytes
;
/* mem deferred_send consumes */
unsigned
int
num
;
/* client number */
char
send_buf
[
4096
];
size_t
send_buf_used
;
/* bytes used this instance */
/** is this client waiting for an "idle" response? */
bool
idle_waiting
;
/** idle flags pending on this client, to be sent as soon as
the client enters "idle" */
unsigned
idle_flags
;
/** idle flags that the client wants to receive */
unsigned
idle_subscriptions
;
};
#endif
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