Changeset 12f51629cadbce2beb3d924d761ad2cc07e95ba1

Show
Ignore:
Timestamp:
06/15/10 11:14:19 (2 years ago)
Author:
Antti-Juhani Kaijanaho <ajk@…>
Children:
5b42e03e0f421c03ed23d10ccbfe624435d35a62
Parents:
19beb87b09eead3ac023e509e8df964ec8d55566
git-author:
Antti-Juhani Kaijanaho <ajk@…> (06/15/10 11:12:39)
git-committer:
Antti-Juhani Kaijanaho <ajk@…> (06/15/10 11:14:19)
Message:

Fix #63

Signed-off-by: Antti-Juhani Kaijanaho <ajk@…>

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • local/connection.cc

    r19beb87 r12f5162  
    9898                                std::string s = 
    9999                                        util::streambuf_to_string(*sbp, n); 
     100                                if (s.length() > n) s.resize(n); 
    100101                                ent.reset(new msg::entity(s)); 
    101102                        } 
  • util.cc

    r19beb87 r12f5162  
    9292                                            buffer_size(*it)); 
    9393                } 
    94                 if (recv.length() > n) recv.resize(n); 
    9594                sbuf.consume(recv.length()); 
    9695                return recv; 
  • util.hh

    r19beb87 r12f5162  
    133133        } 
    134134 
     135        /* WARNING: The resulting string may be longer than n.  If you 
     136           need exactly n, truncate the string afterward by using the resize(n) 
     137           method. */ 
    135138        std::string streambuf_to_string(boost::asio::streambuf &sbuf, size_t n); 
    136139}