Questions tagged [parse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
101 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
1answer
59 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
1answer
155 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
1answer
51 views

Why can I not get any error except 405 (and once 501) here?

I've been working my way through PSET6, and most of it's been fine, until now. When I check the program in check50, it shows me that the first two (existing and compiling), the 5th (checking if GETabc ...
0
votes
1answer
275 views

Pset6 Parse non-existant file & cat.exe CHECK50

After a bit of wrestling, I thought I got parse and lookup to work. In my test file, the correct errors(I printf them) are printed out, but when I run check50, I get two things incorrect: :( ...
0
votes
1answer
182 views

Pset6 server.c Error 403

server.c is giving error(403) inside transfer function (written by default) lookup function : const char* lookup(const char* path) { char* s=(char*)calloc(20,1); strcpy(s,""); char *...
0
votes
1answer
143 views

first version of check50 not working pset6

I have almost completed lookup() and parse() function but check50(version 1) shows :( in 2 cases. Below is my check50 result. :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :...
0
votes
1answer
110 views

pset6 parse: char* pointers are right in parse but return wrong value

I am having trouble with this pset and I am using gdb to step through the function. Should I worry about the following observations or should I ignore them and assume my problems are from something ...
0
votes
1answer
87 views

Parse function not returning error codes

My code compiles, but the cs50 says it's returning 0 when it should be returning error codes. The premise of my function is to break the line into method, request-target, and HTTPversion and then ...
0
votes
1answer
328 views

pset6; part 1; parse and load

I have already made a first part of this pset, but I have several problems that I can not resolve. My code pass almost all of the tests except these: :( Requesting cat.exe returns error code 501 ...
0
votes
1answer
69 views

week7 pset6 parse function - what's the input?

I will be grateful for your help (I am among those non-comfy students): I am struggling to understand what type of input I am dealing with when writing the parse function, i.e. what the line could ...
0
votes
1answer
222 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
1answer
188 views

pset 6: server.c weird error with check50

On checking with check50, I get all smileys except for one: :( Requesting hello.php?name=Alice returns 200, text/html, and correct output \ expected output, but not "X-Powered-By: PHP/5.5.3\r\...
0
votes
1answer
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
1answer
424 views

Pset 6 - Parse - Too dynamic?

So I've been working on pset6 for a while now, the hardest thing with it is that it is very hard to test (I use a test.c file to do that and lots of printf functions), and the whole code of server.c ...
0
votes
1answer
126 views

struggling with parsing request-line

In my parse() I used this code snipped I found on google in order to extract the method: char* method = strtok(line, " "); I'm getting the following error: /usr/include/string.h:348:39: note: ...
0
votes
0answers
9 views

How can I receive a string from the user to tokenize without having to initialize the array with a constant?

The string in question is names1[] that is initialized with "Anya Ava Sam Mark" int main() { char names1[] = "Anya Ava Sam Mack"; char delim[] = " "; ...
0
votes
0answers
16 views

one failed test of server.c :(Two spaces after GET returns error code [duplicate]

I have no idea what's wrong with my parse function! I've tried everything... It fails one test only - :(Two spaces after GET returns error code. Please, help me - I have nobody to ask because I'm ...
0
votes
1answer
33 views

Pset6: Having Issues Running Server.C

I'm trying to debug server.c with gdb, but I can't figure out how to run server.c. The program compiles correctly, but when I use gdb ./server and then run public, server.c runs into an infinite loop....
0
votes
1answer
29 views

pset6 parse function fails "hello.php?" test

My code passes all but 1 test. This is the error: :( Requesting hello.php? returns 200, text/html, and correct output \ expected output, not an exit code of 0 Can you see what the problem is?? ...
0
votes
1answer
63 views

pset6 Parse - help with pointers

I am taking this course online. I do not have anyone to ask for help that knows anything about coding so I rely 100% on this discussion board (and the internet in general) for help. I am having ...
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
61 views

Pset6 Parse Errors in Check50

bool parse(const char* line, char* abs_path, char* query) { const char* sp1 = strchr(line, ' '); const char* sp2 = strrchr(line, ' '); const char* slash = "/"; const char* crlf = ...
0
votes
1answer
26 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
1answer
90 views

parse function in pset6

When using Check50 on server.c, I get this result: :) server.c exists :) server compiles :) HTTP/1.0 returns error code 505 :( Method of 'abcGET' returns error code 405 \ expected output, ...
0
votes
1answer
43 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
1answer
53 views

After implementing parse, should all checks be green?

I am working on pset6, after implementing parse(), we are instructed to use check50. check50 2015.fall.pset6.server1 server.c At this point, I haven't done any code for query, load() or indexes(). ...
0
votes
1answer
51 views

pset6 parse function gives error in check50 1

I am working on the parse function. My code gives the following results in check50 1. :) request-target of abc/hello.php returns error code 501 :) Requesting cat.exe returns error code 501 :( ...
0
votes
1answer
133 views

Pset 6 load and index, totally confused

When i run my code i get a error proxy could not be processed request. During check50 2 everything is red with no reason as to why, I am thinking its a seg fault but valgrind didn't give one. Honestly,...
0
votes
1answer
61 views

Pset6 Server seg fault in load and main (because of parse)

Server is functional and gives the correct output using the curl requests individually. However, using gdb, if I use curl to request hello.html after I've requested cat.html (specifically), I get a ...
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
69 views

Parse: Valgrind giving 4 unconditional jump errors on a test case file

I am doing pset6 and for the parse function I have first started to create about the same inputs in a seperate file and with printfs I have tried to slowly tackle the parse funtion by manually giving ...
0
votes
1answer
86 views

pset6 Server.c compiles but server not working

I'm convinced that the issues lie within my parse and/or load function but can't seem to identify them. Maybe I'm incorrectly allocating memory?? I'm not sure. Can someone please help me out? Here's ...
0
votes
1answer
98 views

pset6 2 errors with parse and lookup [duplicate]

i been stuck with these 2 errors for days which i don't really know what causes them..tried debugging parse and as far as i can tell abs_path is working as it should(although i'm not sure it's written ...
0
votes
1answer
57 views

problem with strcmp in pset6 parse

I was always getting the same 405 error no matter what so I used the debugger and I found my problem but I don't know how to fix it. The problem is method equals GET\377\377\177 and methodget equals "...
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
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
235 views

My code is not passing the checks. I am also unable to understand the error in my code. Please help

I am getting these checks :( HTTP/1.0 returns error code 505 \ expected output, not an exit code of 0 :( Method of 'abcGET' returns error code 405 \ expected output, not an exit ...
0
votes
1answer
189 views

Parse Function: Extra characters in string after using memcpy

My parse function works for the root directory, but for subsequent requests for, say, cat.jpg, the memcpy function seems to copy an extra \220 into both requesttarget and HTTPversion (so, for instance,...
0
votes
1answer
151 views

check50 is returning errors on pset6 but if I search the pages on browser all of the pages work [duplicate]

I am running check50 and get these errors: :) server.c exists :) server compiles :( Requesting cat.jpg returns 200, image/jpeg, and correct image :( Requesting cat.html returns 200, text/html, and ...
0
votes
1answer
323 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
1answer
54 views

Pset6 Parse - Array filling with weird values

So I've been fumbling over this for a little while now. When I copy the first i bytes of line to method, the server responds OK when the request_target is /. You can see I have a printf statement ...
0
votes
1answer
328 views

Pset6 parse function gives error 400

I am working on pset6 and I am having a hard time in parse function. I consistently take Error 400, so if anyone can give me a direction where my mistake is hiding it will be great! Below I have my ...
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
1answer
206 views

Failed to parse caesar.c

I am doing problem set 2 and i am getting the error Failed to parse caesar.c. The code passes all steps in check50 but no matter how I reformat the lines I cannot get it to work. I don't want to ...
0
votes
2answers
479 views

style50 failed to parse

style50 is giving me a "failed to parse" error message. In other words, style50 is not working. It is not able to parse thru my program. Any ideas on how to fix this?

1
2