NET_SetupPrefs(NULL); PREF_RegisterCallback("network.proxy",NET_PrefChangedFunc,NULL); PREF_RegisterCallback("browser.cache",NET_PrefChangedFunc,NULL); PREF_RegisterCallback("network.hosts.socks_server",NET_PrefChangedFunc,NULL); PREF_RegisterCallback("network.hosts.socks_serverport",NET_PrefChangedFunc,NULL); PREF_RegisterCallback("network.dnsCacheExpiration",NET_DNSExpirationPrefChanged,NULL); NET_RegisterCookiePrefCallbacks();    NET_RegisterPadPrefCallbacks(); PREF_RegisterCallback("mail.allow_at_sign_in_user_name", NET_PrefChangedFunc, NULL);
NET_InitNetLib(int socket_buffer_size, int max_number_of_connections){    int status;#if defined(NSPR20) && defined(DEBUG)        if (NETLIB==NULL)           NETLIB = PR_NewLogModule("NETLIB");#endif	TRACEMSG(("Initializing Network library"));	NET_StartupTime = time(NULL);	/* seed the random generator	 */	XP_SRANDOM((unsigned int) time(NULL));	if(max_number_of_connections < 1)		max_number_of_connections = 1;#ifdef XP_UNIX	signal(SIGPIPE, SIG_IGN);#endif	    status = NET_ChangeSocketBufferSize(socket_buffer_size);	NET_ChangeMaxNumberOfConnections(max_number_of_connections);	net_waiting_for_actives_url_list = XP_ListNew();	net_waiting_for_connection_url_list = XP_ListNew();    net_EntryList = XP_ListNew();#ifdef XP_MAC#ifdef MOZILLA_CLIENT    NET_CacheInit();	NET_ReadCookies("");	#endif /* MOZILLA_CLIENT */#endif /* XP_MAC */	NET_TotalNumberOfProcessingURLs=0; /* reset */#ifdef XP_UNIX	{		char *ac_url = getenv("AUTOCONF_URL");		if (ac_url) {			NET_SetProxyServer(PROXY_AUTOCONF_URL, ac_url);			NET_SelectProxyStyle(PROXY_STYLE_AUTOMATIC);		}	}#endif#ifdef JAVA    libnet_asyncIO = PR_NewNamedMonitor("libnet");#endif	NET_SetupPrefs(NULL);	PREF_RegisterCallback("network.proxy",NET_PrefChangedFunc,NULL);	PREF_RegisterCallback("browser.cache",NET_PrefChangedFunc,NULL);	PREF_RegisterCallback("network.hosts.socks_server",NET_PrefChangedFunc,NULL);	PREF_RegisterCallback("network.hosts.socks_serverport",NET_PrefChangedFunc,NULL);	PREF_RegisterCallback("network.dnsCacheExpiration",NET_DNSExpirationPrefChanged,NULL);	NET_RegisterCookiePrefCallbacks(); /* simply inits cookie info in mkaccess.c */									   /* and registers the callbacks */	/* inits the proxy autodiscovery vars and registers their callbacks. */	NET_RegisterPadPrefCallbacks();	PREF_RegisterCallback("mail.allow_at_sign_in_user_name", NET_PrefChangedFunc, NULL);	/* initialize protocol modules 	 *	 * eventually this should be done dynamically,	 * but first we need to make URL types be dynamically	 * registered, and make URL parsing dynamic as well.	 *	 * Currently, registering them in the most used order is 	 * very slightly more efficient	 */	NET_ClientProtocolInitialize();	/* @@@@ these need to move soon */	NET_InitNFSProtocol();	NET_InitURNProtocol();	NET_InitWAISProtocol();	NET_InitTotallyRandomStuffPeopleAddedProtocols();	NET_InitMailtoProtocol();  /* has a stub for MOZ_MAIL_NEWS */#ifdef MOZ_MAIL_NEWS    	NET_InitNewsProtocol();	NET_InitMailboxProtocol();	NET_InitMsgSearchProtocol();	NET_InitPop3Protocol();	NET_InitLDAPProtocol();	NET_InitCertLdapProtocol();	NET_InitAddressBookProtocol();	NET_InitIMAP4Protocol();#endif /* MOZ_MAIL_NEWS */    return(status);}