Skip to content
Snippets Groups Projects
Commit 9855ff5d authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Bugfix in handling of splitted packets.

Rev: lib/modules/Sql.pmod/tds.pike:1.8
parent db22f4ad
No related branches found
No related tags found
No related merge requests found
/* /*
* $Id: tds.pike,v 1.7 2006/02/10 16:03:52 grubba Exp $ * $Id: tds.pike,v 1.8 2006/02/10 16:28:31 grubba Exp $
* *
* A Pike implementation of the TDS protocol. * A Pike implementation of the TDS protocol.
* *
...@@ -453,11 +453,11 @@ static { ...@@ -453,11 +453,11 @@ static {
tds_error("Sending packet on busy connection!\n"); tds_error("Sending packet on busy connection!\n");
} }
string packet = (string) p; array(string) packets = ((string) p)/512.0;
foreach(packet/512.0, string raw) { foreach(packets; int i; string raw) {
// NOTE: Network byteorder!! // NOTE: Network byteorder!!
raw = sprintf("%1c%1c%2c\0\0%1c\0%s", raw = sprintf("%1c%1c%2c\0\0%1c\0%s",
flag, last, flag, (i == (sizeof(packets)-1)) && last,
sizeof(raw) + 8, sizeof(raw) + 8,
1, /* TDS 7 or 8. */ 1, /* TDS 7 or 8. */
raw); raw);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment