示例#1
0
文件: spider.c 项目: leetking/spider
void init_spider(char const *start_host)
{
	link_que = g_queue_new();		
	link_hash = new_hash();
	link_t *link = calloc(sizeof(link_t), 1);
	assert(NULL != link);

	/* 默认首页先为index.html */
	link->host = strdup(start_host);
	/*
	 * NOTE www.cwnu.edu.cn时就会出错!!!
	 * 不知道是什么原因了!!!
	 */
	link->link = strdup("/index.html");
	init_http();
	g_queue_init(link_que);
	g_queue_push_tail(link_que, (gpointer)link);
}
示例#2
0
void init_system (void) {
   /* Initialize configured interfaces and applications. */

#if ETH_ENABLE == 1
   init_eth_link ();
#endif
#if PPP_ENABLE == 1
   init_ppp_link ();
#endif
#if SLIP_ENABLE == 1
   init_slip_link ();
#endif

#if (IGMP_ENABLE & ETH_ENABLE) == 1
   init_igmp ();
#endif
#if UDP_ENABLE == 1
   init_udp ();
#endif
#if TCP_ENABLE == 1
   init_tcp ();
#endif
#if HTTP_ENABLE == 1
   init_http ();
#endif
#if TNET_ENABLE == 1
   init_tnet ();
#endif
#if TFTP_ENABLE == 1
   init_tftp ();
#endif
#if (NBNS_ENABLE & ETH_ENABLE) == 1
   init_nbns ();
#endif
#if (DHCP_ENABLE & ETH_ENABLE) == 1
   init_dhcp ();
#endif
#if DNS_ENABLE == 1
   init_dns ();
#endif
#if SMTP_ENABLE == 1
   init_smtp ();
#endif
}
示例#3
0
static void init(void *const unused) {
	int rc = async_random((byte_t *)&SLNSeed, sizeof(SLNSeed));
	if(rc < 0) {
		alogf("Random seed error\n");
		return;
	}

	uv_signal_init(async_loop, sigpipe);
	uv_signal_start(sigpipe, ignore, SIGPIPE);
	uv_unref((uv_handle_t *)sigpipe);

	str_t *tmp = strdup(path);
	strarg_t const reponame = basename(tmp); // TODO
	rc = SLNRepoCreate(path, reponame, &repo);
	FREE(&tmp);
	if(rc < 0) {
		alogf("Repository could not be opened: %s\n", sln_strerror(rc));
		return;
	}
	blog = BlogCreate(repo);
	if(!blog) {
		alogf("Blog server could not be initialized\n");
		return;
	}
	rc = RSSServerCreate(repo, &rss);
	if(rc < 0) {
		alogf("RSS server error: %s\n", sln_strerror(rc));
		return;
	}

	if(init_http() < 0 || init_https() < 0) {
		HTTPServerClose(server_raw);
		HTTPServerClose(server_tls);
		return;
	}

//	SLNRepoPullsStart(repo);

	uv_signal_init(async_loop, sigint);
	uv_signal_start(sigint, stop, SIGINT);
	uv_unref((uv_handle_t *)sigint);
}
void YJDouyuBarrage::ok_button_clicked() {
	if (ui.m_roomID_lineEdit->text().isEmpty()) return;
	m_barrage_tcp_socket->connectToHost(QString(m_hostName_barrage), m_port_barrage, QIODevice::ReadWrite);

	init_http();
}
示例#5
0
文件: url.c 项目: gap-system/Mixer
int init_url(void)
{

    return init_http();
}