in my work when i try ./server it show me stopping server
then i use printf in start function to know what wrong
and i know if i type ./server puplic
start function in root=realpath(path,NULL)
show root ==NULL
i know because error message i print in this case is no root
but i don't understand why
i make my lookup better
and my parse
but still same problem a make my lood with unsigned char
and use fread not getc and ithink there is nothing wrong
with my load function or parse parse pass all check50 server1
and in parse my requestline is array[limitrequestline] so it contain all request line
and in lookup i use strncasecmp and index i think it's perfect
here the check50
-
Can I see the code?– Ricardo David AntonettiOct 28, 2016 at 14:05
1 Answer
With this collection of check50/server fails I suggest these things.
- Review your lookup function and make sure it matches this part of the specification:
image/jpeg (not image/jpg) for any file whose path ends in .jpg (or any capitalization thereof)
A mistake there will cause the two cat.jpg failures.
- Review your parse function. There is a problem if there is a '?' with no query following. The
expected output, not an exit code of 0
usually indicates a seg fault. To test that particular call (/hello.php?), you must use a curl request and not a browser request. All modern browsers strip a trailing '?', so the parse function will not have a '?' to process. A curl request likehttp://localhost:8080/hello.php?
should duplicate the segmentation fault that check50 reports.
-
-
-
for 2 and 3 i how i can use curl and what is the diffrene betwen curl and browser request Oct 31, 2016 at 18:12
-
And you're sure it returns "image/jpeg"? See the instructions/specifications on how to use curl. One difference is it allows you to send a request with a trailing '?'. Another difference is it does not call favicon.ico. Oct 31, 2016 at 21:38