According to your terminal output, abs_path is wrong. Unless you have a file named hello.php?name=gege019, 404 is the right answer. abs_path should not include the ? or anything that follows.


I have many takes on your implementation. in the sunny day scenario, your parse function should work if you fixed the problems hinted at below: are you sure you're terminating method correctly? are you sure you're not accessing elements that are beyond line? are you sure you're allocating memory for req_target that is big enough to hold the null terminator? ...


These kinds of problems occur if abs_path is not properly null terminated. You mention in an earlier post that you are using strncpy. From the man page for strncpy: Warning: If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated. You may be asking How could it work the first time? ...

Only top voted, non community-wiki answers of a minimum length are eligible