Re: Igor, pAPP toolkit questions

From: Josh Mclaren (optics201_at_optonline.com)
Date: 11/23/04


Date: 23 Nov 2004 14:46:54 -0800

Igor,

Thanks for your response. Your toolkit has just been invaluable and I
just wanted to mention that before I continue. Let me give you some
further background: I have removed the MainDlg files from the Toolkit
Sample and moved the spSession->RegisterNameSpace into a method off of
an ATL COM object. This is so that I can associate the pAPP with a
WebBrowser control which is instantiated in a .NET C# project.

This is working great, and currently, instead of the MainDlg Log
function being called, I have mimicked the toolkit functionality by
raising a COM event where the .NET Form behaves similarly (appending
the request/response string to a multi line textbox).

At this point, I am just playing around in the methods defined in
TestApp.cpp (BeginningTransaction, OnResponse, ReportProgress). I've
been wary of adjusting methods defined in ProtocolImpl.inl or
elsewhere, simply because I'm not sure if I'm playing in the right
place.
  
It seems that the methods in TestApp.cpp have access to most of the
objects I need so far, except now that I've entered into
Authentication territory.

> I'm not sure what that means. You pass the buffer to the method, right?
> So make sure it is valid. Am I missing something obvious?

If I take the lines in BeginningTransaction which currently point pbuf
to the HTTP_QUERY_RAW_HEADERS_CRLF , and change it to
HTTP_QUERY_AUTHORIZATION, and debug/watch the pointer it remains a
"bad pointer". This is regardless of whether I run the same code
throughout the above three methods (BeginningTransaction, OnResponse,
ReportProgress).

---Although--- I may have missed it if it was populated in one of the
many OnResponse calls.

If I change it back to the raw_headers flag, the pointer contains data
and is fine, so I don't think I have a pointer problem but something
deeper.

 
> Also, make sure you don't call too early. You definitely need to do it
> after IAuthenticate::Authenticate returns. Probably the best place is in
> BINDSTATUS_SENDINGREQUEST notification - by this time, all the request
> headers have been fully prepared.

I'll try this and let you know. I am assuming I can check for
BINDSTATUS_SENDINGREQUEST within ReportProgress as you do now for
BINDSTATUS_REDIRECTING.

> It is the best and only way. The POST data is supplied in BINDINFO
> structure.

Thanks!

> I found GetBindString to be very inconsistent. It works for some strings
> but not others, with no apparent reason. Usually there are alternative
> ways to get the same information, so I haven't spent much time on it.

Thanks again! :)

(html content)
> IInternetProtocol::Read is the only place you can see it.

Ok, can you expand on this a bit? The toolkit has a
IInternetProtocolImpl::Read method implemented in ProtocolImpl.inl
which just seems to forward it on to the target protocol's Read. Are
you suggesting I add a datastructure there to maintain the HTML info
(I assume the HTML comes in the first parameter *pv)? I hope its
possible to pass that structure back up to the TestApp.cpp/ CTestSink
level.

> Now I'm confused. Are you asking about response body (presumably HTML
> content), or response headers?

In my most ideal dreamworld, I would like one object where *all* data
that is sent across the network stream is available. One big string
which I could parse out by myself is my desired goal.

-Josh

"Igor Tandetnik" <itandetnik@mvps.org> wrote in message news:<#RzCtmX0EHA.804@TK2MSFTNGP12.phx.gbl>...
> "Josh Mclaren" <optics201@optonline.com> wrote in message
> news:72494446.0411221935.4f759181@posting.google.com
> > I am having trouble implementing what you suggested in the following
> > post, with the pAPP toolkit. :
> >
> > http://groups.google.com/groups?hl=en&lr=&safe=off&selm=OsmO3iP5DHA.1664%40TK2MSFTNGP11.phx.gbl
> >
> > When I simply take the pAPP toolkit and replace the
> > HTTP_QUERY_RAW_HEADERS_CRLF | HTTP_QUERY_FLAG_REQUEST_HEADERS
> > QueryInfo call
> >
> > with
> >
> > HTTP_QUERY_AUTHORIZATION | HTTP_QUERY_FLAG_REQUEST_HEADERS
> >
> > the buffer is always an invalid pointer.
>
> I'm not sure what that means. You pass the buffer to the method, right?
> So make sure it is valid. Am I missing something obvious?
>
> Also, make sure you don't call too early. You definitely need to do it
> after IAuthenticate::Authenticate returns. Probably the best place is in
> BINDSTATUS_SENDINGREQUEST notification - by this time, all the request
> headers have been fully prepared.
>
> > I've also played around with
> > GetBindInfo off of the m_spInternetBindInfo object. I've been able to
> > use that succesfully to retreive post Data (though I'm not sure that
> > is the best way)
>
> It is the best and only way. The POST data is supplied in BINDINFO
> structure.
>
> > and I thought I might be able to use it similarly to
> > retrieve BINDSTRING_USERNAME as some MSDN code retrieves MIME types.
>
> I found GetBindString to be very inconsistent. It works for some strings
> but not others, with no apparent reason. Usually there are alternative
> ways to get the same information, so I haven't spent much time on it.
>
> > Another question I had is to ask is what is the best way to examine
> > the html content that is received with the current toolkit.
>
> IInternetProtocol::Read is the only place you can see it.
>
> > Ideally
> > I'd like the entire message rather than dealing with QueryInfo's
> > splitting of the headers etc.
>
> Now I'm confused. Are you asking about response body (presumably HTML
> content), or response headers?



Relevant Pages

  • Re: How could this possibly happen (HttpURLConnection + simple JSP page)
    ... In PHP that would throw some nasty HTTP-related warnings and potentially break the page as you are changing the headers after HTML display? ... You are writing code in a special format that is compiled in to a servlet, which is then executed by the server when the page is requested. ... The other thing is that writing things "after HTML display" is probably very difficult as the display is done on the users computer when they have recieved the response. ... When you create a response for the user it does not necessarily get sent back as soon as you start, and more importantly the headers do not necessarily finish as soon as you start writing to the body. ...
    (comp.lang.java.help)
  • Re: Whats the real content type of XHTML?
    ... Is that something in the HTML file itself, ... This response consists of a number of headers followed by the ...
    (alt.html)
  • Re: Need help to figure out urllib2.Request()
    ... I tried to open some web pages with urllib2.Request(url, data, headers), but ... data= account ... response = urllib2.urlopen ... html = response.read ...
    (comp.lang.python)
  • Re: Igor, pAPP toolkit questions
    ... > Thanks for your response. ... Your toolkit has just been invaluable and I ... it passing the pointer to the buffer and the length of the buffer. ... then return back to the client. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: scroll window - self repaint?
    ... evch.h is delivered with the version of the Warp4 toolkit ... but packaging errors are possible. ... I dislike to mix headers from different ... I tend to use the IBM supplied headers when working with VAC tools and the ...
    (comp.os.os2.programmer.misc)