Questions tagged [server]

Questions about server.c in pset6.

Filter by
Sorted by
Tagged with
0 votes
0 answers
49 views

Why am I getting the 404 error everytime i try to use the the server?

In all the tasks where I need a server, I am getting stack. If I run http-server or flask run (in different tasks), I get a 404 error. please help me fix this and check my work.
0 votes
1 answer
44 views

Final project question and Hardware for a SQL server

Hello Dear Coders, I'm in charge of a radiology center (Xray imaging) and we need a cross server system to get patient datas with images. For the CS50 final exam I wish to build a "test" server for ...
  • 53
0 votes
1 answer
32 views

pset7 similarities - 404 error

I have submitted pset7 Similarities and it received full marks, but when I try testing it by running the server and uploading files, form submission throws a 404 error. What am I missing? (Side note: ...
0 votes
1 answer
288 views

Similarities Pset6 - submit button not working

Quick question. My code passes check50 and submit50 but for whatever reason I can't seem to get the actual program to work i.e. when I click the compare button on my form nothing happens. Here is my ...
0 votes
1 answer
1k views

Help needed for CS50 IDE flask server

Please help as I have landed into a trouble with my flask server for pset8/mashup. Per the spec within mashup/ I execute pip install --user -r requirements.txt and then in a terminal window I execute ...
  • 302
0 votes
1 answer
45 views

Pset 6 server.c - not working and memory leaks

Here is my code for the implementation of load, lookup, parse and indexes. char* indexes(const char* path) { char* full_path = malloc(strlen(path) + strlen("/index.html") + 1); strcpy(...
  • 141
0 votes
1 answer
37 views

Load function implementation check - pset 6 (server.c)

bool load(FILE* file, BYTE** content, size_t* length) { char* data = malloc(sizeof(BYTE)); int i = 0; while ((data[i] = fgetc(file)) != EOF) { i++; data = realloc(data, (sizeof(BYTE) * i) );...
  • 141
0 votes
1 answer
58 views

Pset6 server, working when i use it but fails check50

Like the tittle says everything works perfectly when i use but check comes up with this. any help would be appreciated Check50 :) server.c exists :) server compiles :( Requesting cat.jpg returns ...
0 votes
1 answer
58 views

Pset6 - Error With Using GDB

I have been trying to use GDB to find errors in my code. I went through the steps @MARS gave me as an answer to one of my questions. However, when I tried to list the values of my variables by using ...
0 votes
1 answer
45 views

Why might my parse return seg.fault to check50?

Below is my parse function in server.c pset6; The code is not fully commented yet, my bad; Nonetheless, why are all exit code 0 in check50, where is the loophole? Thank you. bool parse(const char* ...
0 votes
1 answer
26 views

indexes function in server.c

I was wondering about the indexes function for server.c. I am currently trying to implement it. As per the specs, I have to enable my program to find out if a file named index.html or index.php exists ...
0 votes
1 answer
53 views

Broken images in pset 6

I'm so close to finishing this, my only problem is that images won't display! Instead I get the broken image icon. The first check50 works fine, but the second gives me this: :) server.c exists :) ...
0 votes
1 answer
56 views

pset6 memory corruption (fast): 0x00000000009fd9d0 ***

I used check50 to check the parse function, it works well. But when I am trying to check all the functions, there is always a memory corruption. I tried to print the variables in lookup, it seems that ...
0 votes
1 answer
82 views

Need help with load function pset6

Just after completing Parse i've stucked on load function. By cs50 check i definately understand that something is wrong in reading memory to a buffer and maybe even accsessing it. For my eyes this ...
0 votes
1 answer
27 views

server.c cannot check http_version correctly

I am trying to parse the path but it always gives me the mistake-- I used gdb to trace the value of every char, and find that this line --if (strcmp(http_version,"HTTP/1.1")==0) always turns out to ...
0 votes
1 answer
324 views

error message "Error in `./server': free(): invalid next size (fast): 0x0000000001daf660" when running server

I implemented load, parse, query, lookup and indexes, but now when I try to run the program and open up my Web Server from the CS50 IDE, I get the error message quoted in the title of this post. ...
0 votes
1 answer
44 views

Need a help with parse function Pset6

i want to implement parse function by breaking the line into 3 parts using strtok() function, store those char* in array and check if they complete conditions we have in pset. But something goes wrong....
0 votes
1 answer
127 views

realloc and length in load(), server.c

I need help with load() in server.c. This is a follow-up to the other question, except now I'll post the updated code and make it a bit more specific. When I tested the server after implemented ...
0 votes
1 answer
19 views

Ambiguity with in server.c

I cannot understand the last part of this function--strncat(t, s + i, 1). Since s is a char pointer and i is an integer, why can we add them together? What is the meaning of this line? char* ...
0 votes
1 answer
45 views

PSET6 Server - fails the request two files in a row check

My server fails the last check in check50-server2 - "request two files in a row" Because it only fails that test I'm assuming the problem is somewhere in the parse or lookup functions. Valgrind shows ...
0 votes
1 answer
542 views

pset6 parse function: Invalid read of size 1

I'm having trouble with allocating memory correctly. p is a pointer that I intended to point to method, target, then http switching to the next one after each space is found. Then I thought I'd be ...
0 votes
1 answer
35 views

Parse cat.exe error in check50

I am having an issue with my parse function when running check50 where requesting cat.exe is returning error 404 as opposed to error 501. I've taken a look at the other questions related to cat.exe ...
  • 23
0 votes
1 answer
39 views

PSET6 parse function writing random character to strings

UPDATE: The issue was resolved thanks to the comment below. I'm working on the parse() function and seem to have random results with it. So far I wasn't able to launch the Web Server from my IDE as I ...
  • 5
0 votes
1 answer
82 views

PSET6 - Double free error

I'm getting stuck in the last lines of PSET6. Apparently the problem is in the LOAD function. Check50 server2 getting all but 1 lines marked red :( and when running the program I get * Error in `./...
0 votes
1 answer
73 views

pset6 server load - struggling with how to test this one

This pset has been a truly humbling experience. I was able to get lookup working (I think, based on my testing), and parse I could think of a general idea and then had to work through the specifics ...
0 votes
1 answer
56 views

Problem when testing pset6 parse method - Segmentation Fault

I've been trying to test each part of the server pset as I go along, and so I copied, pasted, and wrote a little test program to make sure that the pieces are working individually. When I tried ...
0 votes
1 answer
83 views

PSet 6 Parse Function (check50 issue)

I hope you are well! I am currently on pset6 and I am stuck on the parse function. So far I have managed to get check50 to go all but green on a few checks: https://sandbox.cs50.net/checks/...
0 votes
1 answer
36 views

pset6 three errors and i don't know why

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 ...
1 vote
1 answer
342 views

PSET6: Port 8080 already in use?

I've tried using apache50 stop + changing the port and I can't get the webserver to run on my machine, instead I get the error: ~/workspace/pset6 $ ~cs50/pset6/server 8081 public Stopping server ~/...
  • 301
1 vote
2 answers
78 views

Pset6 check50 server1 parse error

I am having trouble addressing the below two errors when I run the first check50 of pset6. check50 2015.fall.pset6.server1 server.c :( Requesting cat.exe returns error code 501 \ expected output, ...
  • 11
0 votes
0 answers
56 views

pset server: Two errors that i cant solve

Blockquote My server get two errors at cs50check: -Requesting cat.jpg returns 200, image/jpeg, and correct image (TODOS) -Requesting two files in a row (cat.html then cat.jpg) succeeds (TODOS)
  • 20
0 votes
1 answer
76 views

check50 fails on pset6 possibly indexes function

I am having problems while running check50 2015.fall.pset6.server2 server.c The thing is that all echecks are correct except these 2: :( Requesting /test/ outputs /test/index.html \ expected ...
  • 25
0 votes
1 answer
69 views

debug50 segfault in pset6

I am having problems with debug50 since when I pass the executable through it, it gives me a segfault in the strncasecmp line. But if I execute the program normally, it works fine. This happens also ...
  • 25
0 votes
1 answer
110 views

Pset6 server.c almost there

I spend a lot of time on this pset, and still got some errors which I can not figure out, so please help if you may. Here are errors cs50 checker sends me: :) server.c exists :) server compiles :) ...
0 votes
1 answer
193 views

How to stop server?

I'm working on pset7, i tried apache50 stop, and killall -9 server (says - server: no process found) but when I open my web server page, it's running the dynamic webpage I build from the class ( ...
0 votes
1 answer
74 views

PSET6 Cannot Run Staff implementation from IDE

I have just started pset6 and i am trying to run staff's implementation. However I am getting error as shown in picture below. Kindly suggest the fix. Thanks ~/workspace/ $ cd /home/cs50 /home/cs50/ $...
0 votes
1 answer
132 views

CS50 pset 6 server - I think something's wrong with my load function

EDIT: Fixed some more stuff, but remain stuck. Will continue troubleshooting, but would still appreciate input :) New code here: http://pastebin.com/gQyqPx99 Hello! I'm really stuck on pset6 server, ...
1 vote
1 answer
93 views

Pset6 load returns length zero for php files

First time posting so if I'm off the mark here let me know. Basically, in writing server.c I can't figure out how to test my load function now that I've written it. check50 will only work once I've ...
0 votes
1 answer
79 views

Load function doesn't work

I have a load function which seems not to work properly. I am checking the result of fread and it is not returning anything (int remains 0). May you please advise in which way should I dig to make it ...
1 vote
0 answers
27 views

bind socket to port. But it's beeing used

I am trying to make a server to store data. I have some problem when I start he server it works good but then if i close it and start it again within say 30 sec the port is used. I used netstat -antu ...
  • 96
1 vote
1 answer
151 views

PSET7: web server permissions problem

Just started pset7 and can't get the web server to load. I've read about this all over the place but can't get anything to work as of yet. Now I've resorted to wiping the whole workspace clean (after ...
  • 15
0 votes
2 answers
55 views

pset6: requesting php from within html isn't working

Almost there, I'm only failing the following two tests now: :( Requesting hello.php? returns 200, text/html, and correct output \ expected output, not an exit code of 0 :( Requesting hello.php?...
  • 15
0 votes
2 answers
74 views

pset6 : Problem with 301 error

Updated my parse and load now. I am dying to find out why 301 error now:( Must be happening in redirect function. typedef char BYTE; #define LimitRequestLine 8190 bool parse(const char* line, char*...
0 votes
1 answer
91 views

All pages and images load except cat.jpg

Since I'm close, I will not be posting any of my code up front. I'm at a point where everything checks except these two :( Requesting cat.jpg returns 200, image/jpeg, and correct image :( Requesting ...
  • 32
0 votes
1 answer
56 views

Server1 passes server 2 fails hard, not sure where to go from here

After debugging many times, watching every variable I could think of that would be used, I'm feeling stuck and I'm reaching out for some guidance. Server1 passes all tests https://sandbox.cs50.net/...
  • 32
0 votes
1 answer
38 views

pset 6: Server redirects too many times [duplicate]

/** * Loads a file into memory dynamically allocated on heap. * Stores address thereof in *content and length thereof in *length. */ bool load(FILE* file, BYTE** content, size_t* length) { // ...
  • 7
0 votes
1 answer
31 views

error in server.c

I'm almost done with pset6, web server. Checking my code with check50 the only red face I got was :( Requesting request-target with " returns error code 400 \ expected output, but not "HTTP/1.1 200 ...
  • 14
0 votes
1 answer
127 views

PSET 6 Server errors on a few CS50 checks

I fixed some issues in this but I am still getting errors and can't figure out what is causing them. :( Requesting cat.exe returns error code 501 Expecting the following on standard out ... 501 NOT ...
0 votes
1 answer
56 views

Server.c issues after completing indexes function

So I've been working on server.c and I have the the lookup, parse, and indexes function finished. With index passing back "index.php", "index.html", or NULL. It runs through that but when it gets to ...
  • 32
1 vote
1 answer
78 views

PSET6 - server.c, trouble with parse

I thought my parse() function was looking pretty good, but I keep consistently getting the same check50 (server1) error: :( Requesting non-existant file returns error code 404 \ expected output, ...
  • 13

1
2 3 4 5