| 614 | } |
| 615 | |
| 616 | static 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 | |
| 652 | static void __parse_url_and_port(HTTP_HDR_REQ *hh, const char *url) |
| 653 | { |
no test coverage detected
searching dependent graphs…