Hi,
I've implemented the HTTPServer library for a project I am doing. But, I have found a serious issue. I don't know if it is caused by something I do or the mechanism inside the HTTPServer class.
This is the request handler class I'm using:
class CSVHandler : public HTTPRequestHandler {
public:
CSVHandler (const char * root, const char * path, TCPSocket * sock)
: HTTPRequestHandler (root, path, sock)
{ }
virtual ~CSVHandler (void) { }
virtual void doHead (void) { }
virtual void doPost (void) { }
virtual void onReadable (void) { }
virtual void onWriteable (void) { }
virtual void onClose (void) { }
static inline HTTPRequestHandler * inst (const char * root, const char * path, TCPSocket * sock) {
return new CSVHandler (root, path, sock);
}
virtual void doGet (void) {
this->respHeaders ()["Content-Type"] = "text/plain";
this->respHeaders ()["Connection"] = "close";
this->writeData (csv.c_str (), csv.length ());
}
};
As you can see, I use a std::string to store a CSV data string in. But...when the length of this string is MORE than 980 bytes (or characters if you prefer). I have no idea what the problem could be. Should I specify the HTTP charset? Or is it something else?
Kind regards,
Ramon Kleiss
Hi,
I've implemented the HTTPServer library for a project I am doing. But, I have found a serious issue. I don't know if it is caused by something I do or the mechanism inside the HTTPServer class.
This is the request handler class I'm using:
As you can see, I use a std::string to store a CSV data string in. But...when the length of this string is MORE than 980 bytes (or characters if you prefer). I have no idea what the problem could be. Should I specify the HTTP charset? Or is it something else?
Kind regards, Ramon Kleiss