PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
PulseAudio is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
or (at your option) any later version.
PulseAudio is distributed in the hope that it will be useful, but
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
#include <pulsecore/strbuf.h>
- if (c) {
- if (c->sc)
- pa_socket_client_unref(c->sc);
- if (c->ioline)
- pa_ioline_close(c->ioline);
- else if (c->io)
- pa_iochannel_free(c->io);
-
- pa_xfree(c->hostname);
- pa_xfree(c->url);
- pa_xfree(c->localip);
- pa_xfree(c->session);
- pa_xfree(c->transport);
- pa_xfree(c->last_header);
- if (c->header_buffer)
- pa_strbuf_free(c->header_buffer);
- if (c->response_headers)
- pa_headerlist_free(c->response_headers);
- pa_headerlist_free(c->headers);
- }
+ pa_assert(c);
+
+ if (c->sc)
+ pa_socket_client_unref(c->sc);
+ if (c->ioline)
+ pa_ioline_close(c->ioline);
+ else if (c->io)
+ pa_iochannel_free(c->io);
+
+ pa_xfree(c->hostname);
+ pa_xfree(c->url);
+ pa_xfree(c->localip);
+ pa_xfree(c->session);
+ pa_xfree(c->transport);
+ pa_xfree(c->last_header);
+ if (c->header_buffer)
+ pa_strbuf_free(c->header_buffer);
+ if (c->response_headers)
+ pa_headerlist_free(c->response_headers);
+ pa_headerlist_free(c->headers);
+
c->transport = pa_xstrdup(pa_headerlist_gets(c->response_headers, "Transport"));
if (!c->session || !c->transport) {
c->transport = pa_xstrdup(pa_headerlist_gets(c->response_headers, "Transport"));
if (!c->session || !c->transport) {
/* Call our callback */
c->callback(c, c->state, c->response_headers, c->userdata);
/* Call our callback */
c->callback(c, c->state, c->response_headers, c->userdata);
- if (!(c->sc = pa_socket_client_new_string(c->mainloop, c->hostname, c->port))) {
+ if (!(c->sc = pa_socket_client_new_string(c->mainloop, TRUE, c->hostname, c->port))) {