Skip to content
Snippets Groups Projects
Commit b63f2194 authored by Neeserg Parajuli's avatar Neeserg Parajuli
Browse files

server passes all the tests

parent 8c512ca2
Branches
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ int sendresponse(int sockfd, struct GET_header* header){
strcpy(resphead.httpversion, header->httpversion);
resphead.status = 404;
formresponse(buffer, &resphead);
return send(sockfd, buffer, BUFFERSIZE, 0);
return send(sockfd, buffer, strlen(buffer), 0);
}
else{
......@@ -74,10 +74,10 @@ int sendresponse(int sockfd, struct GET_header* header){
if(getfiletype(header->filepath, &resphead)!=0){
formresponse(buffer, &resphead);
fclose(fp);
return send(sockfd, buffer, BUFFERSIZE, 0);
return send(sockfd, buffer,strlen(buffer), 0);
}
formresponse(buffer, &resphead);
if(send(sockfd, buffer, BUFFERSIZE, 0)<0){
if(send(sockfd, buffer,strlen(buffer), 0)<0){
return -1;
}
while(!feof(fp)){
......
No preview for this file type
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
ERROR sending: Connection reset by peer
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment