Skip to content

Commit 676b8fe

Browse files
committed
Fix problem with TDS packets longer than packet size
1 parent c2e8bf2 commit 676b8fe

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ RDBMS support for the XP Framework: MySQL, Sybase, MSSQL, PostgreSQL, SQLite3, I
33

44
## ?.?.? / ????-??-??
55

6+
* Fix problem with TDS packets longer than packet size - @thekid
7+
68
## 6.4.0 / 2015-07-12
79

810
* Added forward compatibility with XP 6.4.0 - @thekid

src/main/php/rdbms/tds/TdsDataStream.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ protected function readFully($length) {
231231
* @throws rdbms.tds.TdsProtocolException
232232
*/
233233
protected function read0($length) {
234-
while (-1 === $length || strlen($this->buffer) < $length) {
234+
while (-1 === $length || 0 === $this->header['status'] || strlen($this->buffer) < $length) {
235235
if (1 === $this->header['status']) return strlen($this->buffer);
236236

237237
$bytes= $this->readFully(8);

0 commit comments

Comments
 (0)