Skip to content

Commit

Permalink
red embedded BSON doc bug
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Dec 3, 2010
1 parent f67bc10 commit 2a45a53
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
29 changes: 18 additions & 11 deletions bsonDoc.pas
Expand Up @@ -286,11 +286,27 @@ function TBSONDocument.Load(const stm: IStream): HResult;
end;
end;
{$ENDIF}
function stmReadBSONDocument:IBSONDocument;
var
p1,p2:int64;
d:TBSONDocument;
begin
OleCheck(stm.Seek(0,soFromCurrent,p1));
d:=TBSONDocument.Create;
try
d.Load(stm);
Result:=(d as IBSONDocument);
except
d.Free;
raise;
end;
OleCheck(stm.Seek(0,soFromCurrent,p2));
inc(ltotal,p2-p1);
end;
var
j:integer;
v:OleVariant;
k:WideString;
d:TBSONDocument;
o:array[0..11] of byte;
ii:int64 absolute o;
dd:double absolute o;
Expand Down Expand Up @@ -358,16 +374,7 @@ function TBSONDocument.Load(const stm: IStream): HResult;
bsonString:
v:=stmReadString;
bsonEmbeddedDocument:
begin
d:=TBSONDocument.Create;
try
d.Load(stm);
v:=(d as IBSONDocument);
except
d.Free;
raise;
end;
end;
v:=stmReadBSONDocument;
bsonArray:
begin
//push onto array stack
Expand Down
2 changes: 2 additions & 0 deletions todo.txt
@@ -1,5 +1,7 @@
=== MongoWire ===

async: StartQuery CheckResponse ReadResponse

authentication

database commands
Expand Down

0 comments on commit 2a45a53

Please sign in to comment.