Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :) server.c exists
- :) server compiles
- :( Requesting cat.jpg returns 200, image/jpeg, and correct image
- :) Requesting cat.html returns 200, text/html, and correct file
- :( Requesting cat2.HTML returns 200, text/html, and correct file
- :( Requesting cat3.HtMl returns 200, text/html, and correct file
- :( Requesting cat.gif returns 200, image/gif, and correct file
- :) Requesting favicon.ico returns 200, image/x-icon, and correct file
- :) Requesting test.css returns 200, text/css, and correct file
- :) Requesting test.js returns 200, text/javascript, and correct file
- :) Requesting hello.php returns 200, text/html, and correct output
- :( Requesting hello.php? returns 200, text/html, and correct output
- \ expected output, not an exit code of 0
- :( Requesting hello.php?name=Alice returns 200, text/html, and correct output
- \ expected output, not an exit code of 0
- :) Requesting /test redirects to /test/
- :( Requesting /test/ outputs /test/index.html
- :( Requesting directory containing index.php outputs index.php
- \ expected output, not an exit code of 0
- :( Requesting two files in a row (cat.html then cat.jpg) succeeds
- bool load(FILE* file, BYTE** content, size_t* length)
- {
- if (file == NULL)
- {
- return false;
- }
- char* buffer = malloc(sizeof(char));
- *length = 1;
- int count = 0;
- for (char read = fgetc(file); read != EOF; read = fgetc(file))
- {
- buffer[count] = read;
- count++;
- buffer = realloc(buffer, sizeof(char) * (count + 1));
- }
- *length = count;
- *content = &buffer[0];
- // free(buffer);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement