]> code.delx.au - pulseaudio/blob - polyp/module-tunnel.c
renamed module-tunnel to module-tunnel-sink
[pulseaudio] / polyp / module-tunnel.c
1 /* $Id$ */
2
3 /***
4 This file is part of polypaudio.
5
6 polypaudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 2 of the License,
9 or (at your option) any later version.
10
11 polypaudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with polypaudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19 USA.
20 ***/
21
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <unistd.h>
27 #include <assert.h>
28 #include <string.h>
29 #include <errno.h>
30 #include <sys/types.h>
31 #include <regex.h>
32 #include <stdio.h>
33 #include <stdlib.h>
34
35 #include "module.h"
36 #include "util.h"
37 #include "modargs.h"
38 #include "log.h"
39 #include "subscribe.h"
40 #include "xmalloc.h"
41 #include "sink-input.h"
42 #include "pdispatch.h"
43 #include "pstream.h"
44 #include "pstream-util.h"
45 #include "authkey.h"
46 #include "socket-client.h"
47 #include "socket-util.h"
48
49 PA_MODULE_AUTHOR("Lennart Poettering")
50 PA_MODULE_VERSION(PACKAGE_VERSION)
51
52 #ifdef TUNNEL_SINK
53 PA_MODULE_DESCRIPTION("Tunnel module for sinks")
54 PA_MODULE_USAGE("server=<filename> sink=<remote sink name> cookie=<filename> format=<sample format> channels=<number of channels> rate=<sample rate> sink_name=<name for the local sink>")
55 #else
56 PA_MODULE_DESCRIPTION("Tunnel module for sources")
57 PA_MODULE_USAGE("server=<filename> source=<remote source name> cookie=<filename> format=<sample format> channels=<number of channels> rate=<sample rate> source_name=<name for the local source>")
58 #endif
59
60 #define DEFAULT_SINK_NAME "tunnel"
61 #define DEFAULT_SOURCE_NAME "tunnel"
62
63 #define DEFAULT_TLENGTH (44100*2*2/10) //(10240*8)
64 #define DEFAULT_MAXLENGTH ((DEFAULT_TLENGTH*3)/2)
65 #define DEFAULT_MINREQ 512
66 #define DEFAULT_PREBUF (DEFAULT_TLENGTH-DEFAULT_MINREQ)
67 #define DEFAULT_FRAGSIZE 1024
68
69 #define DEFAULT_TIMEOUT 5
70
71 #define LATENCY_INTERVAL 10
72
73 static const char* const valid_modargs[] = {
74 "server",
75 "cookie",
76 "format",
77 "channels",
78 "rate",
79 #ifdef TUNNEL_SINK
80 "sink_name",
81 "sink",
82 #else
83 "source_name",
84 "source",
85 #endif
86 NULL,
87 };
88
89 static void command_stream_killed(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata);
90
91 #ifdef TUNNEL_SINK
92 static void command_request(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata);
93 #endif
94
95 static const struct pa_pdispatch_command command_table[PA_COMMAND_MAX] = {
96 #ifdef TUNNEL_SINK
97 [PA_COMMAND_REQUEST] = { command_request },
98 #endif
99 [PA_COMMAND_PLAYBACK_STREAM_KILLED] = { command_stream_killed },
100 [PA_COMMAND_RECORD_STREAM_KILLED] = { command_stream_killed },
101 };
102
103 struct userdata {
104 struct pa_socket_client *client;
105 struct pa_pstream *pstream;
106 struct pa_pdispatch *pdispatch;
107
108 char *server_name;
109 #ifdef TUNNEL_SINK
110 char *sink_name;
111 struct pa_sink *sink;
112 uint32_t requested_bytes;
113 #else
114 char *source_name;
115 struct pa_source *source;
116 #endif
117
118 struct pa_module *module;
119 struct pa_core *core;
120
121 uint8_t auth_cookie[PA_NATIVE_COOKIE_LENGTH];
122
123 uint32_t ctag;
124 uint32_t device_index;
125 uint32_t channel;
126
127 pa_usec_t host_latency;
128
129 struct pa_time_event *time_event;
130 };
131
132
133 static void close_stuff(struct userdata *u) {
134 if (u->pstream) {
135 pa_pstream_close(u->pstream);
136 pa_pstream_unref(u->pstream);
137 u->pstream = NULL;
138 }
139
140 if (u->pdispatch) {
141 pa_pdispatch_unref(u->pdispatch);
142 u->pdispatch = NULL;
143 }
144
145 if (u->client) {
146 pa_socket_client_unref(u->client);
147 u->client = NULL;
148 }
149
150 #ifdef TUNNEL_SINK
151 if (u->sink) {
152 pa_sink_disconnect(u->sink);
153 pa_sink_unref(u->sink);
154 u->sink = NULL;
155 }
156 #else
157 if (u->source) {
158 pa_source_disconnect(u->source);
159 pa_source_unref(u->source);
160 u->source = NULL;
161 }
162 #endif
163
164 if (u->time_event) {
165 u->core->mainloop->time_free(u->time_event);
166 u->time_event = NULL;
167 }
168 }
169
170 static void die(struct userdata *u) {
171 assert(u);
172 close_stuff(u);
173 pa_module_unload_request(u->module);
174 }
175
176 static void command_stream_killed(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata) {
177 struct userdata *u = userdata;
178 assert(pd && t && u && u->pdispatch == pd);
179
180 pa_log(__FILE__": stream killed\n");
181 die(u);
182 }
183
184 #ifdef TUNNEL_SINK
185 static void send_prebuf_request(struct userdata *u) {
186 struct pa_tagstruct *t;
187
188 t = pa_tagstruct_new(NULL, 0);
189 pa_tagstruct_putu32(t, PA_COMMAND_PREBUF_PLAYBACK_STREAM);
190 pa_tagstruct_putu32(t, u->ctag++);
191 pa_tagstruct_putu32(t, u->channel);
192 pa_pstream_send_tagstruct(u->pstream, t);
193 }
194
195 static void send_bytes(struct userdata *u) {
196 assert(u);
197
198 if (!u->pstream)
199 return;
200
201 while (u->requested_bytes > 0) {
202 struct pa_memchunk chunk;
203 if (pa_sink_render(u->sink, u->requested_bytes, &chunk) < 0) {
204
205
206 if (u->requested_bytes >= DEFAULT_TLENGTH-DEFAULT_PREBUF)
207 send_prebuf_request(u);
208
209 return;
210 }
211
212 pa_pstream_send_memblock(u->pstream, u->channel, 0, &chunk);
213 pa_memblock_unref(chunk.memblock);
214
215 if (chunk.length > u->requested_bytes)
216 u->requested_bytes = 0;
217 else
218 u->requested_bytes -= chunk.length;
219 }
220 }
221
222 static void command_request(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata) {
223 struct userdata *u = userdata;
224 uint32_t bytes, channel;
225 assert(pd && command == PA_COMMAND_REQUEST && t && u && u->pdispatch == pd);
226
227 if (pa_tagstruct_getu32(t, &channel) < 0 ||
228 pa_tagstruct_getu32(t, &bytes) < 0 ||
229 !pa_tagstruct_eof(t)) {
230 pa_log(__FILE__": invalid protocol reply\n");
231 die(u);
232 return;
233 }
234
235 if (channel != u->channel) {
236 pa_log(__FILE__": recieved data for invalid channel\n");
237 die(u);
238 return;
239 }
240
241 u->requested_bytes += bytes;
242 send_bytes(u);
243 }
244
245 #endif
246
247 static void stream_get_latency_callback(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata) {
248 struct userdata *u = userdata;
249 pa_usec_t buffer_usec, sink_usec, source_usec, transport_usec;
250 int playing;
251 uint32_t queue_length;
252 struct timeval local, remote, now;
253 assert(pd && u && t);
254
255 if (command != PA_COMMAND_REPLY) {
256 if (command == PA_COMMAND_ERROR)
257 pa_log(__FILE__": failed to get latency.\n");
258 else
259 pa_log(__FILE__": protocol error.\n");
260 die(u);
261 return;
262 }
263
264 if (pa_tagstruct_get_usec(t, &buffer_usec) < 0 ||
265 pa_tagstruct_get_usec(t, &sink_usec) < 0 ||
266 pa_tagstruct_get_usec(t, &source_usec) < 0 ||
267 pa_tagstruct_get_boolean(t, &playing) < 0 ||
268 pa_tagstruct_getu32(t, &queue_length) < 0 ||
269 pa_tagstruct_get_timeval(t, &local) < 0 ||
270 pa_tagstruct_get_timeval(t, &remote) < 0 ||
271 !pa_tagstruct_eof(t)) {
272 pa_log(__FILE__": invalid reply.\n");
273 die(u);
274 return;
275 }
276
277 gettimeofday(&now, NULL);
278
279 if (pa_timeval_cmp(&local, &remote) < 0 && pa_timeval_cmp(&remote, &now)) {
280 /* local and remote seem to have synchronized clocks */
281 #ifdef TUNNEL_SINK
282 transport_usec = pa_timeval_diff(&remote, &local);
283 #else
284 transport_usec = pa_timeval_diff(&now, &remote);
285 #endif
286 } else
287 transport_usec = pa_timeval_diff(&now, &local)/2;
288
289 #ifdef TUNNEL_SINK
290 u->host_latency = sink_usec + transport_usec;
291 #else
292 u->host_latency = source_usec + transport_usec;
293 if (u->host_latency > sink_usec)
294 u->host_latency -= sink_usec;
295 else
296 u->host_latency = 0;
297 #endif
298
299 /* pa_log(__FILE__": estimated host latency: %0.0f usec\n", (double) u->host_latency); */
300 }
301
302 static void request_latency(struct userdata *u) {
303 struct pa_tagstruct *t;
304 struct timeval now;
305 uint32_t tag;
306 assert(u);
307
308 t = pa_tagstruct_new(NULL, 0);
309 #ifdef TUNNEL_SINK
310 pa_tagstruct_putu32(t, PA_COMMAND_GET_PLAYBACK_LATENCY);
311 #else
312 pa_tagstruct_putu32(t, PA_COMMAND_GET_RECORD_LATENCY);
313 #endif
314 pa_tagstruct_putu32(t, tag = u->ctag++);
315 pa_tagstruct_putu32(t, u->channel);
316
317 gettimeofday(&now, NULL);
318 pa_tagstruct_put_timeval(t, &now);
319
320 pa_pstream_send_tagstruct(u->pstream, t);
321 pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, stream_get_latency_callback, u);
322 }
323
324 static void create_stream_callback(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata) {
325 struct userdata *u = userdata;
326 assert(pd && u && u->pdispatch == pd);
327
328 if (command != PA_COMMAND_REPLY) {
329 if (command == PA_COMMAND_ERROR)
330 pa_log(__FILE__": failed to create stream.\n");
331 else
332 pa_log(__FILE__": protocol error.\n");
333 die(u);
334 return;
335 }
336
337 if (pa_tagstruct_getu32(t, &u->channel) < 0 ||
338 pa_tagstruct_getu32(t, &u->device_index) < 0 ||
339 #ifdef TUNNEL_SINK
340 pa_tagstruct_getu32(t, &u->requested_bytes) < 0 ||
341 #endif
342 !pa_tagstruct_eof(t)) {
343 pa_log(__FILE__": invalid reply.\n");
344 die(u);
345 return;
346 }
347
348 request_latency(u);
349 #ifdef TUNNEL_SINK
350 send_bytes(u);
351 #endif
352 }
353
354 static void setup_complete_callback(struct pa_pdispatch *pd, uint32_t command, uint32_t tag, struct pa_tagstruct *t, void *userdata) {
355 struct userdata *u = userdata;
356 struct pa_tagstruct *reply;
357 char name[256], un[128], hn[128];
358 assert(pd && u && u->pdispatch == pd);
359
360 if (command != PA_COMMAND_REPLY || !pa_tagstruct_eof(t)) {
361 if (command == PA_COMMAND_ERROR)
362 pa_log(__FILE__": failed to authenticate\n");
363 else
364 pa_log(__FILE__": protocol error.\n");
365 die(u);
366 return;
367 }
368 #ifdef TUNNEL_SINK
369 snprintf(name, sizeof(name), "Tunnel from host '%s', user '%s', sink '%s'",
370 pa_get_host_name(hn, sizeof(hn)),
371 pa_get_user_name(un, sizeof(un)),
372 u->sink->name);
373 #else
374 snprintf(name, sizeof(name), "Tunnel from host '%s', user '%s', source '%s'",
375 pa_get_host_name(hn, sizeof(hn)),
376 pa_get_user_name(un, sizeof(un)),
377 u->source->name);
378 #endif
379
380 reply = pa_tagstruct_new(NULL, 0);
381 pa_tagstruct_putu32(reply, PA_COMMAND_SET_CLIENT_NAME);
382 pa_tagstruct_putu32(reply, tag = u->ctag++);
383 pa_tagstruct_puts(reply, name);
384 pa_pstream_send_tagstruct(u->pstream, reply);
385 /* We ignore the server's reply here */
386
387 reply = pa_tagstruct_new(NULL, 0);
388 #ifdef TUNNEL_SINK
389 pa_tagstruct_putu32(reply, PA_COMMAND_CREATE_PLAYBACK_STREAM);
390 pa_tagstruct_putu32(reply, tag = u->ctag++);
391 pa_tagstruct_puts(reply, name);
392 pa_tagstruct_put_sample_spec(reply, &u->sink->sample_spec);
393 pa_tagstruct_putu32(reply, PA_INVALID_INDEX);
394 pa_tagstruct_puts(reply, u->sink_name);
395 pa_tagstruct_putu32(reply, DEFAULT_MAXLENGTH);
396 pa_tagstruct_put_boolean(reply, 0);
397 pa_tagstruct_putu32(reply, DEFAULT_TLENGTH);
398 pa_tagstruct_putu32(reply, DEFAULT_PREBUF);
399 pa_tagstruct_putu32(reply, DEFAULT_MINREQ);
400 pa_tagstruct_putu32(reply, PA_VOLUME_NORM);
401 #else
402 pa_tagstruct_putu32(reply, PA_COMMAND_CREATE_RECORD_STREAM);
403 pa_tagstruct_putu32(reply, tag = u->ctag++);
404 pa_tagstruct_puts(reply, name);
405 pa_tagstruct_put_sample_spec(reply, &u->source->sample_spec);
406 pa_tagstruct_putu32(reply, PA_INVALID_INDEX);
407 pa_tagstruct_puts(reply, u->source_name);
408 pa_tagstruct_putu32(reply, DEFAULT_MAXLENGTH);
409 pa_tagstruct_put_boolean(reply, 0);
410 pa_tagstruct_putu32(reply, DEFAULT_FRAGSIZE);
411 #endif
412
413 pa_pstream_send_tagstruct(u->pstream, reply);
414 pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, create_stream_callback, u);
415 }
416
417 static void pstream_die_callback(struct pa_pstream *p, void *userdata) {
418 struct userdata *u = userdata;
419 assert(p && u);
420
421 pa_log(__FILE__": stream died.\n");
422 die(u);
423 }
424
425
426 static void pstream_packet_callback(struct pa_pstream *p, struct pa_packet *packet, void *userdata) {
427 struct userdata *u = userdata;
428 assert(p && packet && u);
429
430 if (pa_pdispatch_run(u->pdispatch, packet, u) < 0) {
431 pa_log(__FILE__": invalid packet\n");
432 die(u);
433 }
434 }
435
436 #ifndef TUNNEL_SINK
437 static void pstream_memblock_callback(struct pa_pstream *p, uint32_t channel, uint32_t delta, const struct pa_memchunk *chunk, void *userdata) {
438 struct userdata *u = userdata;
439 assert(p && chunk && u);
440
441 if (channel != u->channel) {
442 pa_log(__FILE__": recieved memory block on bad channel.\n");
443 die(u);
444 return;
445 }
446
447 pa_source_post(u->source, chunk);
448 }
449 #endif
450
451 static void on_connection(struct pa_socket_client *sc, struct pa_iochannel *io, void *userdata) {
452 struct userdata *u = userdata;
453 struct pa_tagstruct *t;
454 uint32_t tag;
455 assert(sc && u && u->client == sc);
456
457 pa_socket_client_unref(u->client);
458 u->client = NULL;
459
460 if (!io) {
461 pa_log(__FILE__": connection failed.\n");
462 pa_module_unload_request(u->module);
463 return;
464 }
465
466 u->pstream = pa_pstream_new(u->core->mainloop, io, u->core->memblock_stat);
467 u->pdispatch = pa_pdispatch_new(u->core->mainloop, command_table, PA_COMMAND_MAX);
468
469 pa_pstream_set_die_callback(u->pstream, pstream_die_callback, u);
470 pa_pstream_set_recieve_packet_callback(u->pstream, pstream_packet_callback, u);
471 #ifndef TUNNEL_SINK
472 pa_pstream_set_recieve_memblock_callback(u->pstream, pstream_memblock_callback, u);
473 #endif
474
475 t = pa_tagstruct_new(NULL, 0);
476 pa_tagstruct_putu32(t, PA_COMMAND_AUTH);
477 pa_tagstruct_putu32(t, tag = u->ctag++);
478 pa_tagstruct_put_arbitrary(t, u->auth_cookie, sizeof(u->auth_cookie));
479 pa_pstream_send_tagstruct(u->pstream, t);
480 pa_pdispatch_register_reply(u->pdispatch, tag, DEFAULT_TIMEOUT, setup_complete_callback, u);
481
482 }
483
484 #ifdef TUNNEL_SINK
485 static void sink_notify(struct pa_sink*sink) {
486 struct userdata *u;
487 assert(sink && sink->userdata);
488 u = sink->userdata;
489
490 send_bytes(u);
491 }
492
493 static pa_usec_t sink_get_latency(struct pa_sink *sink) {
494 struct userdata *u;
495 uint32_t l;
496 pa_usec_t usec = 0;
497 assert(sink && sink->userdata);
498 u = sink->userdata;
499
500 l = DEFAULT_TLENGTH;
501
502 if (l > u->requested_bytes) {
503 l -= u->requested_bytes;
504 usec += pa_bytes_to_usec(l, &u->sink->sample_spec);
505 }
506
507 usec += u->host_latency;
508
509 return usec;
510 }
511 #else
512 static pa_usec_t source_get_latency(struct pa_source *source) {
513 struct userdata *u;
514 assert(source && source->userdata);
515 u = source->userdata;
516
517 return u->host_latency;
518 }
519 #endif
520
521 static void timeout_callback(struct pa_mainloop_api *m, struct pa_time_event*e, const struct timeval *tv, void *userdata) {
522 struct userdata *u = userdata;
523 struct timeval ntv;
524 assert(m && e && u);
525
526 request_latency(u);
527
528 gettimeofday(&ntv, NULL);
529 ntv.tv_sec += LATENCY_INTERVAL;
530 m->time_restart(e, &ntv);
531 }
532
533 int pa__init(struct pa_core *c, struct pa_module*m) {
534 struct pa_modargs *ma = NULL;
535 struct userdata *u = NULL;
536 struct pa_sample_spec ss;
537 struct timeval ntv;
538 assert(c && m);
539
540 if (!(ma = pa_modargs_new(m->argument, valid_modargs))) {
541 pa_log(__FILE__": failed to parse module arguments\n");
542 goto fail;
543 }
544
545 u = pa_xmalloc(sizeof(struct userdata));
546 m->userdata = u;
547 u->module = m;
548 u->core = c;
549 u->client = NULL;
550 u->pdispatch = NULL;
551 u->pstream = NULL;
552 u->server_name = NULL;
553 #ifdef TUNNEL_SINK
554 u->sink_name = pa_xstrdup(pa_modargs_get_value(ma, "sink", NULL));;
555 u->sink = NULL;
556 u->requested_bytes = 0;
557 #else
558 u->source_name = pa_xstrdup(pa_modargs_get_value(ma, "source", NULL));;
559 u->source = NULL;
560 #endif
561 u->ctag = 1;
562 u->device_index = u->channel = PA_INVALID_INDEX;
563 u->host_latency = 0;
564
565 if (pa_authkey_load_from_home(pa_modargs_get_value(ma, "cookie", PA_NATIVE_COOKIE_FILE), u->auth_cookie, sizeof(u->auth_cookie)) < 0) {
566 pa_log(__FILE__": failed to load cookie.\n");
567 goto fail;
568 }
569
570 if (!(u->server_name = pa_xstrdup(pa_modargs_get_value(ma, "server", NULL)))) {
571 pa_log(__FILE__": no server specified.\n");
572 goto fail;
573 }
574
575 ss = c->default_sample_spec;
576 if (pa_modargs_get_sample_spec(ma, &ss) < 0) {
577 pa_log(__FILE__": invalid sample format specification\n");
578 goto fail;
579 }
580
581 if (u->server_name[0] == '/')
582 u->client = pa_socket_client_new_unix(c->mainloop, u->server_name);
583 else {
584 size_t len;
585 struct sockaddr *sa;
586
587 if (!(sa = pa_resolve_server(u->server_name, &len, PA_NATIVE_DEFAULT_PORT))) {
588 pa_log(__FILE__": failed to resolve server '%s'\n", u->server_name);
589 goto fail;
590 }
591
592 u->client = pa_socket_client_new_sockaddr(c->mainloop, sa, len);
593 pa_xfree(sa);
594 }
595
596 if (!u->client)
597 goto fail;
598
599 pa_socket_client_set_callback(u->client, on_connection, u);
600
601 #ifdef TUNNEL_SINK
602 if (!(u->sink = pa_sink_new(c, pa_modargs_get_value(ma, "sink_name", DEFAULT_SINK_NAME), 0, &ss))) {
603 pa_log(__FILE__": failed to create sink.\n");
604 goto fail;
605 }
606
607 u->sink->notify = sink_notify;
608 u->sink->get_latency = sink_get_latency;
609 u->sink->userdata = u;
610 u->sink->description = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->sink_name ? u->sink_name : "", u->sink_name ? "@" : "", u->server_name);
611
612 pa_sink_set_owner(u->sink, m);
613 #else
614 if (!(u->source = pa_source_new(c, pa_modargs_get_value(ma, "source_name", DEFAULT_SOURCE_NAME), 0, &ss))) {
615 pa_log(__FILE__": failed to create source.\n");
616 goto fail;
617 }
618
619 u->source->get_latency = source_get_latency;
620 u->source->userdata = u;
621 u->source->description = pa_sprintf_malloc("Tunnel to '%s%s%s'", u->source_name ? u->source_name : "", u->source_name ? "@" : "", u->server_name);
622
623 pa_source_set_owner(u->source, m);
624 #endif
625
626 gettimeofday(&ntv, NULL);
627 ntv.tv_sec += LATENCY_INTERVAL;
628 u->time_event = c->mainloop->time_new(c->mainloop, &ntv, timeout_callback, u);
629
630 pa_modargs_free(ma);
631
632 return 0;
633
634 fail:
635 pa__done(c, m);
636
637 if (ma)
638 pa_modargs_free(ma);
639 return -1;
640 }
641
642 void pa__done(struct pa_core *c, struct pa_module*m) {
643 struct userdata* u;
644 assert(c && m);
645
646 if (!(u = m->userdata))
647 return;
648
649 close_stuff(u);
650
651 #ifdef TUNNEL_SINK
652 pa_xfree(u->sink_name);
653 #else
654 pa_xfree(u->source_name);
655 #endif
656 pa_xfree(u->server_name);
657
658 pa_xfree(u);
659 }
660
661