Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nirmalathasa_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
Abhisha Nirmalathas
nirmalathasa_comp30023_2019_project-1
Commits
c2eaa8f5
Commit
c2eaa8f5
authored
Apr 28, 2019
by
Abhisha Nirmalathas
Browse files
Options
Downloads
Patches
Plain Diff
final check
parent
f3ca6eb9
No related branches found
No related tags found
2 merge requests
!2
Feat/cookie
,
!1
Feat/cookie
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
http-server.c
+1
-2
1 addition, 2 deletions
http-server.c
user.c
+0
-5
0 additions, 5 deletions
user.c
with
1 addition
and
7 deletions
http-server.c
+
1
−
2
View file @
c2eaa8f5
...
@@ -53,7 +53,6 @@ bool player_session(char* buff, int sockfd, char* file_name, char* response){
...
@@ -53,7 +53,6 @@ bool player_session(char* buff, int sockfd, char* file_name, char* response){
* */
* */
struct
stat
st
;
struct
stat
st
;
stat
(
file_name
,
&
st
);
stat
(
file_name
,
&
st
);
// printf("pre add %s\n", buff);
int
n
=
sprintf
(
buff
,
response
,
st
.
st_size
);
int
n
=
sprintf
(
buff
,
response
,
st
.
st_size
);
// send the header first
// send the header first
if
(
write
(
sockfd
,
buff
,
n
)
<
0
)
if
(
write
(
sockfd
,
buff
,
n
)
<
0
)
...
@@ -380,7 +379,6 @@ static void exit_handler(int sig){
...
@@ -380,7 +379,6 @@ static void exit_handler(int sig){
if
(
user_list
){
if
(
user_list
){
free_users
(
user_list
);
free_users
(
user_list
);
}
}
printf
(
"keep alive changed"
);
}
}
...
@@ -416,6 +414,7 @@ int main(int argc, char * argv[])
...
@@ -416,6 +414,7 @@ int main(int argc, char * argv[])
// if ip parameter is not specified
// if ip parameter is not specified
serv_addr
.
sin_addr
.
s_addr
=
inet_addr
(
argv
[
1
]);
serv_addr
.
sin_addr
.
s_addr
=
inet_addr
(
argv
[
1
]);
serv_addr
.
sin_port
=
htons
(
atoi
(
argv
[
2
]));
serv_addr
.
sin_port
=
htons
(
atoi
(
argv
[
2
]));
printf
(
"image_tagger server is now running at IP: %s on port %s
\n
"
,
argv
[
1
],
argv
[
2
]);
// bind address to socket
// bind address to socket
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
serv_addr
,
sizeof
(
serv_addr
))
<
0
)
if
(
bind
(
sockfd
,
(
struct
sockaddr
*
)
&
serv_addr
,
sizeof
(
serv_addr
))
<
0
)
{
{
...
...
This diff is collapsed.
Click to expand it.
user.c
+
0
−
5
View file @
c2eaa8f5
...
@@ -60,9 +60,6 @@ void resize_keywords(User* user, char* keyword){
...
@@ -60,9 +60,6 @@ void resize_keywords(User* user, char* keyword){
// adds keyword to user
// adds keyword to user
user
->
keywords
[
user
->
n_keywords
]
=
keyword
;
user
->
keywords
[
user
->
n_keywords
]
=
keyword
;
user
->
n_keywords
++
;
user
->
n_keywords
++
;
for
(
int
j
=
0
;
j
<
user
->
n_keywords
;
j
++
){
printf
(
"%d: %s
\n
"
,
j
,
user
->
keywords
[
j
]);
}
}
}
...
@@ -275,7 +272,6 @@ char* return_all_keywords(User* user){
...
@@ -275,7 +272,6 @@ char* return_all_keywords(User* user){
/**
/**
* Returns all the keywords for a particular user
* Returns all the keywords for a particular user
* */
* */
printf
(
"%d
\n\n\n
"
,
user
->
n_keywords
);
int
length
=
(
user
->
n_keywords
)
*
(
INITIAL_KEYWORD_LENGTH
+
3
);
int
length
=
(
user
->
n_keywords
)
*
(
INITIAL_KEYWORD_LENGTH
+
3
);
char
*
keywords
=
calloc
(
length
,
user
->
n_keywords
);
char
*
keywords
=
calloc
(
length
,
user
->
n_keywords
);
...
@@ -288,6 +284,5 @@ char* return_all_keywords(User* user){
...
@@ -288,6 +284,5 @@ char* return_all_keywords(User* user){
}
}
// terminating byte
// terminating byte
keywords
[
strlen
(
keywords
)
-
1
]
=
'\0'
;
keywords
[
strlen
(
keywords
)
-
1
]
=
'\0'
;
printf
(
"**** %s
\n
"
,
keywords
);
return
keywords
;
return
keywords
;
}
}
\ No newline at end of file
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