Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
comp30023-2018-project-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neeserg Parajuli
comp30023-2018-project-1
Commits
4222cdb1
Commit
4222cdb1
authored
7 years ago
by
Neeserg Parajuli
Browse files
Options
Downloads
Patches
Plain Diff
working with comments
parent
559c10c8
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
GETheader.h
+3
-2
3 additions, 2 deletions
GETheader.h
form_response.c
+4
-2
4 additions, 2 deletions
form_response.c
server
+0
-0
0 additions, 0 deletions
server
server.c
+1
-1
1 addition, 1 deletion
server.c
with
8 additions
and
5 deletions
GETheader.h
+
3
−
2
View file @
4222cdb1
#ifndef GETheader
#define GETheader
#define BADREQUEST 40
0
#define BADREQUEST 40
4
#define FILENOTFOUND 404
#define PATHLEN 128
#define SUCCESS 200
struct
GET_header
{
...
...
This diff is collapsed.
Click to expand it.
form_response.c
+
4
−
2
View file @
4222cdb1
...
...
@@ -29,7 +29,7 @@ int formresponse(char buffer[BUFFERSIZE], struct RESP_header* header){
}
else
if
(
header
->
status
==
BADREQUEST
)
// 404 response header
else
if
(
header
->
status
==
FILENOTFOUND
)
// 404 response header
{
char
status
[
4
];
sprintf
(
status
,
"%d"
,
header
->
status
);
...
...
@@ -89,10 +89,12 @@ int sendresponse(int sockfd, struct GET_header* header){
break
;
}
if
(
send
(
sockfd
,
buffer
,
n_bytes
,
0
)
<
0
){
fclose
(
fp
);
return
-
1
;
}
}
fclose
(
fp
);
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
server
+
0
−
0
View file @
4222cdb1
No preview for this file type
This diff is collapsed.
Click to expand it.
server.c
+
1
−
1
View file @
4222cdb1
...
...
@@ -63,7 +63,7 @@ int main(int argc, char *argv[]){
if
(
listen
(
sockfd
,
MAXUSER
)
<
0
){
//listens on that socket
perror
(
"ERROR listening"
);
return
2
;
}
while
(
1
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment