mod_throttle
mod_throttle.c 의 한부분입니다.
static t_visitor *
get_remote_user(t_visitors *vp, char *user)
{
t_visitor *v, **prev = &vp->head;
if (vp->head == (t_visitor *) 0 || user == (char *) 0)
return (t_visitor *) 0;
for (v = vp->head; v->next != (t_visitor *) 0; v = v->next) {
if (*v->remote.user == '\0' || ap_strcasecmp_match(v->remote.user, user) == 0)
break;
prev = &v->next;
}
/* Move the entry to the front of the list. */
*prev = v->next;
PUSH(vp->head, v);
/* The last entry in the list might match. */
if (ap_strcasecmp_match(v->remote.user, user) != 0) {
if (*v->remote.user == '\0') vp->used++;
(void) ap_cpystrn(v->remote.user, user, sizeof v->remote.user);
v->volume = v->refused = v->requests = v->delay = 0;
v->start = v->last = time((time_t *) 0) - 1;
}
(void) critical_release(critical);
return v;
}
mod_throttle 의 기능중 리모트유저(아파치 환경변수)의 트래픽을 측정하여 제한을 할수 있는 기능이 있습니다.
버그가 상당히 많지만. 가장 문제가 되는 "공백문자입력"시 유저의 복제가되면서 측정이 되질않는 증상이 있어서.. 고수님들의 약간의 도움을 받고자 합니다 ;;. 언어를 잘 못하는 관계로 OTL
위의 부분은 리모트유저값의 비교부분일듯한데.. 위부분에서 remote.user 의 입력값중 공백문자 들어올시 break 할수 있겠금 하려면 어떻게 수정하여야 하는지 부탁드립니다 ^^;


댓글 달기