Jump to content
johnsvici

Ajutor - Tiny webserver C in UNIX . TCPIP - big problem.

Recommended Posts

Salut! Sunt la fac  iar unul din modulele pe care le urmez este TCPIP ( desi sunt putin paralel cu ceea ce inseamna programarea ) . Ideea este ca pentru a intra in examen trebuie sa fac un server in C in UNIX . In documentul pe care profu ni l-a dat este inceputul codului, iar mai apoi urmeaza 3 exercitii care trebuie integrate in cod, iar aici apar problemele . Nu reusesc nici de cum sa le rezolv si nici nu mai postam aici daca nu aveam nevoie neaparata de numarul de credite.. stiu ca nimeni nu e obligat sa faca ceva in privinta asta, dar cei care au cunostinte si pot sa ofere o mana de ajutor, as aprecia enorm . Daca este necesar, pot sa platesc si "ajutorul" ..

PDF OFERIT DE PROFESOR

CODUL OFERIT

Cerinte

Enhance the web server so that only GET requests will be processed. Extract the file name from the GET request and sent the contents of that file to the client. Map GET / to GET index.html. Prevent absolute paths and the relative path .. being used in the request. This restricts the webserver to the chosen document root folder.

Update your web server program to use child processes for each client request. Print all error messages to stderr.

Check if the client request ask for valid file extension. Supply the correct MIME type in the HTTP header of your answer to the client.

 

https://ufile.io/i2xuf aici este modelul unui coleg dar in momentul in care compilez, are diferite erori 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...