Changeset 833:7c11ae15df0d in roaraudio for libroar
- Timestamp:
- 09/27/08 01:21:03 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/socket.c
r832 r833 599 599 int i; 600 600 int fh = -1; 601 int (* code)(int mode, int fh, char * host, int port) = NULL; 601 602 602 603 // TODO: change this so we support listen() proxys (ssh -R) … … 639 640 640 641 if ( !strcmp(proxy_type, "socks4a") ) { // for TOR, the only supported type at the moment 641 if ( roar_socket_open_socks4a(mode, fh, host, port) == -1 ) { 642 close(fh); 643 return -1; 644 } 645 646 return fh; 642 code = roar_socket_open_socks4a; 647 643 } else if ( !strcmp(proxy_type, "socks4d") ) { // DECnet 648 if ( roar_socket_open_socks4d(mode, fh, host, port) == -1 ) { 649 close(fh); 650 return -1; 651 } 652 653 return fh; 644 code = roar_socket_open_socks4d; 654 645 } else if ( !strcmp(proxy_type, "socks4") ) { // good old SOCKS4 655 if ( roar_socket_open_socks4(mode, fh, host, port) == -1 ) { 656 close(fh); 657 return -1; 658 } 659 660 return fh; 646 code = roar_socket_open_socks4; 661 647 } else if ( !strcmp(proxy_type, "http") ) { // HTTP CONNECT 662 if ( roar_socket_open_http(mode, fh, host, port) == -1 ) { 663 close(fh); 664 return -1; 665 } 666 667 return fh; 648 code = roar_socket_open_http; 668 649 } else { 669 650 return -1; // unknown type 670 651 } 652 653 if ( code != NULL ) { 654 if ( code(mode, fh, host, port) == -1 ) { 655 close(fh); 656 return -1; 657 } 658 659 return fh; 660 } 661 662 close(fh); 663 return -1; 671 664 } 672 665
Note: See TracChangeset
for help on using the changeset viewer.