-
大小: 323KB文件類型: .gz金幣: 1下載: 0 次發布日期: 2021-06-06
- 語言: 其他
- 標簽: Keepalived??
資源簡介
Mycat高可用負載均衡集群的實現(HAProxy + Keepalived + Mycat)中使用的Keepalived,詳情請參見博文:http://blog.csdn.net/l1028386804/article/details/76397064
代碼片段和文件信息
/*
?*?Soft:????????Perform?a?GET?query?to?a?remote?HTTP/HTTPS?server.
?*??????????????Set?a?timer?to?compute?global?remote?server?response
?*??????????????time.
?*
?*?Part:????????HTTP?asynchronous?engine.
?*
?*?Version:?????$Id:?http.cv?1.1.16?2009/02/14?03:25:07?acassen?Exp?$
?*
?*?Authors:?????Alexandre?Cassen?
?*
?*??????????????This?program?is?distributed?in?the?hope?that?it?will?be?useful
?*??????????????but?WITHOUT?ANY?WARRANTY;?without?even?the?implied?warranty?of
?*??????????????MERCHANTABILITY?or?FITNESS?FOR?A?PARTICULAR?PURPOSE.
?*??????????????See?the?GNU?General?Public?License?for?more?details.
?*
?*??????????????This?program?is?free?software;?you?can?redistribute?it?and/or
?*??????????????modify?it?under?the?terms?of?the?GNU?General?Public?License
?*??????????????as?published?by?the?Free?Software?Foundation;?either?version
?*??????????????2?of?the?License?or?(at?your?option)?any?later?version.
?*
?*?Copyright?(C)?2001-2012?Alexandre?Cassen?
?*/
/*?system?includes?*/
#include?
#include?
/*?keepalived?includes?*/
#include?“memory.h“
#include?“utils.h“
#include?“html.h“
#include?“timer.h“
/*?genhash?includes?*/
#include?“include/http.h“
#include?“include/layer4.h“
#include?“include/main.h“
/*?
?*?The?global?design?of?this?checker?is?the?following?:
?*?
?*?-?All?the?actions?are?done?asynchronously.
?*?-?All?the?actions?handle?timeout?connection.
?*?-?All?the?actions?handle?error?from?low?layer?to?upper
?*???layers.
?*?
?*?The?global?synopsis?of?the?inter-thread-call?is?:
?*?????
?*?????http_request_thread?(send?SSL?GET?request)
?*????????????v
?*?????http_response_thread?(initialize?read?stream?step)
?*?????????/?????????????\
?*????????/???????????????\
?*???????v?????????????????v
?*??http_read_thread???ssl_read_thread?(perform?HTTP|SSL?stream)
?*???????v??????????????v
?*??------------------------------
?*???finalize????/?????epilog
?*/
const?hash_t?hashes[hash_guard]?=?{
[hash_md5]?=?{
(hash_init_f)?MD5_Init
(hash_update_f)?MD5_Update
(hash_final_f)?MD5_Final
MD5_DIGEST_LENGTH
“MD5“
“MD5SUM“
}
#ifdef?FEAT_SHA1
[hash_sha1]?=?{
(hash_init_f)?SHA1_Init
(hash_update_f)?SHA1_Update
(hash_final_f)?SHA1_Final
SHA_DIGEST_LENGTH
“SHA1“
“SHA1SUM“
}
#endif
};
#define?HASH_LENGTH(sock) ((sock)->hash->length)
#define?HASH_LABEL(sock) ((sock)->hash->label)
#define?HASH_INIT(sock) ((sock)->hash->init(&(sock)->context))
#define?HASH_UPDATE(sock?buf?len)?\
((sock)->hash->update(&(sock)->context?(buf)?(len)))
#define?HASH_FINAL(sock?digest)?\
((sock)->hash->final((digest)?&(sock)->context))
/*?free?allocated?pieces?*/
static?void
free_all(thread_t?*?thread)
{
SOCK?*sock_obj?=?THREAD_ARG(thread);
DBG(“Total?read?size?read?=?%d?Bytes?fd:%d\n“
????sock_obj->total_size?sock_obj->fd);
if?(sock_obj->buffer)
FREE(sock_obj->buffer);
/*
?*?Decrement?the?current?global?get?number.
?*?=>?free?the?reserved?thread
?*/
req
- 上一篇:liquiba
se-demo.zip - 下一篇:MDK_keil5注冊機不含軟件
評論
共有 條評論