Questions tagged [server]

Questions about server.c in pset6.

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

Segementation Issue in Pset 6

I am trying to implement Pset6 but I'm having a huge problem with segmentation faults caused by strstr or strchr. The offending lines are printf("OK %s\n", reqLine); tempStr = strstr(reqLine, "HTTP/...
0
votes
1answer
80 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
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
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
364 views

pset6: problem parsing the request line in server.c

I feel like I'm going in circles trying to parse the request line into its constituents. It looks like method and requesttarget are ok, but I keep getting too many characters for HTTPver. For "GET / ...
0
votes
1answer
248 views

pset6 redirect loop

I can't figure out what is wrong with my code, and I don't know where the issue is. I have tried to figure it out by putting printf calls everywhere, and it appears that my parse function works as ...
0
votes
2answers
603 views

Can't find cause of segmentation fault in server.c pset6

I need help finding cause of the segmentation fault in my server.c. I've been using gdb line by line for this pset and I finally think I can use it. However, it reports the seg fault at the line 130 ...
0
votes
1answer
81 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
1answer
32 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 ...
0
votes
1answer
36 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) );...
0
votes
1answer
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
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
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:..." :( ...
0
votes
1answer
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
1answer
125 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
79 views

Pset 6 Server stuck in endless loop in request function, staff server implementation also hangs

I cannot get the server to respond after sending a request. My code compiles and I checked with valgrind and had no issues. I have been using Code::Blocks IDE to help debug easier but have also used ...
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 ...
0
votes
1answer
93 views

a question about(extracting queries and extensions in a request line )

I am trying to extract the query and the extension from request-line but i don't know what's the maximum length of a query and a file extension so that I can know the size of the char array to store ...
0
votes
1answer
169 views

PSET6 Web Server: Static contents work while dynamic leads to a seg fault

I've browsed the questions asked, many of them helped to fix my code but I'm facing a last challenge and I've no idea how to pass it. Every test made with "cat.jpg", "cat.html" or "hello.html" works ...
0
votes
1answer
196 views

Pset6 (Server.c) Segmentation Fault, Unitialized values

I am getting a segmentation fault when I try to run access a page using the server, as well as 404 and 403 errors. I used Valgrind, and it states "Conditional jump or move depends on uninitialised ...
0
votes
1answer
234 views

pset6 server.c ide50 400 Bad Request

I am doing pset6 (for the second time) and have it all working on the new platform (ide50), however when I load my workspace's domain I get a 400 Bad Request message but otherwise the page loads as it ...
0
votes
1answer
37 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 ...
0
votes
1answer
26 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
1answer
286 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
1answer
175 views

hello.html ERR_ADDRESS_UNREACHABLE

I'm not able to reach the hosted html files outside of the appliance. Within the appliance everything works great. However, as soon as I try from chrome in windows I immediately get an ...
0
votes
1answer
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 ...
0
votes
1answer
56 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
1answer
118 views

What format is the PHP interpreter expecting a query?

I've managed to successfully extract a query from the target, but in order to configure it properly I need to know what to put into the "query" string variable. I've hunted a bit and experimented but ...
0
votes
1answer
188 views

PSET6 405 Method not allowed

I'm getting the 405 Method not allowed when I run my server with the public directory. Moreover, if I exclude the piece of code which checks for GET method, I get a segmantation fault. I've attached ...
0
votes
1answer
81 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
0answers
71 views

Server.c failing test 1 with all the same error code

I have finally compiled my pset6 (took me quite a while...) but now I'm running into a problem. When I ran the first check50 all the tests are giving me a error code of: "\ expected output, not an ...
0
votes
0answers
100 views

Pset 6 Server won't compile

I started cs50 last year in October and wasn't able to finish it. But now I'm continuing onto my journey in which I am picking up from pset6. However, I don't seem to be too familiar with the system (...
0
votes
1answer
93 views

HELP! Problems with pset6 server.c

So I have been trying things all day now, I just can't get the darn thing to work. I get every smiley but :( Method of 'GETabc' returns error code 405 \ expected output, but not "HTTP/1.1 301 Moved ...
1
vote
0answers
1k views

PSET 6 Server.c Parse Method

I am currently writing the parse method for pset6 server.c. I have rewritten it many times and I have never gotten it to work. I currently am getting 403 forbidden every time I try to run it. Here is ...
1
vote
2answers
322 views

pset6 (server.c) - 404 not found with /cat.jpg, but works with other files

I have been having trouble with server.c My version seems to work with hello.html. However, when I try and use the following with telnet GET /cat.jpg HTML/1.1 I get HTTP/1.1 404 file not found ...
0
votes
1answer
44 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(...
1
vote
1answer
172 views

pset6 address already in use [duplicate]

I have a problem with pset6 (server). I was debugging server on gdb, using run -p 8080 public and then I quitted. Then I made some changes to server.c, compiled it, and used gdb again. Now if I submit ...
0
votes
1answer
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) { // ...
0
votes
1answer
184 views

Broken image cat.jpg? [duplicate]

Thanks to an answer on an earlier question tonight, server.c seems to work perfectly on every file except for cat.jpg. I checked in GDB, and the path is processing perfectly, as is the MIME type. But ...
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) - ...
0
votes
0answers
245 views

Guys getting problem with cat.exe

Hey friends thakyou for your help in advance I am having problem with my parse and lookup function. check50 is returning all fine except this :disappointed: Requesting cat.exe returns error code 501 ...
0
votes
1answer
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 ...
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
55 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
1answer
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
1answer
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
1answer
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
1answer
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
1answer
332 views

pset6 problem with webserver [duplicate]

I finished pset6 (No, not really!) :( when i test the webserver as follows: enter my appliance IP followed by port 8080 then /cat.jpg i got: 505 HTTP Version Not Supported does anyone know what is ...
0
votes
1answer
323 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. ...

1
2 3 4 5