Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 12172

The problem set for Week 7

1 vote

Server.c failing with open ended query

It's OK for strtok() to return NULL if you send it GET /hello.php? HTTP/1.1 -- as long as you immediately check to see whether it returned NULL, and do something sensible if it did. (In this case, the …
hotwebmatter's user avatar
  • 3,050
0 votes

There is no /cs50/ folder in my appliance

The cs50 folder is not in your home directory. It is another user's home directory. Your userid is ubuntu, so your home directory is /home/ubuntu. The CS50 staff binaries are stored in /home/cs50, w …
hotwebmatter's user avatar
  • 3,050
5 votes
Accepted

PSET 6 Keeps Stopping Server

If you have set your current working directory to the pset directory via cd ~/workspace/pset6/, then you can simply start ./server public and it should work with the relative pathname, since . … /server /home/ubuntu/workspace/pset6/public. If this answers your question, be sure to accept my answer by clicking on the green check mark. …
hotwebmatter's user avatar
  • 3,050
1 vote
Accepted

abs_path continues to hold on to the previously stored path

Your second example makes it plain what is happening: GET /cat.html HTTP/1.1 buffer = /cat.html path = /cat.html GET / HTTP/1.1 buffer = /cat.php path = /cat.phpl You are writing over the content …
hotwebmatter's user avatar
  • 3,050
1 vote

Pset 6 - load - Help!

Hint: look at the top of the server.c distribution code for a symbolic constant define which suggests a good size (BYTES) for your buffer. Read in the file one byte at a time, incrementing a counter ( …
hotwebmatter's user avatar
  • 3,050
2 votes
Accepted

Alternative to multiple if statements?

You can refactor your code to use only one if statement! Think about the number of MIME types you have to check for, and the number of matching file extensions. Since there are the same number of ea …
hotwebmatter's user avatar
  • 3,050
0 votes

Segementation Issue in Pset 6

Where is tempStr declared? I'd like to see that line of code as well. There may be a typo there.
hotwebmatter's user avatar
  • 3,050
0 votes

Help with parse

For your first question, have you tried using strncmp() to compare the first character of the request substring buffer to "/" instead of comparing char literals? I haven't tried it your way, but that' …
hotwebmatter's user avatar
  • 3,050
0 votes

PSET6 Cannot Run Staff implementation from IDE

Relative pathnames start relative to the current working directory: cd /home/cs50/pset6 ./server or like this: cd /home/cs50 ./pset6/server or even like this: cd /home/ubuntu .. … /cs50/pset6/server When you type server by itself on a line, instead of . …
hotwebmatter's user avatar
  • 3,050