Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
9f4df1e7
Commit
9f4df1e7
authored
Nov 15, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several bugs
parent
87dd268b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
12 deletions
+56
-12
remote/exe/rs_remote_tcpip/src/rs_remote_tcpip.c
remote/exe/rs_remote_tcpip/src/rs_remote_tcpip.c
+56
-12
No files found.
remote/exe/rs_remote_tcpip/src/rs_remote_tcpip.c
View file @
9f4df1e7
/*
* Proview $Id: rs_remote_tcpip.c,v 1.
3 2006-04-24 13:22:2
4 claes Exp $
* Proview $Id: rs_remote_tcpip.c,v 1.
4 2007-11-15 14:57:4
4 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
...
...
@@ -310,11 +310,12 @@ void Shutdown()
{
int
sts
;
sts
=
shutdown
(
c_socket
,
2
);
if
(
debug
)
printf
(
"shutdown: %d
\n
"
,
sts
);
if
(
debug
&&
(
sts
<
0
))
perror
(
"shutdown"
);
if
(
cs_mode
==
TCP_CLIENT
)
{
if
(
cs_mode
==
TCP_SERVER
)
{
sts
=
close
(
c_socket
);
}
else
{
sts
=
shutdown
(
c_socket
,
2
);
if
(
debug
)
printf
(
"shutdown: %d
\n
"
,
sts
);
if
(
debug
&&
(
sts
<
0
))
perror
(
"shutdown"
);
sts
=
close
(
c_socket
);
if
(
debug
)
printf
(
"close: %d
\n
"
,
sts
);
if
(
debug
&&
(
sts
<
0
))
perror
(
"close"
);
...
...
@@ -325,7 +326,7 @@ void Shutdown()
/*************************************************************************
**************************************************************************
*
* Namn : TreatRemtrans
* Namn : TreatRemtrans
1
*
* Typ : unsigned int
*
...
...
@@ -336,7 +337,7 @@ void Shutdown()
**************************************************************************
**************************************************************************/
void
TreatRemtrans
(
char
*
buf
)
void
TreatRemtrans
1
(
char
*
buf
)
{
remtrans_item
*
remtrans
;
unsigned
char
search_remtrans
;
...
...
@@ -371,6 +372,43 @@ void TreatRemtrans(char *buf)
if
(
search_remtrans
)
rn_tcp
->
ErrCount
++
;
return
;
}
/*************************************************************************
**************************************************************************
*
* Namn : TreatRemtrans2
*
* Typ : unsigned int
*
* Typ Parameter IOGF Beskrivning
*
* Beskrivning :
*
**************************************************************************
**************************************************************************/
void
TreatRemtrans2
(
char
*
buf
,
int
size
)
{
remtrans_item
*
remtrans
;
unsigned
char
search_remtrans
;
unsigned
int
sts
;
/* Start searching remtrans */
remtrans
=
rn
.
remtrans
;
search_remtrans
=
true
;
while
(
remtrans
&&
search_remtrans
)
{
/* Match? */
if
(
remtrans
->
objp
->
Direction
==
REMTRANS_IN
)
{
search_remtrans
=
false
;
sts
=
RemTrans_Receive
(
remtrans
,
buf
,
size
);
}
remtrans
=
(
remtrans_item
*
)
remtrans
->
next
;
}
if
(
search_remtrans
)
rn_tcp
->
ErrCount
++
;
return
;
}
/*************************************************************************
**************************************************************************
...
...
@@ -431,7 +469,7 @@ unsigned int Receive()
{
memcpy
(
&
saved_buffer
[
saved_size
],
&
receive_buffer
,
expected_rest
);
TreatRemtrans
(
saved_buffer
);
TreatRemtrans
1
(
saved_buffer
);
/* Set position in data buffer */
...
...
@@ -444,7 +482,13 @@ unsigned int Receive()
while
(
more_messages
)
{
if
(
data_size
>=
sizeof
(
remote_tcp_header
))
if
(
data_size
>
0
&&
rn_tcp
->
DisableHeader
)
{
/* Header disabled, take the first receive remtrans object */
TreatRemtrans2
(
receive_buffer
,
data_size
);
}
else
if
(
data_size
>=
sizeof
(
remote_tcp_header
))
{
memcpy
(
&
header
,
&
receive_buffer
[
buf_ix
],
sizeof
(
remote_tcp_header
));
...
...
@@ -461,7 +505,7 @@ unsigned int Receive()
{
if
(
header
.
msg_size
>
sizeof
(
header
))
/* Not keepalive buffer */
{
TreatRemtrans
(
&
receive_buffer
[
buf_ix
]);
TreatRemtrans
1
(
&
receive_buffer
[
buf_ix
]);
}
else
if
(
header
.
msg_size
==
sizeof
(
header
))
/* Keepalive buffer */
rn_tcp
->
KeepaliveDiff
--
;
...
...
@@ -483,7 +527,7 @@ unsigned int Receive()
else
/* Too short */
rn_tcp
->
ErrCount
++
;
if
(
header
.
msg_size
>
0
&&
!
saved_fl
)
if
(
!
rn_tcp
->
DisableHeader
&&
header
.
msg_size
>
0
&&
!
saved_fl
)
{
data_size
-=
header
.
msg_size
;
buf_ix
+=
header
.
msg_size
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment