MCPcopy Create free account
hub / github.com/acl-dev/acl / __strip_url_path

Function __strip_url_path

lib_protocol/src/http/http_hdr_req.c:616–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

614}
615
616static void __strip_url_path(ACL_VSTRING *buf, const char *url)
617{
618 ACL_ARGV *argv;
619 const char *ptr;
620 const char last_ch = *(url + strlen(url) - 1);
621 ACL_ITER iter;
622
623 argv = acl_argv_split(url, "/");
624
625 /* xxx: ���뽫�������еij�ʼ������ acl_argv_split �ĺ��棬��Ϊ url
626 * ��ָ�����п����� buf �еĻ�������ַ��ͬ���μ� __strip_url_path
627 * ���������ã����⣬�ڵ��� ACL_VSTRING_RESET �󻹱������
628 * ACL_VSTRING_TERMINATE������ ACL_VSTRING_RESET ���ƶ�ָ��λ�ã�
629 * �����Ὣ��ʼλ�ø� '\0'
630 */
631 ACL_VSTRING_RESET(buf);
632 ACL_VSTRING_TERMINATE(buf);
633
634 acl_foreach(iter, argv) {
635 ptr = (const char*) iter.data;
636 if (strcmp(ptr, ".") == 0 || strcmp(ptr, "..") == 0) {
637 continue;
638 }
639 ACL_VSTRING_ADDCH(buf, '/');
640 acl_vstring_strcat(buf, ptr);
641 }
642
643 /* make the last char is ok */
644 if (last_ch == '/') {
645 ACL_VSTRING_ADDCH(buf, '/');
646 ACL_VSTRING_TERMINATE(buf);
647 }
648
649 acl_argv_free(argv);
650}
651
652static void __parse_url_and_port(HTTP_HDR_REQ *hh, const char *url)
653{

Callers 1

__parse_url_and_portFunction · 0.85

Calls 4

acl_argv_splitFunction · 0.85
acl_vstring_strcatFunction · 0.85
acl_argv_freeFunction · 0.85
acl_foreachFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…