зеркало из https://github.com/mozilla/gecko-dev.git
Added the query string (if any) to the GET request... NECKO only.
This commit is contained in:
Родитель
63703948c1
Коммит
500486a5d0
|
@ -37,7 +37,6 @@ extern PRLogModuleInfo* gHTTPLog;
|
|||
#endif /* PR_LOGGING */
|
||||
|
||||
nsHTTPRequest::nsHTTPRequest(nsIURI* i_pURL, HTTPMethod i_Method, nsIChannel* i_pTransport):
|
||||
m_pURI(i_pURL),
|
||||
m_Method(i_Method),
|
||||
m_pArray(new nsVoidArray()),
|
||||
m_Version(HTTP_ONE_ZERO),
|
||||
|
@ -45,6 +44,8 @@ nsHTTPRequest::nsHTTPRequest(nsIURI* i_pURL, HTTPMethod i_Method, nsIChannel* i_
|
|||
{
|
||||
NS_INIT_REFCNT();
|
||||
|
||||
m_pURL = do_QueryInterface(i_pURL);
|
||||
|
||||
PR_LOG(gHTTPLog, PR_LOG_DEBUG,
|
||||
("Creating nsHTTPRequest [this=%x].\n", this));
|
||||
|
||||
|
@ -92,7 +93,7 @@ nsHTTPRequest::Build()
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (!m_pURI) {
|
||||
if (!m_pURL) {
|
||||
NS_ERROR("No URL to build request for!");
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
@ -117,12 +118,21 @@ nsHTTPRequest::Build()
|
|||
this));
|
||||
|
||||
// Write the request method and HTTP version.
|
||||
char* filename;
|
||||
char* name;
|
||||
lineBuffer.Append(MethodToString(m_Method));
|
||||
|
||||
rv = m_pURI->GetPath(&filename);
|
||||
lineBuffer.Append(filename);
|
||||
nsCRT::free(filename);
|
||||
rv = m_pURL->GetPath(&name);
|
||||
lineBuffer.Append(name);
|
||||
nsCRT::free(name);
|
||||
|
||||
// Append the Query string if any...
|
||||
name = nsnull;
|
||||
rv = m_pURL->GetQuery(&name);
|
||||
if (name && *name) {
|
||||
lineBuffer.Append("?");
|
||||
lineBuffer.Append(name);
|
||||
}
|
||||
nsCRT::free(name);
|
||||
|
||||
lineBuffer.Append(" HTTP/1.0"CRLF);
|
||||
|
||||
|
|
|
@ -19,13 +19,14 @@
|
|||
#ifndef _nsHTTPRequest_h_
|
||||
#define _nsHTTPRequest_h_
|
||||
|
||||
#include "nscore.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIHTTPCommonHeaders.h"
|
||||
#include "nsIHTTPRequest.h"
|
||||
#include "nsIStreamObserver.h"
|
||||
#include "nscore.h"
|
||||
#include "nsIURL.h"
|
||||
|
||||
class nsIInputStream;
|
||||
class nsIURL;
|
||||
class nsVoidArray;
|
||||
class nsIBufferInputStream;
|
||||
class nsIInputStream;
|
||||
|
@ -293,7 +294,7 @@ protected:
|
|||
return methods[i_Method];
|
||||
}
|
||||
|
||||
nsIURI* m_pURI;
|
||||
nsCOMPtr<nsIURL> m_pURL;
|
||||
HTTPVersion m_Version;
|
||||
HTTPMethod m_Method;
|
||||
// The actual request stream!
|
||||
|
|
Загрузка…
Ссылка в новой задаче