Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Container 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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
c6e8552f
Commit
c6e8552f
authored
23 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Added debugging to cleanup().
parent
9c543107
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/ftpsrvr.c
+13
-10
13 additions, 10 deletions
src/sbbs3/ftpsrvr.c
with
13 additions
and
10 deletions
src/sbbs3/ftpsrvr.c
+
13
−
10
View file @
c6e8552f
...
...
@@ -4233,8 +4233,11 @@ static void ctrl_thread(void* arg)
,
sock
,
active_clients
,
thread_count
);
}
static
void
cleanup
(
int
code
)
static
void
cleanup
(
int
code
,
int
line
)
{
#ifdef _DEBUG
lprintf
(
"0000 cleanup called from line %d"
,
line
);
#endif
free_cfg
(
&
scfg
);
if
(
server_socket
!=
INVALID_SOCKET
)
...
...
@@ -4364,7 +4367,7 @@ void DLLCALL ftp_server(void* arg)
sbbs_random
(
10
);
/* Throw away first number */
if
(
!
winsock_startup
())
{
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
...
...
@@ -4375,7 +4378,7 @@ void DLLCALL ftp_server(void* arg)
#ifdef _WIN32
if
((
socket_mutex
=
CreateMutex
(
NULL
,
FALSE
,
NULL
))
==
NULL
)
{
lprintf
(
"!ERROR %d creating socket_mutex"
,
GetLastError
());
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
#endif
...
...
@@ -4388,7 +4391,7 @@ void DLLCALL ftp_server(void* arg)
if
(
!
load_cfg
(
&
scfg
,
NULL
,
TRUE
,
error
))
{
lprintf
(
"!ERROR %s"
,
error
);
lprintf
(
"!Failed to load configuration files"
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
...
...
@@ -4399,7 +4402,7 @@ void DLLCALL ftp_server(void* arg)
if
((
t
=
checktime
())
!=
0
)
{
/* Check binary time */
lprintf
(
"!TIME PROBLEM (%ld)"
,
t
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
}
...
...
@@ -4436,7 +4439,7 @@ void DLLCALL ftp_server(void* arg)
if
((
server_socket
=
ftp_open_socket
(
SOCK_STREAM
))
==
INVALID_SOCKET
)
{
lprintf
(
"!ERROR %d opening socket"
,
ERROR_VALUE
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
...
...
@@ -4450,7 +4453,7 @@ void DLLCALL ftp_server(void* arg)
,(
char
*
)
&
linger
,
sizeof
(
linger
)))
!=
0
)
{
lprintf
(
"%04d !ERROR %d (%d) setting socket options."
,
server_socket
,
result
,
ERROR_VALUE
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
#endif
...
...
@@ -4469,14 +4472,14 @@ void DLLCALL ftp_server(void* arg)
lprintf
(
"%04d !ERROR %d (%d) binding socket to port %u"
,
server_socket
,
result
,
ERROR_VALUE
,
startup
->
port
);
lprintf
(
"%04d %s"
,
server_socket
,
BIND_FAILURE_HELP
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
if
((
result
=
listen
(
server_socket
,
1
))
!=
0
)
{
lprintf
(
"%04d !ERROR %d (%d) listening on socket"
,
server_socket
,
result
,
ERROR_VALUE
);
cleanup
(
1
);
cleanup
(
1
,
__LINE__
);
return
;
}
...
...
@@ -4588,7 +4591,7 @@ void DLLCALL ftp_server(void* arg)
lprintf
(
"000 Done waiting"
);
}
cleanup
(
0
);
cleanup
(
0
,
__LINE__
);
if
(
recycle_server
)
lprintf
(
"Recycling server..."
);
...
...
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