anomalizer/ngx_upstream_status — pull request #1 by masahif (2013-02-04 09:13:36+00:00)
Title: fix nginx_strlen issue.

I've fixed a small bug.

ngx_upstream_status creates a status page with following line.

buf = ngx_create_temp_buf(r->pool, 20 + ngx_strlen(&(upstream_round_robin_peer->name)) );

But ngx_strlen(&(upstream_round_robin_peer->name) always return "1".

Because upstream_round_robin_peer is a struct of ngx_str_t.

typedef struct {
ngx_str_t key;
ngx_str_t value;
} ngx_keyval_t;

and ngx_strlen() is following macro.

#define ngx_strlen(s) strlen((const char *) s)

So that val of struct is always cast to const char * and ngx_strlen() return "1".

Regards