~ubuntu-branches/ubuntu/hardy/steam/hardy

« back to all changes in this revision

Viewing changes to server/net/port/xmlrpc.pike

  • Committer: Bazaar Package Importer
  • Author(s): Alain Schroeder
  • Date: 2006-11-21 16:03:12 UTC
  • mfrom: (2.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061121160312-nf96y6nihzsyd2uv
Tags: 2.2.31-3
Add patch to prevent inconsistent data after shutdown.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *  along with this program; if not, write to the Free Software
15
15
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
16
 * 
17
 
 * $Id: xmlrpc.pike,v 1.1.1.1 2005/02/23 14:47:21 cvs Exp $
 
17
 * $Id: xmlrpc.pike,v 1.1.1.1 2006/03/27 12:40:18 exodusd Exp $
18
18
 */
19
19
 
20
 
constant cvs_version="$Id: xmlrpc.pike,v 1.1.1.1 2005/02/23 14:47:21 cvs Exp $";
 
20
constant cvs_version="$Id: xmlrpc.pike,v 1.1.1.1 2006/03/27 12:40:18 exodusd Exp $";
21
21
 
22
22
inherit Stdio.Port;
23
23
 
57
57
    if (  port_nr == 0 )
58
58
        port_nr = 2004; //23; must be root ?!
59
59
 
60
 
    if ( !bind(port_nr, setup_port) ) {
61
 
        werror("Failed to open xmlrpc socket !\n");
62
 
        return false;
 
60
    string ip = _Server->query_config("ip");
 
61
    if ( ! stringp(ip) || sizeof(ip)==0 ) ip = 0;
 
62
    if ( !bind(port_nr, setup_port, ip) ) {
 
63
        werror("Failed to open xmlrpc socket on "
 
64
            + (stringp(ip) ? ip+":" : "port ") + port_nr + " !\n");
 
65
        return false;
63
66
    }
64
 
    MESSAGE("XMLRPC port opened on port "+ port_nr);
 
67
    MESSAGE("XMLRPC port opened on " + (stringp(ip) ? ip+":" : "port ")
 
68
        + port_nr);
65
69
    return true;
66
70
}
67
71