Questions tagged [parse]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
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
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 ...
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 ...
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 ...
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
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
57 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?
0
votes
1answer
63 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 ...
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 ==...
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
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
279 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
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
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
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
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
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 ...
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
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
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 [ "?" ...
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 ...
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
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 "...
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
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
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
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 ...
1
vote
1answer
144 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. ...
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
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
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
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
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 ...
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. ...
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: ...

1
2