Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tdenning_comp30023_2019_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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Terence Denning
tdenning_comp30023_2019_project-1
Commits
0520dd07
Commit
0520dd07
authored
Apr 18, 2019
by
Terence Denning
Browse files
Options
Downloads
Patches
Plain Diff
trimmed keyword
parent
0096f30d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.vscode/ipch/ab23cd8ac6e5a21a/http-server.ipch
+0
-0
0 additions, 0 deletions
.vscode/ipch/ab23cd8ac6e5a21a/http-server.ipch
http-server.c
+11
-3
11 additions, 3 deletions
http-server.c
server
+0
-0
0 additions, 0 deletions
server
with
11 additions
and
3 deletions
.vscode/ipch/ab23cd8ac6e5a21a/http-server.ipch
+
0
−
0
View file @
0520dd07
No preview for this file type
This diff is collapsed.
Click to expand it.
http-server.c
+
11
−
3
View file @
0520dd07
...
@@ -196,6 +196,11 @@ static bool handle_http_request(int sockfd)
...
@@ -196,6 +196,11 @@ static bool handle_http_request(int sockfd)
n
=
sprintf
(
buff
,
HTTP_200_FORMAT
,
size
);
n
=
sprintf
(
buff
,
HTTP_200_FORMAT
,
size
);
}
}
else
if
(
strstr
(
buff
,
"guess=Guess"
)
!=
NULL
)
{
else
if
(
strstr
(
buff
,
"guess=Guess"
)
!=
NULL
)
{
char
*
keyword
=
strstr
(
buff
,
"keyword="
)
+
8
;
int
keyword_length
=
strlen
(
keyword
);
keyword
[
keyword_length
-
12
]
=
'\0'
;
printf
(
"keyword is: %s
\n
"
,
keyword
);
if
(
sockfd
==
user1
){
if
(
sockfd
==
user1
){
if
(
user2_start
==
1
){
if
(
user2_start
==
1
){
webpage
=
"html/4_accepted.html"
;
webpage
=
"html/4_accepted.html"
;
...
@@ -253,8 +258,11 @@ static bool handle_http_request(int sockfd)
...
@@ -253,8 +258,11 @@ static bool handle_http_request(int sockfd)
return
false
;
return
false
;
}
}
}
else
{
}
else
{
printf
(
"%s
\n
"
,
buff
);
if
(
write
(
sockfd
,
buff
,
st
.
st_size
)
<
0
)
write
(
sockfd
,
buff
,
st
.
st_size
);
{
perror
(
"write"
);
return
false
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
server
+
0
−
0
View file @
0520dd07
No preview for this file type
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