#define IS_METHOD(ctx, method) \
mco_lews_strcmp(method, (ctx)->incoming_buf, (ctx)->method_pos, (ctx)->method_pos + (ctx)->method_len)
ctx
lews_connection_context_h).method
"GET", "POST").This macro checks whether the HTTP request method matches the specified
methodstring.It uses
mco_lews_strcmp()by passing the start position of the method (method_pos) and a synthetic buffer size equal tomethod_pos + method_len. This effectively limits the comparison to the exact length of the parsed method token.The comparison is case-sensitive and requires an exact match in both content and length.
lews_connection_context_h p_ctx; ... if (IS_METHOD(p_ctx, "GET")) { if (IS_URL(p_ctx, "/test")) { ... } }
1
method string.0