Hello All.
I have one ptoblem. I need to post some data on HTTP server, and then read
server reply. I use something like:
nsCOMPtr<nsIURI> sourceUrl;
IoService()->NewURI(sourceUri, nsnull, nsnull, getter_AddRefs(sourceUrl));
nsCOMPtr<nsIChannel> sourceChannel;
IoService()->NewChannelFromURI(sourceUrl, getter_AddRefs(sourceChannel));
nsCOMPtr<nsIUploadChannel> uploadChannel = do_QueryInterface(sourceChannel,
&rv);
nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(sourceChannel,
&rv);
nsCString contentType("application/x-www-form-urlencoded");
uploadChannel->SetUploadStream(_istream, contentType, postText.size());
nsCString requestMethod("POST");
httpChannel->SetRequestMethod(requestMethod);
sourceChannel->SetNotificationCallbacks(progressStrreamListener);
sourceChannel->AsyncOpen(strreamListener, null);
After AsyncOpen modal dialog is displayed, which waits for HTTP transaction
end.
But this method is not working. Uploading is done fine, and
progressStrreamListener receives notification, that upload was succeeded.
But getting server reply never happens, i.e. OnStartRequest, OnDataAvailable
and OnStopRequest are never called. But data actually received, I see it on
the firewall logs. So waiting for OnStopRequest is hang in infinite loop.
I'm doing it under Mozilla Thunderbird 1.5.0.10. If there are errors in my
code, please, point them.
With best regards,
Alexey Ousov
_______________________________________________
dev-tech-network mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-network