代码拉取完成,页面将自动刷新
同步操作将从 hotmocha/sbalance 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#ifndef _SBPARSE_H_
#define _SBPARSE_H_
#include <stdio.h>
#include <unistd.h>
#include <ares.h>
#include "sbalance.h"
#include "sblist.h"
#define SB_DNS_MAX_IP_LEN 65
#define SB_DNS_STATUS_DESTORYED -1 /* not in wait or parse list and channel destoryed */
#define SB_DNS_STATUS_INITED 0 /* temp status, not in wait or parse list after inited */
#define SB_DNS_STATUS_WAITING 1 /* int wait list*/
#define SB_DNS_STATUS_PARSING 2 /* in parse list */
#define SB_DNS_STATUS_OK 3 /* parse ok, notice not in wait or parse and channel destoryed */
#define SB_DNS_STATUS_TIMEOUT 4 /* temp status */
#define SB_DNS_STATUS_ERROR 5 /* temp status */
struct sb_dns
{
char host[SB_DNS_MAX_HOSTNAME_LEN];
char ip[SB_DNS_MAX_IP_LEN]; /* only save one ip address */
int status; /* 0:inited 1: parsing 2: done 3: timeout*/
ares_channel channel;
unsigned long timeout_time;
struct list_head list_node;
struct hlist_node hash_node;
/* the waiting for dns this request */
struct list_head waiting_session_list;
};
int sb_dns_init_env();
/****
1. SB_OK(hit host's ip)
2. SB_AGAIN(a. not find host's ip, but add query request, b. find host, but the status is parsing)
3. SB_TIMEOUT(find host, but the status is timeout) temp status, not possible status
4. SB_ERROR
****/
int sb_dns_query_host_ip(const char *host, struct sb_session *sess);
int sb_dns_modify_status(char *host, int new_status);
void sb_dns_remove_session(struct sb_session *sess);
int sb_dns_process();
void sb_dns_set_done_handler(struct sb_session *sess, void (*handler)(void*, int, int, struct hostent*) );
int sb_dns_reparse_host(struct sb_dns *dns, struct sb_session *sess);
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。