heh, thanks for reply.
I have actually fixed my code and made it work in an hour after posting topic here, there was some silly mistakes. Here is good one:
while((redirection_search = sys_strstr(tem, "Location:")) != (void*)0){
CLEAR(recvbuffer);
char *found, *uri;
char con[512];
CLEAR(con);
t = sys_strtok(redirection_search,"\n");
for(i = 0; t; t = sys_strtok((void*)0,"\n"), i++) token[i] = t;
found = cut_it(token[0], " ");
found = (found+8);
sys_strcpy(con, found);
sys_strtok(found,"/");
uri = sys_strstr(con, "/");
VisitSite(found, uri);
break;
}
CLEAR(var) => sys_memset(&var, 0x00, sizeof(var))
sys_ => my own syscalls based functions, libc equivalents, as i have stopped using libc.
VisitSite(found, uri) => calling function from itself
^^ this code handles as many redirections as it receives.
Cheers