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
9ad7007a
Commit
9ad7007a
authored
20 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
A little clean-up of Unix/stdio support.
Use sendsocket() (xpdev macro) instead of send().
parent
4f506681
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/sexyz.c
+9
-13
9 additions, 13 deletions
src/sbbs3/sexyz.c
with
9 additions
and
13 deletions
src/sbbs3/sexyz.c
+
9
−
13
View file @
9ad7007a
...
...
@@ -223,7 +223,7 @@ char *chr(uchar ch)
void
send_telnet_cmd
(
SOCKET
sock
,
uchar
cmd
,
uchar
opt
)
{
uchar
buf
[
3
];
uchar
buf
[
3
];
buf
[
0
]
=
TELNET_IAC
;
buf
[
1
]
=
cmd
;
...
...
@@ -232,11 +232,8 @@ void send_telnet_cmd(SOCKET sock, uchar cmd, uchar opt)
if
(
debug_telnet
)
lprintf
(
LOG_DEBUG
,
"Sending telnet command: %s %s"
,
telnet_cmd_desc
(
buf
[
1
]),
telnet_opt_desc
(
buf
[
2
]));
#ifdef __unix__
if
((
stdio
?
write
(
STDOUT_FILENO
,
buf
,
sizeof
(
buf
))
:
send
(
sock
,
buf
,
sizeof
(
buf
),
0
))
!=
sizeof
(
buf
)
&&
debug_telnet
)
#else
if
(
send
(
sock
,
buf
,
sizeof
(
buf
),
0
)
!=
sizeof
(
buf
)
&&
debug_telnet
)
#endif
if
(
sendsocket
(
sock
,
buf
,
sizeof
(
buf
))
!=
sizeof
(
buf
)
&&
debug_telnet
)
lprintf
(
LOG_ERR
,
"FAILED"
);
}
...
...
@@ -265,7 +262,7 @@ int recv_byte(void* unused, unsigned timeout)
FD_SET
(
STDIN_FILENO
,
&
socket_set
);
else
#endif
FD_SET
(
sock
,
&
socket_set
);
FD_SET
(
sock
,
&
socket_set
);
if
((
t
=
end
-
msclock
())
<
0
)
t
=
0
;
tv
.
tv_sec
=
t
/
MSCLOCKS_PER_SEC
;
tv
.
tv_usec
=
0
;
...
...
@@ -282,9 +279,8 @@ int recv_byte(void* unused, unsigned timeout)
if
(
stdio
)
i
=
read
(
STDIN_FILENO
,
&
ch
,
sizeof
(
ch
));
else
i
=
recv
(
sock
,
&
ch
,
sizeof
(
ch
),
0
);
#else
i
=
recv
(
sock
,
&
ch
,
sizeof
(
ch
),
0
);
i
=
recv
(
sock
,
&
ch
,
sizeof
(
ch
),
0
);
#endif
if
(
i
!=
sizeof
(
ch
))
{
...
...
@@ -396,7 +392,7 @@ int send_byte(void* unused, uchar ch, unsigned timeout)
FD_SET
(
STDOUT_FILENO
,
&
socket_set
);
else
#endif
FD_SET
(
sock
,
&
socket_set
);
FD_SET
(
sock
,
&
socket_set
);
tv
.
tv_sec
=
timeout
;
tv
.
tv_usec
=
0
;
...
...
@@ -413,7 +409,7 @@ int send_byte(void* unused, uchar ch, unsigned timeout)
i
=
write
(
STDOUT_FILENO
,
buf
,
len
);
else
#endif
i
=
send
(
sock
,
buf
,
len
,
0
);
i
=
send
socket
(
sock
,
buf
,
len
);
if
(
i
==
len
)
{
if
(
debug_tx
)
...
...
@@ -470,7 +466,7 @@ void output_thread(void* arg)
FD_SET
(
STDOUT_FILENO
,
&
socket_set
);
else
#endif
FD_SET
(
sock
,
&
socket_set
);
FD_SET
(
sock
,
&
socket_set
);
i
=
select
(
sock
+
1
,
NULL
,
&
socket_set
,
NULL
,
&
tv
);
if
(
i
==
SOCKET_ERROR
)
{
...
...
@@ -497,7 +493,7 @@ void output_thread(void* arg)
i
=
write
(
STDOUT_FILENO
,
(
char
*
)
buf
+
bufbot
,
buftop
-
bufbot
);
else
#endif
i
=
sendsocket
(
sock
,
(
char
*
)
buf
+
bufbot
,
buftop
-
bufbot
);
i
=
sendsocket
(
sock
,
(
char
*
)
buf
+
bufbot
,
buftop
-
bufbot
);
if
(
i
==
SOCKET_ERROR
)
{
if
(
ERROR_VALUE
==
ENOTSOCK
)
lprintf
(
LOG_ERR
,
"client socket closed on send"
);
...
...
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