~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/linebuffer.h

  • Committer: Lee Bieber
  • Date: 2010-11-08 01:18:10 UTC
  • mfrom: (1909.5.2 trunk-bug-672074)
  • mto: This revision was merged to the branch mainline in revision 1913.
  • Revision ID: kalebral@gmail.com-20101108011810-jldnkz3tn05oujfn
Merge Andrew - fix bug 653240: drizzle command line client reads copious amounts of data into RAM before sending commands 
Merge Andrew - fix bug 672074: buffer overrun in LineBuffer

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include <vector>
20
20
#include <sstream>
 
21
#include <iostream>
 
22
#include <boost/iostreams/stream.hpp>
 
23
#include <boost/iostreams/device/file_descriptor.hpp>
21
24
 
22
25
class LineBuffer
23
26
{
24
27
public:
25
28
  LineBuffer(uint32_t max_size,FILE *file);
26
 
 
27
29
  void addString(const std::string &argument);
28
30
  char *readline();
29
31
private:
30
32
  FILE *file;
31
 
  std::stringstream buffer;
32
33
  std::vector<char> line;
 
34
  std::iostream *file_stream;
33
35
  uint32_t max_size;
34
 
  bool eof;
35
36
};
36
37
 
37
38
#endif /* CLIENT_LINEBUFFER_H */