Changeset 836:3b75dfb94212 in roaraudio for libroar/socket.c


Ignore:
Timestamp:
09/27/08 02:41:37 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

add support for user@host and user:pw@host syntax for proxy server names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroar/socket.c

    r835 r836  
    600600 int    fh = -1; 
    601601 char * user = NULL, * pw = NULL, * opts = NULL; 
     602 char * sep; 
    602603 static struct passwd * passwd; 
    603604 int (* code)(int mode, int fh, char * host, int port, char * user, char * pw, char * opts) = NULL; 
     
    636637 if ( proxy_addr == NULL ) 
    637638  return -1; 
     639 
     640 if ( (sep = strstr(proxy_addr, "@")) != NULL ) { 
     641  *sep = 0; 
     642  user = proxy_addr; 
     643  proxy_addr = sep+1; 
     644 
     645  if ( (sep = strstr(user, ":")) != NULL ) { 
     646   *sep = 0; 
     647   pw = sep+1; 
     648  } 
     649 } 
    638650 
    639651 for (i = 0; proxy_addr[i] != 0 && proxy_addr[i] != ':' && i < ROAR_SOCKET_MAX_HOSTNAMELEN; i++) 
Note: See TracChangeset for help on using the changeset viewer.