Make handling of Http Authentication thread safe
* Each BHttpAuthentication object is locked on all field accesses, * They are owned by the BUrlContext and never deleted, so there is no need for reference-counting them, * The BUrlContext itself is now reference counted, and all BUrlRequests hold a reference to it. This makes sure using the BHttpAuthentication objects from requests is thread-safe.
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010 Haiku Inc. All rights reserved.
|
||||
* Copyright 2010-2014 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _B_HTTP_AUTHENTICATION_H_
|
||||
#define _B_HTTP_AUTHENTICATION_H_
|
||||
|
||||
|
||||
#include <Url.h>
|
||||
#include <Locker.h>
|
||||
#include <String.h>
|
||||
#include <Url.h>
|
||||
|
||||
// HTTP authentication method
|
||||
enum BHttpAuthenticationMethod {
|
||||
@@ -89,6 +90,8 @@ private:
|
||||
BHttpAuthenticationQop fDigestQop;
|
||||
|
||||
BString fAuthorizationString;
|
||||
|
||||
mutable BLocker fLock;
|
||||
};
|
||||
|
||||
#endif // _B_HTTP_AUTHENTICATION_H_
|
||||
|
||||
Reference in New Issue
Block a user