mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
* some commenting work
* add new field "read_only" to memory blocks * add new API function pa_context_get_server() * filter capture data through mcalign on client * make module-tunnel use pa_socket_client_new_string() instead of using pa_resolve_server() directly. * remove pa_resolve_server() * remove debug.h and replace it by a macro definition on the gcc command line * some strbuf cleanups * small fixes in pa_stream for cleanup when server dies * new CLI command "load-sample-dir-lazy" * send FQDN as part of server info * rework mcalign, this time with memory block merging * fix iochannel cleanup when connection dies * check getaddrinfo() results git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@286 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
f5f6605254
commit
0a2bbc528b
30 changed files with 636 additions and 273 deletions
|
|
@ -338,16 +338,24 @@ struct pa_socket_client* pa_socket_client_new_string(struct pa_mainloop_api *m,
|
|||
memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_family = kind == KIND_TCP4 ? AF_INET : (kind == KIND_TCP6 ? AF_INET6 : AF_UNSPEC);
|
||||
|
||||
if (getaddrinfo(h, NULL, &hints, &res) < 0 || !res)
|
||||
if (getaddrinfo(h, NULL, &hints, &res) < 0 || !res || !res->ai_addr)
|
||||
return NULL;
|
||||
|
||||
if (res->ai_addr->sa_family == AF_INET)
|
||||
if (res->ai_family == AF_INET) {
|
||||
if (res->ai_addrlen != sizeof(struct sockaddr_in))
|
||||
return NULL;
|
||||
assert(res->ai_addr->sa_family == res->ai_family);
|
||||
|
||||
((struct sockaddr_in*) res->ai_addr)->sin_port = htons(port);
|
||||
else if (res->ai_addr->sa_family == AF_INET6)
|
||||
} else if (res->ai_family == AF_INET6) {
|
||||
if (res->ai_addrlen != sizeof(struct sockaddr_in6))
|
||||
return NULL;
|
||||
assert(res->ai_addr->sa_family == res->ai_family);
|
||||
|
||||
((struct sockaddr_in6*) res->ai_addr)->sin6_port = htons(port);
|
||||
else
|
||||
} else
|
||||
return NULL;
|
||||
|
||||
|
||||
c = pa_socket_client_new_sockaddr(m, res->ai_addr, res->ai_addrlen);
|
||||
freeaddrinfo(res);
|
||||
return c;
|
||||
|
|
@ -360,6 +368,9 @@ struct pa_socket_client* pa_socket_client_new_string(struct pa_mainloop_api *m,
|
|||
|
||||
}
|
||||
|
||||
/* Return non-zero when the target sockaddr is considered
|
||||
local. "local" means UNIX socket or TCP socket on localhost. Other
|
||||
local IP addresses are not considered local. */
|
||||
int pa_socket_client_is_local(struct pa_socket_client *c) {
|
||||
assert(c);
|
||||
return c->local;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue