Questions tagged [server]

Questions about server.c in pset6.

Filter by
Sorted by
Tagged with
0
votes
1answer
250 views

server.c hello.php outputs correctly only when query manually typed

I am almost done with server.c, everything works fine except that hello.php outputs error 404 when the query is submitted from hello.html, if I manually type https://ide50-rafaell12.cs50.io/hello.php?...
2
votes
1answer
2k views

Server.c pset6 issues

I am currently going through server.c in pset 6. this is server.c: https://gist.github.com/anonymous/5b24f101bf5d53018cbc my functions: lookup: https://gist.github.com/anonymous/...
0
votes
0answers
596 views

pset6 server.c check50 showing: unexpected end of input

I finished my server.c, and everything works well on the server. When I used "check50 2015.fall.pset6.server1 server.c" after parse, everything is green, but when I tried "check50 2015.fall.pset6....
0
votes
1answer
1k views

Server.c Indexes function outputs weird code

I am pretty sure my other functions work - I pass all check50, except for the last line in check50 server1, where it's written TODO and the same for check50 server2. However, when I ran server in IDE,...
0
votes
1answer
635 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
330 views

Invalid write in load (server.c)

I have been stumbling over load for a couple of days now. Here's my code: bool load(FILE* file, BYTE** content, size_t* length) { printf("load started \n"); // initialize content and its ...
1
vote
1answer
220 views

server.c indexes - what is to be done?

This is silly, I did the parsing engine, the locate, straight forward. However, I have no idea what I am supposed to do for indexes. Yes, I read the instructions but they make no sense. "that the ...
1
vote
2answers
128 views

PSET6 server: Make server error - Please please help =(

I was almost finished debugging server.c (the only thing that didn't work was that I was getting a 404 error when submitting my query on hello.html) by using gdb. When I thought I'd noticed what the ...
1
vote
1answer
375 views

pset6: /hello.php?name=david shows up in URL but hello.html page content loads

Currently working on pset6 server.c. All of my pages load properly except for one thing: when I submit a name in the text box from hello.html, the query properly shows up in the URL, but the hello....
0
votes
1answer
480 views

How to test own code pset6 server 2016?

After first submit for pset6 server.c, I've got only 0 (zeros). Even if part of test should pass, i.e. Requesting cat.html returns 200, text/html, and correct file. When I run server and use in ...
1
vote
1answer
1k views

How to start with load function in server.c?

I've got problems with implementing load function in server.c. I know general pseudocode, but when it comes to deciding which type variables do I need, I'm a bit stuck. Can someone help me with this?
0
votes
1answer
184 views

Broken image cat.jpg? [duplicate]

Thanks to an answer on an earlier question tonight, server.c seems to work perfectly on every file except for cat.jpg. I checked in GDB, and the path is processing perfectly, as is the MIME type. But ...
0
votes
1answer
2k views

Realloc error in server.c: invalid next size

Okay, I think I'm having trouble understanding realloc. It seems to me that I've done things right, though I'm sure I'm missing a very obvious mistake. Here's the relevant part of my load function: ...
0
votes
0answers
152 views

Pset 6 Server Seg Fault when fread hello.php

All my code works except for loading or executing hello.php. When running GDB it seemed like I got seg fault in the fread line of my code. The same piece of code works fine for html and jpg, thou. ...
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
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
234 views

pset6 server.c ide50 400 Bad Request

I am doing pset6 (for the second time) and have it all working on the new platform (ide50), however when I load my workspace's domain I get a 400 Bad Request message but otherwise the page loads as it ...
0
votes
1answer
32 views

server gives same error code with different conditions

Below I'm validating the request-line conforms to the spec (printf statements were telling me the errors were from these if statements). The first 3 blocks worked fine independently and together. (e....
0
votes
1answer
91 views

Server ensure path exists

In server.c to ensure the path exists I use this code: if (access(path, F_OK) == -1) { error(404); continue; } This leads to a 404 error even when the path exists. For example, if the ...
0
votes
1answer
223 views

Help needed with query code for pset6

I have almost completed pset 6 but am having trouble with the php part in terms of the query not going through properly to the dynamic content string. Specifically the name. I copy the query to memory ...
0
votes
1answer
332 views

pset6 problem with webserver [duplicate]

I finished pset6 (No, not really!) :( when i test the webserver as follows: enter my appliance IP followed by port 8080 then /cat.jpg i got: 505 HTTP Version Not Supported does anyone know what is ...
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 ...
1
vote
2answers
322 views

pset6 (server.c) - 404 not found with /cat.jpg, but works with other files

I have been having trouble with server.c My version seems to work with hello.html. However, when I try and use the following with telnet GET /cat.jpg HTML/1.1 I get HTTP/1.1 404 file not found ...
0
votes
1answer
196 views

Pset6 (Server.c) Segmentation Fault, Unitialized values

I am getting a segmentation fault when I try to run access a page using the server, as well as 404 and 403 errors. I used Valgrind, and it states "Conditional jump or move depends on uninitialised ...
0
votes
1answer
188 views

PSET6 405 Method not allowed

I'm getting the 405 Method not allowed when I run my server with the public directory. Moreover, if I exclude the piece of code which checks for GET method, I get a segmantation fault. I've attached ...
0
votes
1answer
364 views

pset6: problem parsing the request line in server.c

I feel like I'm going in circles trying to parse the request line into its constituents. It looks like method and requesttarget are ok, but I keep getting too many characters for HTTPver. For "GET / ...
0
votes
0answers
157 views

Pset6 Error 404/odd results - prob with my concatenation?

I get some odd results when I try to run my server. Specifically, I get no errors, but also no content when I search for hello.html; I get error 501 (not implemented) when I search for cat.jpg ...
0
votes
0answers
175 views

pset6 internal server error 500, debugged and variables all correct, need help!

I cannot get past this error, internal server error 500. I have debugged using printf and all variables are holding the right values (request target, absolute path, path). I added a printf line to the ...
0
votes
0answers
300 views

telnet error (was working fine) now unable to resolve name/service not known

I had been happily testing my server.c code using telnet, resolved several issues and was tackling the last error when telnet stopped working. I entered the same command as I had done 50 times before, ...
0
votes
1answer
182 views

Pset6 respond to client

I'v almost finished pset6 server.c. Whenever I use it wiht telnet it works fine however it shows page unavailable when I try with the browser. Is there something else I should add for the respond to ...
0
votes
0answers
403 views

Segmentation Fault caused by strlen in server.c. Am I supposed to allocate something here?

Having some issues with my server.c code. When obtaining the length of one of the Request Tokens using strlen, it causes a Segment Fault. Is there something I need to be allocating to the heap? How ...
0
votes
1answer
148 views

Why is the additional CRLF in static content so important in pset6 server?

I have finished the server TODOS and all seem to be working. I realized that probably the least explained part of the TODOs was the most important 3 lines of code (at least for me). It's this part: ...
1
vote
0answers
462 views

No error messages but also no success when running SERVER from CS50 pset6. Help?

Hey so basically I've implemented code for lookup, load, and parse that compiles and (in my own eyes) should work logically. When I run it, the program tells me "Get HTML/1.1" but then nothing on my ...
0
votes
1answer
316 views

PSET6 - No Data Received AND No Errors

This is the very last thing I seem to have to fix here. Telnet and GDB are returning no errors, but when I try to use my server.c in Chrome, I don't get the requested page. Instead, I get an error on ...
0
votes
1answer
230 views

PSET6 - server.c - 505 Error

When I try to run server.c, it's returning the 505 error, which is very confusing to me. I built the code separating everything out in a separate .c file to make sure everything works correctly, and I ...
0
votes
1answer
266 views

strcat doesn't work

I've finished all the TODO's now, but I'm having trouble concatenating absolute path and root. I've been all day trying different ways to do it, but still doesn't work. I hope someone can help. Here'...
0
votes
1answer
118 views

What format is the PHP interpreter expecting a query?

I've managed to successfully extract a query from the target, but in order to configure it properly I need to know what to put into the "query" string variable. I've hunted a bit and experimented but ...
0
votes
1answer
216 views

can't wrap my head around extracting a request from request-line [duplicate]

I don't understand how is request-line extracted from request in the distribution code. I can't visualize it. // extract request's request-line // http://www.w3.org/Protocols/rfc2616/rfc2616-sec5....
0
votes
1answer
9k views

How to fix the `unused variable` error?

I understand how to extract the query from request line, but when I make the program, it gives me the error unused variable query although it's used later in the code. I don't know what's wrong. here ...
0
votes
1answer
93 views

a question about(extracting queries and extensions in a request line )

I am trying to extract the query and the extension from request-line but i don't know what's the maximum length of a query and a file extension so that I can know the size of the char array to store ...
0
votes
1answer
132 views

a question about queries in request line

i'm in the (extract query from request-target) part of the problem set. are queries always accompanied by a PHP file and always have the form(q= something)?
0
votes
1answer
320 views

pset6(server) - Files fail to load on web browser

I'm having trouble getting the web browser to load the files I'm attempting to access. I know I've correctly identified 'path' and when I pull up the web browser I get the 200 OK response but nothing ...
0
votes
1answer
175 views

hello.html ERR_ADDRESS_UNREACHABLE

I'm not able to reach the hosted html files outside of the appliance. Within the appliance everything works great. However, as soon as I try from chrome in windows I immediately get an ...
0
votes
1answer
74 views

Segementation Issue in Pset 6

I am trying to implement Pset6 but I'm having a huge problem with segmentation faults caused by strstr or strchr. The offending lines are printf("OK %s\n", reqLine); tempStr = strstr(reqLine, "HTTP/...
0
votes
1answer
280 views

Server.c 200 but nothing appears

I was able to do all the TODOs, however, when I visit the public/cat.html, I get a blank page. I think I messed up somewhere. lookup() works, I could validate the request line, I could extract the ...
0
votes
0answers
136 views

Server can display all other files except the response for hello.html

I am currently working on server.c and my server can display all other files except the response for hello.html, which is hello.php. I have tried things such as deleting the query part after .php and ...
0
votes
1answer
134 views

Server Doesn't Load Files even the Status is 200

I am currently working on the server pset however my server doesn't load the files even if the status printed in the terminal is 200. Also if I refresh the page it will be changed to 404. Can someone ...
0
votes
1answer
250 views

Server successfully implemented, but unable to display page

As shown, I've set all files (hello.html, cat.html, cat.jpg) to be readable. But when I try to go onto those locations on my local web-browsers what came up was a blank page for hello.html and this (...
0
votes
1answer
169 views

PSET6 Web Server: Static contents work while dynamic leads to a seg fault

I've browsed the questions asked, many of them helped to fix my code but I'm facing a last challenge and I've no idea how to pass it. Every test made with "cat.jpg", "cat.html" or "hello.html" works ...