mirror of
https://github.com/zotanmew/nginx-rtmp-module.git
synced 2024-05-10 14:31:07 +02:00
added round-robin relay url balancing
This commit is contained in:
parent
db5d361743
commit
244961076f
|
@ -446,8 +446,9 @@ ngx_rtmp_relay_create_connection(ngx_rtmp_conf_ctx_t *cctx, ngx_str_t* name,
|
|||
goto clear;
|
||||
}
|
||||
|
||||
/* use the first address */
|
||||
addr = target->url.addrs;
|
||||
/* get address */
|
||||
addr = &target->url.addrs[target->counter % target->url.naddrs];
|
||||
target->counter++;
|
||||
|
||||
/* copy log to keep shared log unchanged */
|
||||
rctx->log = *racf->log;
|
||||
|
|
|
@ -23,8 +23,9 @@ typedef struct {
|
|||
ngx_int_t start;
|
||||
ngx_int_t stop;
|
||||
|
||||
void *tag; /* usually module reference */
|
||||
void *data; /* module-specific data */
|
||||
void *tag; /* usually module reference */
|
||||
void *data; /* module-specific data */
|
||||
ngx_uint_t counter; /* mutable connection counter */
|
||||
} ngx_rtmp_relay_target_t;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue