mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-05 13:29:57 -05:00
Tweak the printing of client connections a bit so that it's more apparent
what and who it is that's connecting. git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1014 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
7582f7493b
commit
9288479338
3 changed files with 10 additions and 3 deletions
|
|
@ -86,6 +86,9 @@ void pa_client_kill(pa_client *c) {
|
||||||
|
|
||||||
void pa_client_set_name(pa_client *c, const char *name) {
|
void pa_client_set_name(pa_client *c, const char *name) {
|
||||||
assert(c);
|
assert(c);
|
||||||
|
|
||||||
|
pa_log_info(__FILE__": client %u changed name from \"%s\" to \"%s\"", c->index, c->name, name);
|
||||||
|
|
||||||
pa_xfree(c->name);
|
pa_xfree(c->name);
|
||||||
c->name = pa_xstrdup(name);
|
c->name = pa_xstrdup(name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1139,7 +1139,7 @@ static void auth_timeout(pa_mainloop_api*m, pa_time_event *e, const struct timev
|
||||||
static void on_connection(pa_socket_server*s, pa_iochannel *io, void *userdata) {
|
static void on_connection(pa_socket_server*s, pa_iochannel *io, void *userdata) {
|
||||||
struct connection *c;
|
struct connection *c;
|
||||||
pa_protocol_esound *p = userdata;
|
pa_protocol_esound *p = userdata;
|
||||||
char cname[256];
|
char cname[256], pname[128];
|
||||||
assert(s && io && p);
|
assert(s && io && p);
|
||||||
|
|
||||||
if (pa_idxset_size(p->connections)+1 > MAX_CONNECTIONS) {
|
if (pa_idxset_size(p->connections)+1 > MAX_CONNECTIONS) {
|
||||||
|
|
@ -1153,7 +1153,8 @@ static void on_connection(pa_socket_server*s, pa_iochannel *io, void *userdata)
|
||||||
c->io = io;
|
c->io = io;
|
||||||
pa_iochannel_set_callback(c->io, io_callback, c);
|
pa_iochannel_set_callback(c->io, io_callback, c);
|
||||||
|
|
||||||
pa_iochannel_socket_peer_to_string(io, cname, sizeof(cname));
|
pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
|
||||||
|
snprintf(cname, sizeof(cname), "EsounD client (%s)", pname);
|
||||||
assert(p->core);
|
assert(p->core);
|
||||||
c->client = pa_client_new(p->core, __FILE__, cname);
|
c->client = pa_client_new(p->core, __FILE__, cname);
|
||||||
assert(c->client);
|
assert(c->client);
|
||||||
|
|
|
||||||
|
|
@ -2213,6 +2213,7 @@ static void auth_timeout(pa_mainloop_api*m, pa_time_event *e, const struct timev
|
||||||
static void on_connection(PA_GCC_UNUSED pa_socket_server*s, pa_iochannel *io, void *userdata) {
|
static void on_connection(PA_GCC_UNUSED pa_socket_server*s, pa_iochannel *io, void *userdata) {
|
||||||
pa_protocol_native *p = userdata;
|
pa_protocol_native *p = userdata;
|
||||||
struct connection *c;
|
struct connection *c;
|
||||||
|
char cname[256], pname[128];
|
||||||
assert(io && p);
|
assert(io && p);
|
||||||
|
|
||||||
if (pa_idxset_size(p->connections)+1 > MAX_CONNECTIONS) {
|
if (pa_idxset_size(p->connections)+1 > MAX_CONNECTIONS) {
|
||||||
|
|
@ -2235,8 +2236,10 @@ static void on_connection(PA_GCC_UNUSED pa_socket_server*s, pa_iochannel *io, vo
|
||||||
|
|
||||||
c->version = 8;
|
c->version = 8;
|
||||||
c->protocol = p;
|
c->protocol = p;
|
||||||
|
pa_iochannel_socket_peer_to_string(io, pname, sizeof(pname));
|
||||||
|
snprintf(cname, sizeof(cname), "Native client (%s)", pname);
|
||||||
assert(p->core);
|
assert(p->core);
|
||||||
c->client = pa_client_new(p->core, __FILE__, "Client");
|
c->client = pa_client_new(p->core, __FILE__, cname);
|
||||||
assert(c->client);
|
assert(c->client);
|
||||||
c->client->kill = client_kill_cb;
|
c->client->kill = client_kill_cb;
|
||||||
c->client->userdata = c;
|
c->client->userdata = c;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue