Lines Matching refs:vec
383 struct vec {
735 static const char *next_option(const char *list, struct vec *val,
736 struct vec *eq_val) {
769 struct vec ext_vec;
1533 struct vec *document_root) {
1536 struct vec uri_vec, path_vec;
1556 struct vec vec;
1559 match_len = get_document_root(conn, &vec);
1560 mg_snprintf(conn, buf, buf_len, "%.*s%s", vec.len, vec.ptr, uri + match_len);
1566 DEBUG_TRACE(("[%s] -> [%s], [%.*s]", uri, buf, (int) vec.len, vec.ptr));
1749 struct vec *vec) {
1750 struct vec ext_vec, mime_vec;
1763 *vec = mime_vec;
1773 vec->ptr = builtin_mime_types[i].mime_type;
1774 vec->len = builtin_mime_types[i].mime_type_len;
1780 vec->ptr = "text/plain";
1781 vec->len = 10;
2162 struct vec uri_vec, filename_vec;
2520 struct vec mime_vec;
2661 struct vec filename_vec;
2816 struct vec var_vec, root;
3102 struct vec root;
3400 static int parse_port_string(const struct vec *vec, struct socket *so) {
3407 if (sscanf(vec->ptr, "%d.%d.%d.%d:%d%n", &a, &b, &c, &d, &port, &len) == 5) {
3410 } else if (sscanf(vec->ptr, "%d%n", &port, &len) == 1) {
3416 assert(len > 0 && len <= (int) vec->len);
3418 if (strchr("sp,", vec->ptr[len]) == NULL) {
3422 so->is_ssl = vec->ptr[len] == 's';
3423 so->is_proxy = vec->ptr[len] == 'p';
3435 struct vec vec;
3442 while (success && (list = next_option(list, &vec, NULL)) != NULL) {
3443 if (!parse_port_string(&vec, &so)) {
3445 __func__, vec.len, vec.ptr, "[IP_ADDRESS:]PORT[s|p]");
3472 vec.len, vec.ptr, strerror(ERRNO));
3552 struct vec vec;
3564 while ((list = next_option(list, &vec, NULL)) != NULL) {
3567 if (sscanf(vec.ptr, "%c%d.%d.%d.%d%n", &flag, &a, &b, &c, &d, &n) != 5) {
3571 cry(fc(ctx), "%s: flag must be + or -: [%s]", __func__, vec.ptr);
3574 cry(fc(ctx), "%s: bad ip address: [%s]", __func__, vec.ptr);
3576 } else if (sscanf(vec.ptr + n, "/%d", &mask) == 0) {
3579 cry(fc(ctx), "%s: bad subnet mask: %d [%s]", __func__, n, vec.ptr);