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

« back to all changes in this revision

Viewing changes to server/net/port/nntp.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: nntp.pike,v 1.1.1.1 2005/02/23 14:47:21 cvs Exp $
 
17
 * $Id: nntp.pike,v 1.1.1.1 2006/03/27 12:40:18 exodusd Exp $
18
18
 */
19
19
 
20
 
constant cvs_version="$Id: nntp.pike,v 1.1.1.1 2005/02/23 14:47:21 cvs Exp $";
 
20
constant cvs_version="$Id: nntp.pike,v 1.1.1.1 2006/03/27 12:40:18 exodusd Exp $";
21
21
 
22
22
inherit Stdio.Port;
23
23
 
66
66
    if ( port_nr == 0 ) 
67
67
        port_nr = 6669;
68
68
 
69
 
    if ( !bind(port_nr, setup_port) ) {
70
 
        werror("Failed to bind nntp port on " + port_nr+" !\n");
 
69
    string ip = _Server->query_config("ip");
 
70
    if ( ! stringp(ip) || sizeof(ip)==0 ) ip = 0;
 
71
    if ( !bind(port_nr, setup_port, ip) ) {
 
72
        werror("Failed to bind nntp port on "
 
73
            + (stringp(ip) ? ip+":" : "port ") + port_nr+" !\n");
71
74
        return false;
72
75
    }
73
 
    LOG("NNTP Port registered on " + port_nr);
 
76
    LOG("NNTP Port registered on " + (stringp(ip) ? ip+":" : "port ")
 
77
        + port_nr);
74
78
    return true;
75
79
}
76
80