Questions tagged [parse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
585 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
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 ...
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, ...
1
vote
1answer
66 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 ...
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 ...
1
vote
1answer
55 views

Parse: Question mark part of absolute path or query?

Just wanted to ask if ? is part of absolute path or query or is it seperate from both query and absolute path?
1
vote
1answer
69 views

Pset6 parse getting error 501

So, I've finished parse except that whenever I run my code I get error 501 every time. I've figured out that it's also checking the next value in this condition if(strcasecmp (&path [0],"/") != 0)...
1
vote
1answer
69 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 ==...
1
vote
1answer
271 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 ...
1
vote
1answer
50 views

Bug on staff's solution? pset6 parse() does not give 400 Error for double quote

I was expecting to see error 400 when I entered [amy"white] in the name box using staff's solution. It didn't. Is this expected or am I missing something? Thanks!
1
vote
1answer
143 views

PSET 6: parse using strtok

I want to parse the line variable using the strtok function using " " as the delimiter. However, its not clear to me how to store the method, request_target and http_version variables using strtok. ...
1
vote
1answer
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 ...
1
vote
1answer
59 views

Parse: Where did cat.exe come from?

I have just finished lookup and parse function and for the first time when I tried to run the first check50 I am getting 2 errors, one for cat.exe and the other one for non-exsistant file, but I dont ...
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 ...
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
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 ...
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
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
32 views

Pset6 Web-server - Storing a char* at address of argument(parameter)

Pset6 Web-server... In Parse function, how do you store absolute-path at the address in abs_path? bool parse(char* line, char* abs_path, char* query) { char* absolute-path; // assume I've ...
0
votes
1answer
632 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 ...
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
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* ...
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
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
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
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
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
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
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
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 ...
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
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]...
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
113 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 ...
0
votes
1answer
62 views

Pset6 - check50 missing cat.exe and non-existant file request

I've been checking similar questions about the problem I'm having but couldn't solve it myself. Help would be really appreciated. After implementing lookup and parse and running check50 I'm receiving ...
0
votes
1answer
278 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
1answer
96 views

pset6 parse HTTP/1.1 error

I can't figure out why I have this error. Here is my code: bool parse(const char* line, char* abs_path, char* query) { char*...
0
votes
2answers
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
1answer
69 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
1answer
114 views

absolute-path [ “?” query ]

Can you explain what this means: the only one of which your server needs to support is absolute-path [ "?" query ]. Does this mean thats the format of it? It would look like GET absolute-path [ "?" ...
0
votes
1answer
70 views

PSET6 Parse, error 404 (non-existant file)

I'm still struggling with my parse function. The only check50 test I now fail is the one for error 404, where I get 501 not implemented. I've been on it for hours and hours and can't find the bug. I ...
0
votes
1answer
157 views

CS50 parse function, HTTP version

I'm working on parse for pset6 and for some reason I can't correctly check the HTTP version. Check50 gives me "\ expected output, not an exit code of 0" which I understand stands for segmentation ...
0
votes
1answer
91 views

PSET6 check50 server1 cat.exe and non-existant file return error 505

So, i have looked everywhere for the answer to why my program returns error 505 for cat.exe and non-existant file. I have tested isolating the two functions but they work fine outside of the main ...
0
votes
1answer
79 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 "...