Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
2027459c
Commit
2027459c
authored
Sep 26, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testBasic -n MassiveRollback
Make sure to not receive more that buffer can fit currently
parent
e358ba2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
37 deletions
+43
-37
ndb/src/common/transporter/TCP_Transporter.cpp
ndb/src/common/transporter/TCP_Transporter.cpp
+43
-37
No files found.
ndb/src/common/transporter/TCP_Transporter.cpp
View file @
2027459c
...
@@ -362,50 +362,56 @@ TCP_Transporter::doReceive() {
...
@@ -362,50 +362,56 @@ TCP_Transporter::doReceive() {
// Select-function must return the socket for read
// Select-function must return the socket for read
// before this method is called
// before this method is called
// It reads the external TCP/IP interface once
// It reads the external TCP/IP interface once
int
size
=
receiveBuffer
.
sizeOfBuffer
-
receiveBuffer
.
sizeOfData
;
const
int
nBytesRead
=
recv
(
theSocket
,
if
(
size
>
0
){
receiveBuffer
.
insertPtr
,
maxReceiveSize
,
0
);
const
int
nBytesRead
=
recv
(
theSocket
,
receiveBuffer
.
insertPtr
,
if
(
nBytesRead
>
0
)
{
size
<
maxReceiveSize
?
size
:
maxReceiveSize
,
receiveBuffer
.
sizeOfData
+=
nBytesRead
;
0
);
receiveBuffer
.
insertPtr
+=
nBytesRead
;
if
(
receiveBuffer
.
sizeOfData
>
receiveBuffer
.
sizeOfBuffer
){
if
(
nBytesRead
>
0
)
{
receiveBuffer
.
sizeOfData
+=
nBytesRead
;
receiveBuffer
.
insertPtr
+=
nBytesRead
;
if
(
receiveBuffer
.
sizeOfData
>
receiveBuffer
.
sizeOfBuffer
){
#ifdef DEBUG_TRANSPORTER
#ifdef DEBUG_TRANSPORTER
ndbout_c
(
"receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)"
,
ndbout_c
(
"receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)"
,
receiveBuffer
.
sizeOfData
,
receiveBuffer
.
sizeOfBuffer
);
receiveBuffer
.
sizeOfData
,
receiveBuffer
.
sizeOfBuffer
);
ndbout_c
(
"nBytesRead = %d"
,
nBytesRead
);
ndbout_c
(
"nBytesRead = %d"
,
nBytesRead
);
#endif
#endif
ndbout_c
(
"receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)"
,
ndbout_c
(
"receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)"
,
receiveBuffer
.
sizeOfData
,
receiveBuffer
.
sizeOfBuffer
);
receiveBuffer
.
sizeOfData
,
receiveBuffer
.
sizeOfBuffer
);
report_error
(
TE_INVALID_MESSAGE_LENGTH
);
report_error
(
TE_INVALID_MESSAGE_LENGTH
);
return
0
;
return
0
;
}
}
receiveCount
++
;
receiveCount
++
;
receiveSize
+=
nBytesRead
;
receiveSize
+=
nBytesRead
;
if
(
receiveCount
==
reportFreq
){
if
(
receiveCount
==
reportFreq
){
reportReceiveLen
(
get_callback_obj
(),
remoteNodeId
,
receiveCount
,
receiveSize
);
reportReceiveLen
(
get_callback_obj
(),
remoteNodeId
,
receiveCount
,
receiveSize
);
receiveCount
=
0
;
receiveCount
=
0
;
receiveSize
=
0
;
receiveSize
=
0
;
}
return
nBytesRead
;
}
else
{
#if defined DEBUG_TRANSPORTER
ndbout_c
(
"Receive Failure(disconnect==%d) to node = %d nBytesSent = %d "
"errno = %d strerror = %s"
,
DISCONNECT_ERRNO
(
InetErrno
,
nBytesRead
),
remoteNodeId
,
nBytesRead
,
InetErrno
,
(
char
*
)
ndbstrerror
(
InetErrno
));
#endif
if
(
DISCONNECT_ERRNO
(
InetErrno
,
nBytesRead
)){
// The remote node has closed down
doDisconnect
();
report_disconnect
(
InetErrno
);
}
}
}
return
nBytesRead
;
return
nBytesRead
;
}
else
{
}
else
{
#if defined DEBUG_TRANSPORTER
return
0
;
ndbout_c
(
"Receive Failure(disconnect==%d) to node = %d nBytesSent = %d "
"errno = %d strerror = %s"
,
DISCONNECT_ERRNO
(
InetErrno
,
nBytesRead
),
remoteNodeId
,
nBytesRead
,
InetErrno
,
(
char
*
)
ndbstrerror
(
InetErrno
));
#endif
if
(
DISCONNECT_ERRNO
(
InetErrno
,
nBytesRead
)){
// The remote node has closed down
doDisconnect
();
report_disconnect
(
InetErrno
);
}
}
}
return
nBytesRead
;
}
}
void
void
...
...
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