Questions tagged [server]

Questions about server.c in pset6.

Filter by
Sorted by
Tagged with
0
votes
1answer
48 views

I've implemented pset6 server.c, but something is wrong that it fails all tests in check50 server2

I've been stuck for a few days. My implementation passed check50 server1 except for the non-existant file test, but it failed all check50 server2 test. I am guessing it is due to the load function. ...
0
votes
1answer
50 views

Help with GDB to debug - Server.c "working" except for php and doesn't pass any cs50 check

I've made some progress on server.c going through the code with gdb but now I'm stuck. It seems to be working (all pages and images load "correctly" in browser) except php files. It also does not pass ...
0
votes
1answer
126 views

Internal Server Error with Server.c

I'm lost on server.c. I passed the first check. When trying to run my server after completing the program, I get an internal server error. I ran valgrind and fixed multiple memory issues. I thought ...
0
votes
1answer
125 views

:( Requesting cat.exe returns error code 501

this is some pain in the neck every single test is passed except :( Requesting cat.exe returns error code 501 can you please help me my brain is a war zone right now here is my code const char* ...
0
votes
2answers
91 views

in pset6 (server.c) the load function give me segmentation fault

I implemented the load function, I compiled it without errors, but if I run it with gdb I get segmentation fault, sometimes after the first fread, sometimes after the second. That's my code: bool ...
0
votes
2answers
39 views

double free or corruption in Pset6 server.c

I get a double free or corruption error message on my server.c, although I am not freeing any thing in my functions. I also tested my functions and they are all working properly supposedly. Can any ...
0
votes
1answer
91 views

pset6 | Server.c | load and indexes doesn't work

I can't seem to find a problem in my load and indexes function. I need help. Thank you!! bool load(FILE* file, BYTE** content, size_t* length) { *content = NULL; *length = 0; BYTE temp; ...
0
votes
0answers
196 views

not passing check50

i am getting the following errors on running check50 on server.c :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :) Method of 'abcGET' returns error code 405 :) Method of '...
0
votes
1answer
43 views

PSET6 Indexes wrong condition followed

I have run GDB on this section of code using http://localhost:8080/test/ To mimic the check50 test to see why my code is failing that test. When I did this, I got the following when info locals was ...
0
votes
1answer
80 views

Problem with parse function

When i run Check50 (server1) , It shows me the following errors AFTER EDIT : :( HTTP/1.0 returns error code 505 \ expected output, but not "HTTP/1.1 404 Not Found\r\nContent-Type:..." :( ...
1
vote
1answer
33 views

A mistake in pset 6 source code server.c ?

in This block of code an int field is defined and initialized to 0 in order to count the number of fields present in the HTTP request; However, it's not used afterward. And it's value is checked to ...
0
votes
1answer
26 views

Pset6 Nothing appears when loading the page

When I load a page from my webserver all I get is a blank page if it's HTTP or a tiny white box with a black outline instead of the contents of the pages. What functions should I look at to solve this?...
0
votes
1answer
113 views

PSET6 Server.c cat.exe parse error with check50

I am running through the first half of PSET6 and have everything in check50 green other than the cat.exe section: :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 ...
0
votes
1answer
43 views

Problem Set6 the web Server

How Much should I understand of server.c ? There are too much code and too many functions. I can understand most of it, however there are certain line that I don't understand yet; For example the big ...
0
votes
1answer
63 views

Pset 6 'server.c' file size is 0, only for 'hello.php' - And maybe a check50 error?

Alright. I'm becoming crazy, so here I come. I finished the pset, and everything works. At least that's what check50 tells me. When I launch the server and try each file, they work, except for hello....
1
vote
1answer
69 views

server.c segmentation fault

I couldn't find the cause of segmentation fault when i run the server I have used valgrind to find where is the memory leaks .. and this is the result : ==2186== Memcheck, a memory error detector ==...
0
votes
1answer
93 views

Getting some errors in server.c pset 6. Don't know what to do,Pls help

:) 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 ...
0
votes
1answer
101 views

pset6 server.c not working properly

my server.c load and indexes functions are not working properly, and I'm not sure what's up. My parse and lookup functions pass all the tests. Any thoughts? bool load(FILE* file, BYTE** content, ...
0
votes
1answer
53 views

stuck with indexes and load in server.c

Hi I got a bit stuck on indexes and load. My parse() and lookup() functions seem to work fine now and also check50 is happy. But I feel I am missing something on indexes or load or maybe both. Maybe ...
0
votes
1answer
67 views

donot have any clue whats wrong in parse fn

Blockquote :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :) Method of 'abcGET' returns error code 405 :) Method of 'GETabc' returns error code 405 :) request-...
0
votes
1answer
279 views

Problem with check50 for server1

I know that when lookup returns NULL when called, error 501 should appear and that's what I did in lookup's implementation. If the extension of the file is none of the ones mentioned in the pset's ...
0
votes
1answer
81 views

error in load and indexes function

I can't seem to find a problem in my load and indexes function. I need help asap. PS- my lookup and parse functions show all green ticks on check50 char* indexes(const char* path) { // TODO ...
0
votes
1answer
160 views

Need help with pset6, lookup and parse function!

I think my parse and lookup are working fine, but check50 is not happy. Maybe anyone has an idea. here my functions: const char* lookup(const char* path) { // if there is a path, compare and ...
0
votes
1answer
69 views

What am I doing wrong with my code in pset6? (EDIT)

I have implemented all four of the functions required but I am confused because my code doesn't seem to pass many of the check50 tests. Check50 Results: https://sandbox.cs50.net/checks/...
1
vote
2answers
156 views

PSET6 Indexes Doesn't Work

Regardless of what I do, I can't seem to get the indexes function working. It always seems to return null. char* indexes(const char* path) { char* inPHP = malloc(sizeof(char) * strlen(path) + 11); ...
0
votes
1answer
796 views

PSET6: error of 'malloc(): memory corruption' on 'fopen' call - related to 'index' function

I'm nearing the end of this pset, having successfully implemented both parse and lookup. I've already had one attempt at load and, thinking it was correct (it is not), moved onto index; in the process ...
1
vote
1answer
62 views

pset6: problems with integer to pointer conversion and vice versa

Got stuck with a couple of problems after debugging what I could. I placed -> before the code lines where the problems occur. The first -> relates to question 1 the other three relate to question 2. ...
0
votes
1answer
93 views

Pset6 server2 passed all check50 tests but 2

I can't figure out why I am failing 2 tests in check50. Here is my code: bool load(FILE* file, BYTE** content, size_t* length) { if (file == NULL) { return false; } int temp = 0; *length = 0; ...
1
vote
1answer
70 views

Pset6 Server works fine for cat.jpg, but fails check50

I've implemented load and indexes and the website seems to work ok. I say ok because it prints out hello, hello, world when I access hello.php, and fails pretty much all the checks in the second ...
0
votes
1answer
203 views

Pset6 one check50 error [duplicate]

Please help me. I have passed every check except 1. Here is my error: check50 2015.fall.pset6.server1 server.c :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :) Method of '...
0
votes
1answer
337 views

Using access(path, F_OK) in indexes (pset6: server.c)

Based on the staff's use of access() in server.c and the documentation, I figured I could use it to see if the index.html/php exist. Unfortunately, whenever I try to use access, GDB tells me this ...
1
vote
1answer
120 views

PSET 6 Keeps Stopping Server

Sorry if this question is a duplicate. I tried to look over stackexchange before posting this (and I couldn't find anyone who was having a similar issue). I am having trouble getting my server to do ...
1
vote
1answer
75 views

Pset6 Server 403 Error, problem with path

I passed the first check50 for Pset6 but still can't seem to get my server working after implementing indexes and load. I've been getting 403 errors whenever I request my homepage, as well as an ...
0
votes
1answer
38 views

What is the difference between int* and char* in context of my load function?

Please take a look at the codes (both correct and incorrect) first- incorrect code- char* buffer = malloc(*counter); char* ch = malloc(sizeof(char)); for (*ch=fgetc(file);*c != EOF;*ch=...
0
votes
2answers
187 views

Pset6 Server Parse Function

Currently working on Pset6 and I can't seem to get the parse function to work. I haven't fully implemented the function but requesting the home page should work. I was wondering if someone could help ...
0
votes
1answer
79 views

Please help, stuck on pset6 first test

I have been stuck on pset6 for almost a month now and I've tried everything to debug it but I absolutely cannot find what I'm doing wrong... It's probably because I've looked through it so many time ...
0
votes
1answer
69 views

Why Pset6 check cat.exe and non-existant file going wrong?

:( Requesting cat.exe returns error code 501 \ expected output, not an exit code of 0 :( Requesting non-existant file returns error code 404 \ expected output, not an exit code of 0 code for ...
0
votes
1answer
107 views

What should be stored in abs_path and query if this request line is passed to parse?

If my request line is- GET /hello.php?name=mike HTTP/1.1 What should be stored in abs_path and query fields? and if my request line is- GET /hello.html HTTP/1.1 then what should be stored in abs_path ...
1
vote
1answer
66 views

How to fix this PSet6 Check50 fail?

All other checks pass except this one: :( Requesting hello.php? returns 200, text/html, and correct output \ expected output, not an exit code of 0 I have no idea how to fix it, here is part of ...
0
votes
1answer
132 views

CS50 pset6 check50 errors

I have completed my first draft of pset6 web server and I have used valgrind to check my program for memory leaks of which there seem to be none. However, when I ran my server.c file through check50 I ...
0
votes
1answer
83 views

Server.c Load function can read HTML but not images or PHP?

I'm not sure if what I did makes sense but here's the code for the load function: if (file != NULL) { char c; int counter = 0; while ((c = fgetc(file)) != EOF) { counter++; } ...
0
votes
0answers
30 views

My PSET6 server.c program compiles fine but appears to stop when it gets to finding the root

my command line entry is ./server https://ide50-applebyoz.cs50.io/public/ I've set some printf commands to show path and root and the result is: path: https://ide50-applebyoz.cs50.io/public/ root: (...
0
votes
1answer
49 views

PSet6 server, weird output

I have been working on PSET6 for ages and feel I have finally managed to clear most of the hiccups. However, despite my best efforts, whenever I click on a link, correct page isn't output; some weird ...
0
votes
1answer
99 views

Pset6 complete, manually tested. Failing check50 6 checks

Hello, I've been working on Pset6, which requires implementation of four functions on previously writen code. Apparently, as by manually testing, it should pass every test on check50, but that's not ...
0
votes
3answers
540 views

Connection to the server problems

I have just started the pset6 web server assignment and I am having a couple of problems even before I have begun. When I read through the assignment instructions, for pset6, and I have executed ~...
0
votes
1answer
124 views

Server.c trying to run it on mac

I tried running server.c outside the appliance on my mac and when compiling got the following message server.c:358:26: error: implicit declaration of function 'memmem' is invalid in C99 [-Werror,...
0
votes
1answer
45 views

PSET6: Question with Mallocing char* for PARSE

I'm currently working on PSET6 and had a question for the parsing section. I decided to use strtok() and as a result, will need to malloc memory when creating new char*. How do i know how much memory ...
0
votes
1answer
180 views

pset 6 server - Load produces inconsistent results

I'm really confused about what is wrong with my code as load works for certain files but not others and the reading of the file isn't something that is altered in any of the functions we're tasked ...
0
votes
1answer
77 views

error() function in server.c

This line creates an array body of size [(strlen(template) - 2 - ((int) log10(code) + 1) - 2 + strlen(phrase)) * 2 + 1]. // render template char body[(strlen(template) - 2 - ((int) log10(code) + 1) - ...
1
vote
1answer
30 views

Pset6 - Non-blocking socket in connected()

I'm currently on pset6 and I'm trying to read through the code for server.c to understand what it's doing. I've come across part of the code that I don't understand: /** * Checks (without blocking) ...