I cannot get the server to respond after sending a request. My code compiles and I checked with valgrind and had no issues. I have been using Code::Blocks IDE to help debug easier but have also used CS50 IDE. I have found that everything works OK until the request function is called ( which is pre written code ). I can enter a request but then it will hang in the 'while' loop inside of the request function until another request is entered but nothing is output. No error messages....nothing.

I compiled the incomplete version of server.c and ran it and expected to get a '501 not implemented' error as Prof Malan mentioned in the walkthrough but it did the same thing. No output. I ran the debugger and it is hanging in the same 'while' loop. My terminal looks exactly as Prof Malan's in the walkthrough vid but he gets a 'HTTP/1.1 200 OK' and I get nothing. No error messages, absolutely nothing.

I also tried the cs50 staff server and it will not work either.

I can use telnet and actually see being connected during debugging but once it steps into the request function and I enter a request it does not respond except continuing to expect input.

What I am doing wrong? It has not even made it to the code I have written!

  • Remember when testing with telnet you have to hit enter twice to send the request. Have you tried sending the request with curl? Apr 21, 2016 at 13:04

1 Answer 1


Thanks for the answer! That was most of my issue. I forgot to hit enter twice on the IDE's, sort of.....

I thought I had tried hitting enter twice while debugging with Code::Blocks. I checked again and it hangs. It works fine on everything else.

Code::Blocks debugging terminal seems to have an issue for me. It gave me a warning:

warning: GDB: Failed to set controlling terminal: Operation not permitted

but it then went on and let me connect and would take input but obviously I should have known better.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .