ObjFW  Diff

Differences From Artifact [f82740d977]:

To Artifact [e4e7822d0d]:


23
24
25
26
27
28
29



30
31
32
33
34
35
36
#ifdef OF_HAVE_THREADS
# import "OFMutex.h"
#endif

#ifdef OF_HAVE_FILES
# import "OFURLHandler_file.h"
#endif




static OFMutableDictionary OF_GENERIC(OFString *, OFURLHandler *) *handlers;
#ifdef OF_HAVE_THREADS
static OFMutex *mutex;
#endif

@implementation OFURLHandler







>
>
>







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifdef OF_HAVE_THREADS
# import "OFMutex.h"
#endif

#ifdef OF_HAVE_FILES
# import "OFURLHandler_file.h"
#endif
#ifdef OF_HAVE_SOCKETS
# import "OFURLHandler_HTTP.h"
#endif

static OFMutableDictionary OF_GENERIC(OFString *, OFURLHandler *) *handlers;
#ifdef OF_HAVE_THREADS
static OFMutex *mutex;
#endif

@implementation OFURLHandler
46
47
48
49
50
51
52






53
54
55
56
57
58
59
	mutex = [[OFMutex alloc] init];
#endif

#ifdef OF_HAVE_FILES
	[self registerClass: [OFURLHandler_file class]
		  forScheme: @"file"];
#endif






}

+ (bool)registerClass: (Class)class
	    forScheme: (OFString *)scheme
{
#ifdef OF_HAVE_THREADS
	[mutex lock];







>
>
>
>
>
>







49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
	mutex = [[OFMutex alloc] init];
#endif

#ifdef OF_HAVE_FILES
	[self registerClass: [OFURLHandler_file class]
		  forScheme: @"file"];
#endif
#ifdef OF_HAVE_SOCKETS
	[self registerClass: [OFURLHandler_HTTP class]
		  forScheme: @"http"];
	[self registerClass: [OFURLHandler_HTTP class]
		  forScheme: @"https"];
#endif
}

+ (bool)registerClass: (Class)class
	    forScheme: (OFString *)scheme
{
#ifdef OF_HAVE_THREADS
	[mutex lock];