0

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 check50enter image description here

1
0

With this collection of check50/server fails I suggest these things.

  1. 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.

  1. 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 like http://localhost:8080/hello.php? should duplicate the segmentation fault that check50 reports.
4
  • thank you first for respond Oct 31 '16 at 17:58
  • for look up i use strncasecmp so i'm sure of it Oct 31 '16 at 17:59
  • for 2 and 3 i how i can use curl and what is the diffrene betwen curl and browser request Oct 31 '16 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 '16 at 21:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .