Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/proxy.c

    r6f7ac17 raefaac3a  
    114114{
    115115        struct sockaddr_in *sin;
     116        struct sockaddr_in me;
    116117        int fd = -1;
    117118
     
    127128
    128129        sock_make_nonblocking(fd);
     130       
     131        if( global.conf->iface_out )
     132        {
     133                me.sin_family = AF_INET;
     134                me.sin_port = 0;
     135                me.sin_addr.s_addr = inet_addr( global.conf->iface_out );
     136               
     137                if( bind( fd, (struct sockaddr *) &me, sizeof( me ) ) != 0 )
     138                        event_debug( "bind( %d, \"%s\" ) failure\n", fd, global.conf->iface_out );
     139        }
    129140       
    130141        event_debug("proxy_connect_none( \"%s\", %d ) = %d\n", host, port, fd);
     
    530541        struct PHB *phb;
    531542       
    532         if (!host || !port || (port == -1) || !func || strlen(host) > 128) {
     543        if (!host || port <= 0 || !func || strlen(host) > 128) {
    533544                return -1;
    534545        }
     
    538549        phb->data = data;
    539550       
    540         if ((proxytype == PROXY_NONE) || strlen(proxyhost) > 0 || !proxyport || (proxyport == -1))
     551        if (proxytype == PROXY_NONE || !proxyhost[0] || proxyport <= 0)
    541552                return proxy_connect_none(host, port, phb);
    542553        else if (proxytype == PROXY_HTTP)
Note: See TracChangeset for help on using the changeset viewer.