Hello, I've written some code that takes advantage of the talk_base,
When I access some URL(only http://www.yahoo.com/r/2q), it crashed.
I'm wondering anything wrong?
I worked on: talk_base from the trunk of svn, vs2005 and vs2003
Windows XP.
// stack below
talk_base::MemoryStream::ReserveSize(unsigned int size=0xffffffff)
talk_base::HttpClient::OnHeaderAvailable(bool ignore_data=false, bool
chunked=false, unsigned int data_size=0xffffffff)
talk_base::HttpClient::onHttpHeaderComplete(bool chunked=false,
unsigned int & data_size=0xffffffff)
talk_base::HttpBase::onHttpRecvHeaderComplete(bool chunked=false,
unsigned int & data_size=0xffffffff)
talk_base::HttpParser::process_line(const char * line=0x00127e6d,
unsigned int len=0x00000000, talk_base::HttpError & err=HE_NONE)
talk_base::HttpParser::process(const char * buffer=0x00127dc0,
unsigned int len=0x00000000, unsigned int & processed=0x000000af,
talk_base::HttpError & err=HE_NONE)
talk_base::HttpBase::OnEvent(talk_base::StreamInterface *
stream=0x00b25d88, int events=0x00000002, int error=0xcccccccc)
// code below
#include <string>
#include "talk/base/thread.h"
#include "talk/base/stream.h"
#include "talk/base/httpclient.h"
#include "talk/base/physicalsocketserver.h"
#include "talk/base/sigslot.h"
int main(int, char**)
{
PhysicalSocketServer ss;
HttpClientDefault c(&ss, "test");
talk_base::Url<char> url("http://www.yahoo.com/r/2q");
talk_base::SocketAddress addr(url.server(), url.port());
c.set_server(addr);
c.request().verb = HV_GET;
c.request().path = url.full_path();
c.response().document.reset(new talk_base::MemoryStream);
monitor m(&ss);
c.SignalHttpClientComplete.connect(&m,
&monitor::OnHttpClientComplete);
c.set_fail_redirect(true);
c.start();
ss.Wait(30 * 1000, true);
return 0;
}
Much obliged for any advice,.
Ken
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-talk-open" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-talk-open?hl=en
-~----------~----~----~----~------~----~------~--~---