mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 633667: Per the spec, return NPRES_USER_BREAK when a plugin rejects an HTTP redirect, not NPRES_NETWORK_ERR. r=bsmedberg a=blocking2.0final+
This commit is contained in:
parent
ecb7086c9a
commit
2c810200dc
@ -161,6 +161,7 @@ mIsSuspended(PR_FALSE),
|
|||||||
mIsPluginInitJSStream(mInst->mInPluginInitCall &&
|
mIsPluginInitJSStream(mInst->mInPluginInitCall &&
|
||||||
aURL && strncmp(aURL, "javascript:",
|
aURL && strncmp(aURL, "javascript:",
|
||||||
sizeof("javascript:") - 1) == 0),
|
sizeof("javascript:") - 1) == 0),
|
||||||
|
mRedirectDenied(PR_FALSE),
|
||||||
mResponseHeaderBuf(nsnull)
|
mResponseHeaderBuf(nsnull)
|
||||||
{
|
{
|
||||||
memset(&mNPStream, 0, sizeof(mNPStream));
|
memset(&mNPStream, 0, sizeof(mNPStream));
|
||||||
@ -765,16 +766,19 @@ nsNPAPIPluginStreamListener::OnStopBinding(nsIPluginStreamInfo* pluginInfo,
|
|||||||
|
|
||||||
if (!mInst || !mInst->CanFireNotifications())
|
if (!mInst || !mInst->CanFireNotifications())
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// check if the stream is of seekable type and later its destruction
|
// check if the stream is of seekable type and later its destruction
|
||||||
// see bug 91140
|
// see bug 91140
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
NPReason reason = NS_FAILED(status) ? NPRES_NETWORK_ERR : NPRES_DONE;
|
NPReason reason = NS_FAILED(status) ? NPRES_NETWORK_ERR : NPRES_DONE;
|
||||||
|
if (mRedirectDenied) {
|
||||||
|
reason = NPRES_USER_BREAK;
|
||||||
|
}
|
||||||
if (mStreamType != NP_SEEK ||
|
if (mStreamType != NP_SEEK ||
|
||||||
(NP_SEEK == mStreamType && NS_BINDING_ABORTED == status)) {
|
(NP_SEEK == mStreamType && NS_BINDING_ABORTED == status)) {
|
||||||
rv = CleanUpStream(reason);
|
rv = CleanUpStream(reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -892,6 +896,7 @@ nsNPAPIPluginStreamListener::URLRedirectResponse(NPBool allow)
|
|||||||
{
|
{
|
||||||
if (mHTTPRedirectCallback) {
|
if (mHTTPRedirectCallback) {
|
||||||
mHTTPRedirectCallback->OnRedirectVerifyCallback(allow ? NS_OK : NS_ERROR_FAILURE);
|
mHTTPRedirectCallback->OnRedirectVerifyCallback(allow ? NS_OK : NS_ERROR_FAILURE);
|
||||||
|
mRedirectDenied = allow ? PR_FALSE : PR_TRUE;
|
||||||
mHTTPRedirectCallback = nsnull;
|
mHTTPRedirectCallback = nsnull;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,6 +150,7 @@ protected:
|
|||||||
PRPackedBool mCallNotify;
|
PRPackedBool mCallNotify;
|
||||||
PRPackedBool mIsSuspended;
|
PRPackedBool mIsSuspended;
|
||||||
PRPackedBool mIsPluginInitJSStream;
|
PRPackedBool mIsPluginInitJSStream;
|
||||||
|
PRPackedBool mRedirectDenied;
|
||||||
nsCString mResponseHeaders;
|
nsCString mResponseHeaders;
|
||||||
char* mResponseHeaderBuf;
|
char* mResponseHeaderBuf;
|
||||||
nsCOMPtr<nsITimer> mDataPumpTimer;
|
nsCOMPtr<nsITimer> mDataPumpTimer;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
function test1() {
|
function test1() {
|
||||||
expectedWriteURL = "";
|
expectedWriteURL = "";
|
||||||
expectedNotifyStatus = 1;
|
expectedNotifyStatus = 2;
|
||||||
|
|
||||||
p.streamTest(redirectingURL, false, null, writeCallback, notifyCallback, redirectCallback, false);
|
p.streamTest(redirectingURL, false, null, writeCallback, notifyCallback, redirectCallback, false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user