Changeset 838:7e78b8dfd899 in roaraudio for libroar/socket.c
- Timestamp:
- 09/27/08 02:51:36 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/socket.c
r837 r838 601 601 char * user = NULL, * pw = NULL, * opts = NULL; 602 602 char * sep; 603 int no_fh = 0; 603 604 static struct passwd * passwd; 604 605 int (* code)(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) = NULL; … … 633 634 if ( !strncmp(proxy_addr, "http://", 7) ) 634 635 proxy_addr += 7; 636 } else if ( !strncmp(proxy_type, "ssh", 3) ) { 637 proxy_port = 22; 638 proxy_addr = getenv("ssh_proxy"); 639 no_fh = 1; 635 640 } 636 641 … … 662 667 proxy_port = atoi(&proxy_addr[i+1]); 663 668 664 if ( (fh = roar_socket_open(mode, type, proxy_host, proxy_port)) == -1) { 665 return -1; 669 if ( ! no_fh ) { 670 if ( (fh = roar_socket_open(mode, type, proxy_host, proxy_port)) == -1) { 671 return -1; 672 } 666 673 } 667 674 … … 679 686 680 687 if ( code != NULL ) { 681 if ( code(mode, fh, host, port, user, pw, opts) == -1 ) { 682 close(fh); 683 return -1; 688 if ( no_fh ) { 689 fh = code(mode, fh, host, port, user, pw, opts); 690 } else { 691 if ( code(mode, fh, host, port, user, pw, opts) == -1 ) { 692 close(fh); 693 return -1; 694 } 684 695 } 685 696
Note: See TracChangeset
for help on using the changeset viewer.