Welcome! Log In Create A New Profile

Advanced

About nginx source code(funtion ngx_event_connect_peer)

Posted by sixsixsix 
About nginx source code(funtion ngx_event_connect_peer)
December 07, 2016 03:02AM
This really confuses me.
in function ngx_event_connect_peer(ngx_event_connect.c), it has this line(rc = pc->get(pc, pc->data);)
the default get method is round_robin.
it use function ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void *data).
when I print the value of data in above function, it is different from pc->data, I wonders why this happens?
For i want to get ngx_http_upstream_rr_peer_data_t of current request in other place, but it seems pc->data can't provide correct address,
it always has 56 Bytes distance from the correct addresss.
I would appreciate you very much if you help me because this confuses me for several days.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 51
Record Number of Users: 8 on December 15, 2016
Record Number of Guests: 386 on August 02, 2016
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready