Questions tagged [parse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
52 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
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
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
61 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
44 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
59 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
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
165 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
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
1answer
104 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
85 views

Help with parse

I'm getting two errors with check 50 and am struggling to understand how to go about this. :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 505 HTTP Version Not ...
1
vote
1answer
146 views

Parse wont pass check50

for some reason my code isnt passing: :( Two spaces after GET returns error code & :( Two spaces before HTTP/1.1 returns error code I cant see what would cause that. A previous question indicates ...
0
votes
1answer
55 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
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
162 views

PSET6 CS50 - How to Use Strtok()

I am using strtok() to split request_line into multiple variables. However, request_line is not being split correctly and I am receiving errors caused by using strtok(). How can I use strtok() to ...
1
vote
1answer
101 views

Pset6: Errors with Check50

When I use check50 to check my parse function, I find that check50 fails multiple tests and that the terminal generates multiple errors. I am using strtok to separate the request line into different ...
0
votes
1answer
76 views

Pset6 Parse: Failing HTTP & non-existant file

I've looked at other questions on this topic but none of the other code is structured like mine, making it hard to compare. I've fixed all the other errors except for two: :( HTTP/1.0 returns error ...
0
votes
1answer
123 views

PSET6 - PARSE() - Use of Undeclared Identifier Error

I get multiple errors when I try to compile parse, including errors about use of undeclared identifier. Why am I getting this error, even though I declared my variables and assigned them values? Here ...
0
votes
1answer
53 views

Pset6 Parse() - How to Approach

I've read the explanation and specification for parse, but I still do not know what I am supposed to do for parse. I've looked at other questions, but I am still confused about the objectives of parse....
0
votes
1answer
28 views

PSET 6 Parse Function:

Here is my code for the parse function for PSET6. I am not sure why I get the 501 fail. (I'm not told to do the one for 404). bool parse(const char* line, char* abs_path, char* query) { char* ...
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 ...
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
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
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?
0
votes
1answer
86 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
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
34 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
1answer
41 views

PSET6 Parse Segmentation Fault

My parse code seems to work fine but after it runs there is a segmentation fault. It isn't any of the other methods, and I just can't figure out why it is doing this. I think it has something to do ...
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
40 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
1answer
33 views

PSET 6 Problem with malloc() on parse function

I can't figure out this problem, I hope someone can help me. My server works perfectly only for the first HTTP request, but when I try to request something else, it throws me an error. This is a copy ...
0
votes
1answer
42 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
76 views

PSET6: PHP parser not working + different files from Check50?

3 hopefully 'quick' issues if someone could help? [Edit: full code now here for reference - http://pastebin.com/d1jTs1jV] 1) My query parser for php isn't working. I thought believe I've done it ...
0
votes
1answer
52 views

pset6 How to tackle check50 on .php?name=Alice

I only have this one problem left in check50. https://sandbox.cs50.net/checks/e3382282d5e64259adec1cc4f51b17de I'm pretty sure the problem is in "load" (but, I could be wrong). I know it is tricky ...
0
votes
1answer
44 views

pset6 parse function keeps failing check50 test. Why?

Please I have been trying different ways of soling this problem. Non seems to be working. I tried check50 and got these errors: :) server.c exists :) server compiles :) HTTP/1.0 returns error code ...
0
votes
1answer
28 views

pset6 parse sheck50 cat.exe, non-existant file and request target " error 301?

Help!! I'm currently struggling with Parse with check50 reporting three errors as follows: Here is the sandbox report And here is my parse code.. bool parse(const char* line, char* abs_path, char* ...
0
votes
2answers
3k views

Split a sentence ito an array of words without using strtok

I need to split a sentence contained in a char pointer into an array of words. I've tried several methods (as I cannot use strtok. The following method I used extracts the different words, but it ...
0
votes
2answers
61 views

pset6 server2 parse() strtok() NULL [solved]

This bug was first found here: pset6 server2 load() fseek() return -1 [SOLVED] I posted it here to distinguish it from that other bug. Check50: $ check50 2015.fall.pset6.server2 server.c :) server.c ...
0
votes
1answer
51 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
2answers
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, ...
1
vote
2answers
123 views

pset6 server fails check50

I can't find why this doesn't work, can someon help me? Thanks. My code fails the following in check50 server1: :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 ...
0
votes
1answer
46 views

pset server parse function check50 errors

I have troubles with the parse function in pset6 server.c. Only two items in the check fails. Im really struggling undertanding what the error messages means, anyone here that understands? If the ...
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
31 views

abs_path continues to hold on to the previously stored path

As mentioned in the title, the parameter abs_path retains its memory from the previous allocation, resulting in the outputs below. My buffer is reset to NULL on every call to parse() as char buffer[64]...
1
vote
1answer
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
1answer
125 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
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
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
60 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 ...