~diwic/ubuntu/lucid/pulseaudio/bugfixes

« back to all changes in this revision

Viewing changes to src/pulsecore/socket-server.c

  • Committer: Bazaar Package Importer
  • Author(s): Sjoerd Simons
  • Date: 2009-07-28 14:00:27 UTC
  • mfrom: (1.5.1 upstream)
  • mto: (1.4.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 65.
  • Revision ID: james.westby@ubuntu.com-20090728140027-wts8ya37tyrh4ww5
Tags: upstream-0.9.16~test2~20090726git59659e1db
ImportĀ upstreamĀ versionĀ 0.9.16~test2~20090726git59659e1db

Show diffs side-by-side

added added

removed removed

Lines of Context:
467
467
                pa_snprintf(c, l, "tcp6:%s:%u", fqdn, (unsigned) ntohs(sa.sin6_port));
468
468
 
469
469
            } else if (memcmp(&in6addr_loopback, &sa.sin6_addr, sizeof(in6addr_loopback)) == 0) {
470
 
                char hn[256];
471
 
                if (!pa_get_host_name(hn, sizeof(hn)))
 
470
                char *id;
 
471
 
 
472
                if (!(id = pa_machine_id()))
472
473
                    return NULL;
473
474
 
474
 
                pa_snprintf(c, l, "{%s}tcp6:localhost:%u", hn, (unsigned) ntohs(sa.sin6_port));
 
475
                pa_snprintf(c, l, "{%s}tcp6:localhost:%u", id, (unsigned) ntohs(sa.sin6_port));
 
476
                pa_xfree(id);
475
477
            } else {
476
478
                char ip[INET6_ADDRSTRLEN];
477
479
 
503
505
 
504
506
                pa_snprintf(c, l, "tcp:%s:%u", fqdn, (unsigned) ntohs(sa.sin_port));
505
507
            } else if (sa.sin_addr.s_addr == INADDR_LOOPBACK) {
506
 
                char hn[256];
507
 
                if (!pa_get_host_name(hn, sizeof(hn)))
 
508
                char *id;
 
509
 
 
510
                if (!(id = pa_machine_id()))
508
511
                    return NULL;
509
512
 
510
 
                pa_snprintf(c, l, "{%s}tcp:localhost:%u", hn, (unsigned) ntohs(sa.sin_port));
 
513
                pa_snprintf(c, l, "{%s}tcp:localhost:%u", id, (unsigned) ntohs(sa.sin_port));
 
514
                pa_xfree(id);
511
515
            } else {
512
516
                char ip[INET_ADDRSTRLEN];
513
517
 
523
527
        }
524
528
 
525
529
        case SOCKET_SERVER_UNIX: {
526
 
            char hn[256];
 
530
            char *id;
527
531
 
528
532
            if (!s->filename)
529
533
                return NULL;
530
534
 
531
 
            if (!pa_get_host_name(hn, sizeof(hn)))
 
535
            if (!(id = pa_machine_id()))
532
536
                return NULL;
533
537
 
534
 
            pa_snprintf(c, l, "{%s}unix:%s", hn, s->filename);
 
538
            pa_snprintf(c, l, "{%s}unix:%s", id, s->filename);
 
539
            pa_xfree(id);
535
540
            return c;
536
541
        }
537
542