View Single Post
Old 09-08-2008, 06:41 PM   #24
derrell
Jack O' Apes
derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.derrell once ate a cherry pie in a record 7 seconds.
 
derrell's Avatar
 
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
I did a little more digging on this problem before I left it. I didn't save any of the output but if you change proxy1150.cpp so that it is showing whats coming into and out it. The eternal URLs are being processed but its like ashkulz thought. It looks like for some reason even after all the data is finished there seems to be more when there really isn't. All of the html is being sent right down to the last </html> tag. I didn't really try too hard to figure out what is really happening because transfering my books to the ebw-1150 reader works without a hitch so far with the orignal code. For now that is enough for me.

Below is the code that I changed if I remember correctly its been a few days.

Code:
// Pass the received data from the content server to the device
void Proxy1150::recv(string &data)
{
  vector<string> data_vector;
  split(data, data_vector, 5);

  int buffer_size = atoi(data_vector[4].c_str());
  char buffer[4092] = "";

  int ret;
  ret = ::recv(_socket, buffer, buffer_size, 0);
  if (ret < 0) {
    cerr << "Error: Recv failed (errno = " << errno << ")\n";
    nak(data_vector[1], "0");
  } else {
    string buf_str;
    buf_str.assign(buffer, ret);

    cout << "Recv: " << ret << " byte(s)\n";

// added the next line so I could see what was being moved around
    cout << "buffer str " << buf_str << " content\n";

    ack(data_vector[1], buf_str);
  }
}
derrell is offline   Reply With Quote