Quantcast
Channel: Nginx Forum - Other discussion
Viewing all articles
Browse latest Browse all 972

About nginx source code(funtion ngx_event_connect_peer)

$
0
0
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.

Viewing all articles
Browse latest Browse all 972

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>