Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed Issue #40

  • Loading branch information...
commit 4b0b8cc82dd18b74ecb92bd06150287b2d456a33 1 parent f2ce7ba
Tammo Freese authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +5 3 lib/em-mongo/connection.rb
8 lib/em-mongo/connection.rb
@@ -164,9 +164,11 @@ def receive_data(data)
164 164 end
165 165
166 166 if @buffer.more?
167   - remaining_bytes= @buffer.size-@buffer.position
168   - @buffer = BSON::ByteBuffer.new(@buffer.to_s[@buffer.position,remaining_bytes])
169   - @buffer.rewind
  167 + if @buffer.position > 0
  168 + remaining_bytes= @buffer.size-@buffer.position
  169 + @buffer = BSON::ByteBuffer.new(@buffer.to_s[@buffer.position,remaining_bytes])
  170 + @buffer.rewind
  171 + end
170 172 else
171 173 @buffer.clear
172 174 end

0 comments on commit 4b0b8cc

Please sign in to comment.
Something went wrong with that request. Please try again.