comparison udp.c @ 1671:f695f8fc4a63 libavformat

The long awaited BeOS cleanup, phase 1.1: removed useless ifdef, changed check for net_server to IP_MULTICAST_TTL.
author mmu_man
date Thu, 18 Jan 2007 17:48:21 +0000
parents 92afee454599
children 818eafa8fc95
comparison
equal deleted inserted replaced
1670:92afee454599 1671:f695f8fc4a63
357 357
358 len = sizeof(my_addr1); 358 len = sizeof(my_addr1);
359 getsockname(udp_fd, (struct sockaddr *)&my_addr1, &len); 359 getsockname(udp_fd, (struct sockaddr *)&my_addr1, &len);
360 s->local_port = ntohs(my_addr1.sin_port); 360 s->local_port = ntohs(my_addr1.sin_port);
361 361
362 #ifndef CONFIG_BEOS_NETSERVER 362 #ifdef IP_MULTICAST_TTL
363 if (s->is_multicast) { 363 if (s->is_multicast) {
364 if (h->flags & URL_WRONLY) { 364 if (h->flags & URL_WRONLY) {
365 /* output */ 365 /* output */
366 if (setsockopt(udp_fd, IPPROTO_IP, IP_MULTICAST_TTL, 366 if (setsockopt(udp_fd, IPPROTO_IP, IP_MULTICAST_TTL,
367 &s->ttl, sizeof(s->ttl)) < 0) { 367 &s->ttl, sizeof(s->ttl)) < 0) {
385 if (s->is_multicast && !(h->flags & URL_WRONLY)) 385 if (s->is_multicast && !(h->flags & URL_WRONLY))
386 s->local_port = port; 386 s->local_port = port;
387 udp_fd = udp_ipv6_set_local(h); 387 udp_fd = udp_ipv6_set_local(h);
388 if (udp_fd < 0) 388 if (udp_fd < 0)
389 goto fail; 389 goto fail;
390 #ifndef CONFIG_BEOS_NETSERVER
391 if (s->is_multicast) { 390 if (s->is_multicast) {
392 if (h->flags & URL_WRONLY) { 391 if (h->flags & URL_WRONLY) {
393 if (udp_ipv6_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0) 392 if (udp_ipv6_set_multicast_ttl(udp_fd, s->ttl, (struct sockaddr *)&s->dest_addr) < 0)
394 goto fail; 393 goto fail;
395 } else { 394 } else {
396 if (udp_ipv6_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0) 395 if (udp_ipv6_join_multicast_group(udp_fd, (struct sockaddr *)&s->dest_addr) < 0)
397 goto fail; 396 goto fail;
398 } 397 }
399 } 398 }
400 #endif
401 #endif 399 #endif
402 400
403 if (is_output) { 401 if (is_output) {
404 /* limit the tx buf size to limit latency */ 402 /* limit the tx buf size to limit latency */
405 tmp = UDP_TX_BUF_SIZE; 403 tmp = UDP_TX_BUF_SIZE;