Nginx commonly used data structure

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

1, The string ngx_str_t

Definition:

typedef struct {

size_t len;

u_char *data;

} ngx_str_t;

Use:


Be careful:

(1)Data 'data未必是以'\0'结束' is not the end,

(2)To use ngx_str_t to store the string, but also for the storage space for the string,

(3)Use%V to print ngx_str_t, attention is the address of the variable parameter ngx_str_t,



The noon meal time to write, for these first, then gradually improve


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Bert at February 24, 2014 - 6:18 AM