All Questions
32 questions
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
28
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
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
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
36
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
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 ...
1
vote
2
answers
82
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, ...
0
votes
1
answer
129
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 ...
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, ...
0
votes
1
answer
81
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
1
answer
122
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 ...
1
vote
1
answer
80
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
1
answer
282
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
2
answers
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
1
answer
70
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
1
answer
114
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
1
answer
67
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
1
answer
48
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 ...
1
vote
1
answer
274
views
Help with pset6 parse function
I am having trouble with the pset6 parse function. I used check50 after implementing parse, and everything checks out except I get these two errors:
:( HTTP/1.0 returns error code 505
\ expected ...
0
votes
1
answer
81
views
Pset6: check50 has one last error.. I have one question about what to return
For the last error of :( Requesting hello.php? returns 200, text/html, and correct output
Should the parse function remove the last question mark, return 400, or should indexes handle it and return "...
0
votes
1
answer
102
views
PSET6 again: pages not loading, but getting 200 OK
I've managed to pass the first check50 with all green, and I think there is nothing wrong with my load function, but my pages don't load when I click on the link.
This happens with every link except ...
0
votes
1
answer
61
views
Pset6 - server.c - seg fault at free() - trouble with finding " and non-existant file
I'm struggling to figure out what is wrong with my code. I'm getting a seg fault at the end of my parse function where I am freeing memory.
It fails this in check50:
:( Requesting non-existant file ...
0
votes
1
answer
158
views
server.c: problem in abs_path
I have a problem in my parse() function of server.c
It took me almost 2 days to get to the specifics of the problem,
the problem is in the abs_path when the request target is:
/hello.html, abs_path ...
0
votes
1
answer
328
views
Check50. I need help with server.c, specifically with the parse function I guess. Thanks
I have just finished the 4 functions from Pset 6 (server.c). Well, everything works "fine". If I request /cat.html it returns HTTP/1.1 200 OK and if request cat.exe it returns the most famous server ...
0
votes
1
answer
224
views
My server.c parse function fails in cs50 check
I have updated this according to your suggestion.
And it is giving different results everytime with check50.sometimes it says some are right and other times others are right. I am totally confused ...
0
votes
1
answer
433
views
Pset 6: parse function failing one test on check50
Can someone please point me in the right direction? I've completed both load() and parse() but check50 is still returning the following:
:( Requesting non-existant file returns error code 404
\ ...
0
votes
1
answer
639
views
Server.c Non-existant file and cat.exe question
I'm almost done with parse function, but I get 301 Moved Permanently error in the above mentioned cases. I am aware that .exe is not present in our lookup function, but shouldn't we return NULL in ...
1
vote
1
answer
591
views
Pset6 Server.c: 404 Error only when submitting query on hello.html, everything else works
Every time I input a query on the HTML form, I get a 404 Error even though the query appears in the URL, and printf seem to indicate that my Parse function is correctly extracting the right substring. ...
1
vote
1
answer
283
views
Pset6 (server) - parse function causes a segfault
Segmentation fault in my parse function (at strncpy(http, http_temp, 8);). See below relevant parts of function.
Valgrind returns error of not stack'd, malloc'd or (recently) free'd but I'm copying ...
0
votes
1
answer
251
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 ...
1
vote
0
answers
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 ...