#600: M1628076 M1632241 M1595886 M1614468
This commit is contained in:
parent
692e730faa
commit
5bb1c76487
|
@ -92,7 +92,10 @@ this.Curl = {
|
||||||
let data = [];
|
let data = [];
|
||||||
if (utils.isUrlEncodedRequest(aData) || aData.method == "PUT") {
|
if (utils.isUrlEncodedRequest(aData) || aData.method == "PUT") {
|
||||||
postDataText = aData.postDataText;
|
postDataText = aData.postDataText;
|
||||||
addPostData("--data");
|
// Irony: curl that comes with Tiger doesn't support this option.
|
||||||
|
// But if you are l33t enough to use this, you should know that.
|
||||||
|
// -- Cameron
|
||||||
|
addPostData("--data-raw");
|
||||||
addPostData(utils.writePostDataTextParams(postDataText));
|
addPostData(utils.writePostDataTextParams(postDataText));
|
||||||
ignoredHeaders.add("Content-Length");
|
ignoredHeaders.add("Content-Length");
|
||||||
} else if (multipartRequest) {
|
} else if (multipartRequest) {
|
||||||
|
|
|
@ -253,6 +253,12 @@ public:
|
||||||
MOZ_ASSERT(!sFactory->mManagerList.IsEmpty());
|
MOZ_ASSERT(!sFactory->mManagerList.IsEmpty());
|
||||||
|
|
||||||
{
|
{
|
||||||
|
// Note that we are synchronously calling abort code here. If any
|
||||||
|
// of the shutdown code synchronously decides to delete the Factory
|
||||||
|
// we need to delay that delete until the end of this method.
|
||||||
|
AutoRestore<bool> restore(sFactory->mInSyncAbortOrShutdown);
|
||||||
|
sFactory->mInSyncAbortOrShutdown = true;
|
||||||
|
|
||||||
ManagerList::ForwardIterator iter(sFactory->mManagerList);
|
ManagerList::ForwardIterator iter(sFactory->mManagerList);
|
||||||
while (iter.HasMore()) {
|
while (iter.HasMore()) {
|
||||||
RefPtr<Manager> manager = iter.GetNext();
|
RefPtr<Manager> manager = iter.GetNext();
|
||||||
|
@ -262,6 +268,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MaybeDestroyInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -279,8 +287,8 @@ public:
|
||||||
// Note that we are synchronously calling shutdown code here. If any
|
// Note that we are synchronously calling shutdown code here. If any
|
||||||
// of the shutdown code synchronously decides to delete the Factory
|
// of the shutdown code synchronously decides to delete the Factory
|
||||||
// we need to delay that delete until the end of this method.
|
// we need to delay that delete until the end of this method.
|
||||||
AutoRestore<bool> restore(sFactory->mInSyncShutdown);
|
AutoRestore<bool> restore(sFactory->mInSyncAbortOrShutdown);
|
||||||
sFactory->mInSyncShutdown = true;
|
sFactory->mInSyncAbortOrShutdown = true;
|
||||||
|
|
||||||
ManagerList::ForwardIterator iter(sFactory->mManagerList);
|
ManagerList::ForwardIterator iter(sFactory->mManagerList);
|
||||||
while (iter.HasMore()) {
|
while (iter.HasMore()) {
|
||||||
|
@ -300,17 +308,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Factory()
|
Factory() : mInSyncAbortOrShutdown(false) {
|
||||||
: mInSyncShutdown(false)
|
|
||||||
{
|
|
||||||
MOZ_COUNT_CTOR(cache::Manager::Factory);
|
MOZ_COUNT_CTOR(cache::Manager::Factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
~Factory()
|
~Factory() {
|
||||||
{
|
|
||||||
MOZ_COUNT_DTOR(cache::Manager::Factory);
|
MOZ_COUNT_DTOR(cache::Manager::Factory);
|
||||||
MOZ_ASSERT(mManagerList.IsEmpty());
|
MOZ_DIAGNOSTIC_ASSERT(mManagerList.IsEmpty());
|
||||||
MOZ_ASSERT(!mInSyncShutdown);
|
MOZ_DIAGNOSTIC_ASSERT(!mInSyncAbortOrShutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult
|
static nsresult
|
||||||
|
@ -353,9 +358,9 @@ private:
|
||||||
|
|
||||||
// If the factory is is still in use then we cannot delete yet. This
|
// If the factory is is still in use then we cannot delete yet. This
|
||||||
// could be due to managers still existing or because we are in the
|
// could be due to managers still existing or because we are in the
|
||||||
// middle of shutting down. We need to be careful not to delete ourself
|
// middle of aborting or shutting down. We need to be careful not to delete
|
||||||
// synchronously during shutdown.
|
// ourself synchronously during shutdown.
|
||||||
if (!sFactory->mManagerList.IsEmpty() || sFactory->mInSyncShutdown) {
|
if (!sFactory->mManagerList.IsEmpty() || sFactory->mInSyncAbortOrShutdown) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,10 +385,10 @@ private:
|
||||||
typedef nsTObserverArray<Manager*> ManagerList;
|
typedef nsTObserverArray<Manager*> ManagerList;
|
||||||
ManagerList mManagerList;
|
ManagerList mManagerList;
|
||||||
|
|
||||||
// This flag is set when we are looping through the list and calling
|
// This flag is set when we are looping through the list and calling Abort()
|
||||||
// Shutdown() on each Manager. We need to be careful not to synchronously
|
// or Shutdown() on each Manager. We need to be careful not to synchronously
|
||||||
// trigger the deletion of the factory while still executing this loop.
|
// trigger the deletion of the factory while still executing this loop.
|
||||||
bool mInSyncShutdown;
|
bool mInSyncAbortOrShutdown;
|
||||||
};
|
};
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
|
@ -2073,7 +2073,7 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
|
||||||
int init_offset, initack_offset, initack_limit;
|
int init_offset, initack_offset, initack_limit;
|
||||||
int retval;
|
int retval;
|
||||||
int error = 0;
|
int error = 0;
|
||||||
uint8_t auth_chunk_buf[SCTP_PARAM_BUFFER_SIZE];
|
uint8_t auth_chunk_buf[SCTP_CHUNK_BUFFER_SIZE];
|
||||||
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
|
#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING)
|
||||||
struct socket *so;
|
struct socket *so;
|
||||||
|
|
||||||
|
@ -2264,8 +2264,12 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
|
||||||
if (auth_skipped) {
|
if (auth_skipped) {
|
||||||
struct sctp_auth_chunk *auth;
|
struct sctp_auth_chunk *auth;
|
||||||
|
|
||||||
auth = (struct sctp_auth_chunk *)
|
if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
|
||||||
sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
|
auth = (struct sctp_auth_chunk *)
|
||||||
|
sctp_m_getptr(m, auth_offset, auth_len, auth_chunk_buf);
|
||||||
|
} else {
|
||||||
|
auth = NULL;
|
||||||
|
}
|
||||||
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m, auth_offset)) {
|
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m, auth_offset)) {
|
||||||
/* auth HMAC failed, dump the assoc and packet */
|
/* auth HMAC failed, dump the assoc and packet */
|
||||||
SCTPDBG(SCTP_DEBUG_AUTH1,
|
SCTPDBG(SCTP_DEBUG_AUTH1,
|
||||||
|
@ -4655,11 +4659,15 @@ sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length,
|
||||||
if (auth_skipped && (stcb != NULL)) {
|
if (auth_skipped && (stcb != NULL)) {
|
||||||
struct sctp_auth_chunk *auth;
|
struct sctp_auth_chunk *auth;
|
||||||
|
|
||||||
auth = (struct sctp_auth_chunk *)
|
if (auth_len <= SCTP_CHUNK_BUFFER_SIZE) {
|
||||||
sctp_m_getptr(m, auth_offset,
|
auth = (struct sctp_auth_chunk *)
|
||||||
|
sctp_m_getptr(m, auth_offset,
|
||||||
auth_len, chunk_buf);
|
auth_len, chunk_buf);
|
||||||
got_auth = 1;
|
got_auth = 1;
|
||||||
auth_skipped = 0;
|
auth_skipped = 0;
|
||||||
|
} else {
|
||||||
|
auth = NULL;
|
||||||
|
}
|
||||||
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m,
|
if ((auth == NULL) || sctp_handle_auth(stcb, auth, m,
|
||||||
auth_offset)) {
|
auth_offset)) {
|
||||||
/* auth HMAC failed so dump it */
|
/* auth HMAC failed so dump it */
|
||||||
|
|
|
@ -263,8 +263,23 @@ nsStringInputStream::ReadSegments(nsWriteSegmentFun aWriter, void* aClosure,
|
||||||
if (aCount > maxCount) {
|
if (aCount > maxCount) {
|
||||||
aCount = maxCount;
|
aCount = maxCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsDependentCSubstring tempData;
|
||||||
|
tempData.SetIsVoid(true);
|
||||||
|
if (mData.Flags() & nsCSubstring::F_OWNED) {
|
||||||
|
tempData.Assign(std::move(mData));
|
||||||
|
mData.Rebind(tempData.BeginReading(), tempData.EndReading());
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = aWriter(this, aClosure, mData.BeginReading() + mOffset, 0,
|
nsresult rv = aWriter(this, aClosure, mData.BeginReading() + mOffset, 0,
|
||||||
aCount, aResult);
|
aCount, aResult);
|
||||||
|
|
||||||
|
if (!mData.IsVoid() && !tempData.IsVoid()) {
|
||||||
|
MOZ_DIAGNOSTIC_ASSERT(mData == tempData, "String was replaced!");
|
||||||
|
mData.SetIsVoid(true);
|
||||||
|
mData.Assign(std::move(tempData));
|
||||||
|
}
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
NS_ASSERTION(*aResult <= aCount,
|
NS_ASSERTION(*aResult <= aCount,
|
||||||
"writer should not write more than we asked it to write");
|
"writer should not write more than we asked it to write");
|
||||||
|
|
Loading…
Reference in New Issue