ObjFW  Check-in [3a5570ab20]

Overview
Comment:Split OFURL into OFURL and OFMutableURL
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3a5570ab205835e9fbe5d938a12fc359ab0b06feda766f1becc22c4920278c80
User & Date: js on 2017-07-20 22:28:01
Other Links: manifest | tags
Context
2017-07-22
20:50
Split OFDataArray into OFData and OFMutableData check-in: c8f7b90082 user: js tags: trunk
2017-07-20
22:28
Split OFURL into OFURL and OFMutableURL check-in: 3a5570ab20 user: js tags: trunk
2017-07-17
23:05
gitignore: Add *.library and ppcinline.h check-in: de43b3e645 user: js tags: trunk
Changes

Modified ObjFW.xcodeproj/project.pbxproj from [02fee7a942] to [7593955e5b].

690
691
692
693
694
695
696






697
698
699
700
701
702
703
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709







+
+
+
+
+
+







		4B3D23E91337FCB000DD29B8 /* of_asprintf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BB50DCF12F863C700C9393F /* of_asprintf.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EA1337FCB000DD29B8 /* threading.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B67998B1099E7C50041064A /* threading.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3D23EE1337FFD000DD29B8 /* of_asprintf.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BB50DD012F863C700C9393F /* of_asprintf.m */; };
		4B3D5694139A617D0010A78F /* OFSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3D5693139A617D0010A78F /* OFSerializationTests.m */; };
		4B3ED7C21AF62C30004C8FF1 /* OFGetOptionFailedException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3ED7C01AF62C30004C8FF1 /* OFGetOptionFailedException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B3ED7C31AF62C30004C8FF1 /* OFGetOptionFailedException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B3ED7C11AF62C30004C8FF1 /* OFGetOptionFailedException.m */; };
		4B40EC1B189FE2650031E19E /* socket.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B40EC1A189FE2650031E19E /* socket.m */; };
		4B4116D01F21654200E78916 /* OFMutableURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4116CD1F21654200E78916 /* OFMutableURL.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B4116D11F21654200E78916 /* OFMutableURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4116CD1F21654200E78916 /* OFMutableURL.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B4116D21F21654200E78916 /* OFMutableURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B4116CE1F21654200E78916 /* OFMutableURL.m */; };
		4B4116D31F21654200E78916 /* OFMutableURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B4116CE1F21654200E78916 /* OFMutableURL.m */; };
		4B4116D41F21654200E78916 /* OFURL+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4116CF1F21654200E78916 /* OFURL+Private.h */; };
		4B4116D51F21654200E78916 /* OFURL+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B4116CF1F21654200E78916 /* OFURL+Private.h */; };
		4B44836D1D0497DE005D12A7 /* OFUndefinedKeyException.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B44836B1D0497DE005D12A7 /* OFUndefinedKeyException.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B44836E1D0497DE005D12A7 /* OFUndefinedKeyException.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B44836C1D0497DE005D12A7 /* OFUndefinedKeyException.m */; };
		4B4483711D04989C005D12A7 /* RuntimeTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B44836F1D049887005D12A7 /* RuntimeTests.m */; };
		4B45355313DCFE1E0037AB4D /* OFCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B45355113DCFE1E0037AB4D /* OFCountedSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B45355413DCFE1E0037AB4D /* OFCountedSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B45355213DCFE1E0037AB4D /* OFCountedSet.m */; };
		4B46E2211E235EA700121ED6 /* OFLocalization.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B46E21F1E235EA700121ED6 /* OFLocalization.h */; settings = {ATTRIBUTES = (Public, ); }; };
		4B46E2221E235EA700121ED6 /* OFLocalization.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B46E21F1E235EA700121ED6 /* OFLocalization.h */; settings = {ATTRIBUTES = (Public, ); }; };
1308
1309
1310
1311
1312
1313
1314



1315
1316
1317
1318
1319
1320
1321
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330







+
+
+







		4B3D236E1337FB5800DD29B8 /* base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = base64.m; path = src/base64.m; sourceTree = "<group>"; };
		4B3D23761337FBC800DD29B8 /* ObjFW.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ObjFW.framework; sourceTree = BUILT_PRODUCTS_DIR; };
		4B3D23BB1337FC5800DD29B8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = misc/Info.plist; sourceTree = SOURCE_ROOT; };
		4B3D5693139A617D0010A78F /* OFSerializationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFSerializationTests.m; path = tests/OFSerializationTests.m; sourceTree = "<group>"; };
		4B3ED7C01AF62C30004C8FF1 /* OFGetOptionFailedException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFGetOptionFailedException.h; path = src/exceptions/OFGetOptionFailedException.h; sourceTree = "<group>"; };
		4B3ED7C11AF62C30004C8FF1 /* OFGetOptionFailedException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFGetOptionFailedException.m; path = src/exceptions/OFGetOptionFailedException.m; sourceTree = "<group>"; };
		4B40EC1A189FE2650031E19E /* socket.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = socket.m; path = src/socket.m; sourceTree = "<group>"; };
		4B4116CD1F21654200E78916 /* OFMutableURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFMutableURL.h; path = src/OFMutableURL.h; sourceTree = "<group>"; };
		4B4116CE1F21654200E78916 /* OFMutableURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFMutableURL.m; path = src/OFMutableURL.m; sourceTree = "<group>"; };
		4B4116CF1F21654200E78916 /* OFURL+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "OFURL+Private.h"; path = "src/OFURL+Private.h"; sourceTree = "<group>"; };
		4B44836B1D0497DE005D12A7 /* OFUndefinedKeyException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFUndefinedKeyException.h; path = src/exceptions/OFUndefinedKeyException.h; sourceTree = "<group>"; };
		4B44836C1D0497DE005D12A7 /* OFUndefinedKeyException.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFUndefinedKeyException.m; path = src/exceptions/OFUndefinedKeyException.m; sourceTree = "<group>"; };
		4B44836F1D049887005D12A7 /* RuntimeTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RuntimeTests.m; path = tests/RuntimeTests.m; sourceTree = "<group>"; };
		4B45355113DCFE1E0037AB4D /* OFCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFCountedSet.h; path = src/OFCountedSet.h; sourceTree = "<group>"; };
		4B45355213DCFE1E0037AB4D /* OFCountedSet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFCountedSet.m; path = src/OFCountedSet.m; sourceTree = "<group>"; };
		4B46E21F1E235EA700121ED6 /* OFLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OFLocalization.h; path = src/OFLocalization.h; sourceTree = "<group>"; };
		4B46E2201E235EA700121ED6 /* OFLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OFLocalization.m; path = src/OFLocalization.m; sourceTree = "<group>"; };
2098
2099
2100
2101
2102
2103
2104


2105
2106
2107
2108
2109
2110
2111
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122







+
+







				4B39844613D3AFB400E6F825 /* OFMutableSet.m */,
				4BA85BC6140ECCE800E91D51 /* OFMutableSet_hashtable.h */,
				4BA85BC7140ECCE800E91D51 /* OFMutableSet_hashtable.m */,
				4B6799731099E7C50041064A /* OFMutableString.h */,
				4B6799741099E7C50041064A /* OFMutableString.m */,
				4B55254E147AA5DB0003BF47 /* OFMutableString_UTF8.h */,
				4B55254F147AA5DB0003BF47 /* OFMutableString_UTF8.m */,
				4B4116CD1F21654200E78916 /* OFMutableURL.h */,
				4B4116CE1F21654200E78916 /* OFMutableURL.m */,
				4B6743FA163C395900EB1E59 /* OFMutex.h */,
				4B6743FB163C395900EB1E59 /* OFMutex.m */,
				4B511B7A139C0A34003764A5 /* OFNull.h */,
				4B511B7B139C0A34003764A5 /* OFNull.m */,
				4B6799751099E7C50041064A /* OFNumber.h */,
				4B6799761099E7C50041064A /* OFNumber.m */,
				4B6799771099E7C50041064A /* OFObject.h */,
2201
2202
2203
2204
2205
2206
2207

2208
2209
2210
2211
2212
2213
2214
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226







+







				4B325EDC1605F3A0007836CA /* OFTimer.m */,
				4B6C8AD617BD5C2E00B194F2 /* OFTimer+Private.h */,
				4BA02BA015041F5900002F84 /* OFTLSSocket.h */,
				4B7769EF1895ED0C00D12284 /* OFUDPSocket.h */,
				4B7769F01895ED0C00D12284 /* OFUDPSocket.m */,
				4B4A61F212DF5EA20048F3F2 /* OFURL.h */,
				4B4A61F312DF5EA20048F3F2 /* OFURL.m */,
				4B4116CF1F21654200E78916 /* OFURL+Private.h */,
				4BF1BCCE11C9663F0025511F /* OFXMLAttribute.h */,
				4BF1BCCF11C9663F0025511F /* OFXMLAttribute.m */,
				4B49EA67143B3A090005BBC6 /* OFXMLCDATA.h */,
				4B49EA68143B3A090005BBC6 /* OFXMLCDATA.m */,
				4B49EA69143B3A090005BBC6 /* OFXMLCharacters.h */,
				4B49EA6A143B3A090005BBC6 /* OFXMLCharacters.m */,
				4B49EA6B143B3A090005BBC6 /* OFXMLComment.h */,
2458
2459
2460
2461
2462
2463
2464

2465
2466
2467
2468
2469
2470
2471
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484







+







				4B2C21FD1DA292BE00735907 /* OFMD5Hash.h in Headers */,
				4B2C21FE1DA292BE00735907 /* OFMessagePackExtension.h in Headers */,
				4B2C21FF1DA292BE00735907 /* OFMessagePackRepresentation.h in Headers */,
				4B2C22001DA292BE00735907 /* OFMutableArray.h in Headers */,
				4B2C22011DA292BE00735907 /* OFMutableDictionary.h in Headers */,
				4B2C22021DA292BE00735907 /* OFMutableSet.h in Headers */,
				4B2C22031DA292BE00735907 /* OFMutableString.h in Headers */,
				4B4116D11F21654200E78916 /* OFMutableURL.h in Headers */,
				4B2C22041DA292BE00735907 /* OFMutex.h in Headers */,
				4B2C22051DA292BE00735907 /* OFNull.h in Headers */,
				4B2C22061DA292BE00735907 /* OFNumber.h in Headers */,
				4B2C22071DA292BE00735907 /* OFObject.h in Headers */,
				4B2C22081DA292BE00735907 /* OFObject+KeyValueCoding.h in Headers */,
				4B2C22091DA292BE00735907 /* OFObject+Serialization.h in Headers */,
				4B2C220A1DA292BE00735907 /* OFOptionsParser.h in Headers */,
2624
2625
2626
2627
2628
2629
2630

2631
2632
2633
2634
2635
2636
2637
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651







+







				4B2C22A11DA292BE00735907 /* OFStream+Private.h in Headers */,
				4B2C22A21DA292BE00735907 /* OFString_UTF8.h in Headers */,
				4B2C22A31DA292BE00735907 /* OFString_UTF8+Private.h in Headers */,
				4B2C22A41DA292BE00735907 /* OFTarArchiveEntry+Private.h in Headers */,
				4B2C22A51DA292BE00735907 /* OFTCPSocket+SOCKS5.h in Headers */,
				4B2C22A61DA292BE00735907 /* OFThread+Private.h in Headers */,
				4B2C22A71DA292BE00735907 /* OFTimer+Private.h in Headers */,
				4B4116D51F21654200E78916 /* OFURL+Private.h in Headers */,
				4B853CEC1EBFDEB000A4B2C4 /* OFXMLNode+Private.h in Headers */,
				4B2C22A81DA292BE00735907 /* OFZIPArchiveEntry+Private.h in Headers */,
				4B2C22AA1DA292BE00735907 /* socket_helpers.h in Headers */,
				4BCE4EC51ED98D1400502FF0 /* unistd_wrapper.h in Headers */,
				4BFC37BE1E50E11C00EE1269 /* common.h in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
2682
2683
2684
2685
2686
2687
2688

2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710







+







				4B3D23CC1337FCB000DD29B8 /* OFMD5Hash.h in Headers */,
				4BCAA9AF1772432F003EF859 /* OFMessagePackExtension.h in Headers */,
				4B879A8E177231F000EBCEA4 /* OFMessagePackRepresentation.h in Headers */,
				4B3D23CD1337FCB000DD29B8 /* OFMutableArray.h in Headers */,
				4B3D23CE1337FCB000DD29B8 /* OFMutableDictionary.h in Headers */,
				4B39844713D3AFB400E6F825 /* OFMutableSet.h in Headers */,
				4B3D23CF1337FCB000DD29B8 /* OFMutableString.h in Headers */,
				4B4116D01F21654200E78916 /* OFMutableURL.h in Headers */,
				4B674403163C395900EB1E59 /* OFMutex.h in Headers */,
				4B511B7C139C0A34003764A5 /* OFNull.h in Headers */,
				4B3D23D01337FCB000DD29B8 /* OFNumber.h in Headers */,
				4B3D23D11337FCB000DD29B8 /* OFObject.h in Headers */,
				4BC176301D04963000C32718 /* OFObject+KeyValueCoding.h in Headers */,
				4BB25E88139C388A00F574EA /* OFObject+Serialization.h in Headers */,
				4BAFC168182EAA7800BE5E57 /* OFOptionsParser.h in Headers */,
2849
2850
2851
2852
2853
2854
2855

2856
2857
2858
2859
2860
2861
2862
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878







+







				4B6C8AD917BD5C2E00B194F2 /* OFStream+Private.h in Headers */,
				4B552554147AA5DB0003BF47 /* OFString_UTF8.h in Headers */,
				4B6C8ADB17BD5C2E00B194F2 /* OFString_UTF8+Private.h in Headers */,
				4BC176361D04963000C32718 /* OFTarArchiveEntry+Private.h in Headers */,
				4BD653C5143B8489006182F0 /* OFTCPSocket+SOCKS5.h in Headers */,
				4B6C8ADC17BD5C2E00B194F2 /* OFThread+Private.h in Headers */,
				4B6C8ADD17BD5C2E00B194F2 /* OFTimer+Private.h in Headers */,
				4B4116D41F21654200E78916 /* OFURL+Private.h in Headers */,
				4B853CEB1EBFDEB000A4B2C4 /* OFXMLNode+Private.h in Headers */,
				4B6C8ADE17BD5C2E00B194F2 /* OFZIPArchiveEntry+Private.h in Headers */,
				4B7DD58218942FE200990FD6 /* socket_helpers.h in Headers */,
				4BCE4EC41ED98D1400502FF0 /* unistd_wrapper.h in Headers */,
				4BFC37BD1E50E11C00EE1269 /* common.h in Headers */,
			);
			runOnlyForDeploymentPostprocessing = 0;
3243
3244
3245
3246
3247
3248
3249

3250
3251
3252
3253
3254
3255
3256
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273







+







				4B2C21491DA292BE00735907 /* OFMutableArray_adjacent.m in Sources */,
				4B2C214A1DA292BE00735907 /* OFMutableDictionary.m in Sources */,
				4B2C214B1DA292BE00735907 /* OFMutableDictionary_hashtable.m in Sources */,
				4B2C214C1DA292BE00735907 /* OFMutableSet.m in Sources */,
				4B2C214D1DA292BE00735907 /* OFMutableSet_hashtable.m in Sources */,
				4B2C214E1DA292BE00735907 /* OFMutableString.m in Sources */,
				4B2C214F1DA292BE00735907 /* OFMutableString_UTF8.m in Sources */,
				4B4116D31F21654200E78916 /* OFMutableURL.m in Sources */,
				4B2C21501DA292BE00735907 /* OFMutex.m in Sources */,
				4B2C21511DA292BE00735907 /* OFNull.m in Sources */,
				4B2C21521DA292BE00735907 /* OFNumber.m in Sources */,
				4B2C21531DA292BE00735907 /* OFObject.m in Sources */,
				4B2C21541DA292BE00735907 /* OFObject+Serialization.m in Sources */,
				4B2C21551DA292BE00735907 /* OFOptionsParser.m in Sources */,
				4B5D70681DA2F7B400B3B2D7 /* OFPlugin.m in Sources */,
3442
3443
3444
3445
3446
3447
3448

3449
3450
3451
3452
3453
3454
3455
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473







+







				4B2B3E82140D430500EC2F7C /* OFMutableArray_adjacent.m in Sources */,
				4B3D239C1337FC0D00DD29B8 /* OFMutableDictionary.m in Sources */,
				4B2B3E84140D430500EC2F7C /* OFMutableDictionary_hashtable.m in Sources */,
				4B39844813D3AFB400E6F825 /* OFMutableSet.m in Sources */,
				4BA85BCD140ECCE800E91D51 /* OFMutableSet_hashtable.m in Sources */,
				4B3D239D1337FC0D00DD29B8 /* OFMutableString.m in Sources */,
				4B552553147AA5DB0003BF47 /* OFMutableString_UTF8.m in Sources */,
				4B4116D21F21654200E78916 /* OFMutableURL.m in Sources */,
				4B674404163C395900EB1E59 /* OFMutex.m in Sources */,
				4B511B7D139C0A34003764A5 /* OFNull.m in Sources */,
				4B3D239E1337FC0D00DD29B8 /* OFNumber.m in Sources */,
				4B3D239F1337FC0D00DD29B8 /* OFObject.m in Sources */,
				4BB25E89139C388A00F574EA /* OFObject+Serialization.m in Sources */,
				4BAFC169182EAA7800BE5E57 /* OFOptionsParser.m in Sources */,
				4B3D23A01337FC0D00DD29B8 /* OFPlugin.m in Sources */,

Modified src/Makefile from [8cf2a2c1f8] to [7185ae12bc].

36
37
38
39
40
41
42

43
44
45
46
47
48
49
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50







+







       OFMapTable.m			\
       OFMD5Hash.m			\
       OFMessagePackExtension.m		\
       OFMutableArray.m			\
       OFMutableDictionary.m		\
       OFMutableSet.m			\
       OFMutableString.m		\
       OFMutableURL.m			\
       OFNull.m				\
       OFNumber.m			\
       OFObject.m			\
       OFObject+KeyValueCoding.m	\
       OFObject+Serialization.m		\
       OFOptionsParser.m		\
       ${OFPROCESS_M}			\

Modified src/OFHTTPRequest.m from [41b78f73e9] to [4701092438].

103
104
105
106
107
108
109
110

111
112
113
114
115
116
117
103
104
105
106
107
108
109

110
111
112
113
114
115
116
117







-
+







}

- initWithURL: (OFURL *)URL
{
	self = [self init];

	@try {
		[self setURL: URL];
		_URL = [URL copy];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

Modified src/OFHTTPServer.m from [d18b7e3988] to [db503301c5].

616
617
618
619
620
621
622
623

624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643

644
645
646
647
648
649
650
651
652
653
654
655
656
657
658


659
660
661
662
663
664
665
616
617
618
619
620
621
622

623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642

643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667







-
+



















-
+















+
+







			      date, [_server name]];

	return false;
}

- (void)createResponse
{
	OFURL *URL;
	OFMutableURL *URL;
	OFHTTPRequest *request;
	OFHTTPServerResponse *response;
	size_t pos;

	[_timer invalidate];
	[_timer release];
	_timer = nil;

	if (_host == nil || _port == 0) {
		if (_HTTPMinorVersion > 0) {
			[self sendErrorAndClose: 400];
			return;
		}

		[_host release];
		_host = [[_server host] retain];
		_port = [_server port];
	}

	URL = [OFURL URL];
	URL = [OFMutableURL URL];
	[URL setScheme: @"http"];
	[URL setHost: _host];
	[URL setPort: _port];

	if ((pos = [_path rangeOfString: @"?"].location) != OF_NOT_FOUND) {
		OFString *path, *query;

		path = [_path substringWithRange: of_range(0, pos)];
		query = [_path substringWithRange:
		    of_range(pos + 1, [_path length] - pos - 1)];

		[URL setPath: path];
		[URL setQuery: query];
	} else
		[URL setPath: _path];

	[URL makeImmutable];

	request = [OFHTTPRequest requestWithURL: URL];
	[request setMethod: _method];
	[request setProtocolVersion:
	    (of_http_request_protocol_version_t){ 1, _HTTPMinorVersion }];
	[request setHeaders: _headers];
	[request setBody: _body];

Added src/OFMutableURL.h version [bdc8d2dd1d].






























































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
 *   Jonathan Schleifer <js@heap.zone>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFURL.h"

OF_ASSUME_NONNULL_BEGIN

/*!
 * @class OFMutableURL OFMutableURL.h ObjFW/OFMutableURL.h
 *
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFMutableURL: OFURL
/*!
 * The scheme part of the URL.
 */
@property (readwrite, nonatomic, copy) OFString *scheme;

/*!
 * The host part of the URL.
 */
@property (readwrite, nonatomic, copy) OFString *host;

/*!
 * The port part of the URL.
 */
@property (readwrite, nonatomic) uint16_t port;

/*!
 * The user part of the URL.
 */
@property OF_NULLABLE_PROPERTY (readwrite, nonatomic, copy) OFString *user;

/*!
 * The password part of the URL.
 */
@property OF_NULLABLE_PROPERTY (readwrite, nonatomic, copy) OFString *password;

/*!
 * The path part of the URL.
 */
@property (readwrite, nonatomic, copy) OFString *path;

/*!
 * The parameters part of the URL.
 */
@property OF_NULLABLE_PROPERTY (readwrite, nonatomic, copy)
    OFString *parameters;

/*!
 * The query part of the URL.
 */
@property OF_NULLABLE_PROPERTY (readwrite, nonatomic, copy) OFString *query;

/*!
 * The fragment part of the URL.
 */
@property OF_NULLABLE_PROPERTY (readwrite, nonatomic, copy) OFString *fragment;

/*!
 * @brief Creates a new mutable URL.
 *
 * @return A new, autoreleased OFMutableURL
 */
+ (instancetype)URL;

/*!
 * @brief Initializes an already allocated OFMutableURL.
 *
 * @return An initialized OFMutableURL
 */
- init;

/*!
 * @brief Converts the mutable URL to an immutable URL.
 */
- (void)makeImmutable;
@end

OF_ASSUME_NONNULL_END

Added src/OFMutableURL.m version [60a5553f44].














































































































1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
 *   Jonathan Schleifer <js@heap.zone>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#import "OFMutableURL.h"
#import "OFURL+Private.h"

@implementation OFMutableURL
@dynamic scheme, host, port, user, password, path, parameters, query, fragment;

+ (instancetype)URL
{
	return [[[self alloc] init] autorelease];
}

- init
{
	return [super of_init];
}

- (void)setScheme: (OFString *)scheme
{
	OFString *old = _scheme;
	_scheme = [scheme copy];
	[old release];
}

- (void)setHost: (OFString *)host
{
	OFString *old = _host;
	_host = [host copy];
	[old release];
}

- (void)setPort: (uint16_t)port
{
	_port = port;
}

- (void)setUser: (OFString *)user
{
	OFString *old = _user;
	_user = [user copy];
	[old release];
}

- (void)setPassword: (OFString *)password
{
	OFString *old = _password;
	_password = [password copy];
	[old release];
}

- (void)setPath: (OFString *)path
{
	OFString *old = _path;
	_path = [path copy];
	[old release];
}

- (void)setParameters: (OFString *)parameters
{
	OFString *old = _parameters;
	_parameters = [parameters copy];
	[old release];
}

- (void)setQuery: (OFString *)query
{
	OFString *old = _query;
	_query = [query copy];
	[old release];
}

- (void)setFragment: (OFString *)fragment
{
	OFString *old = _fragment;
	_fragment = [fragment copy];
	[old release];
}

- copy
{
	OFMutableURL *copy = [self mutableCopy];

	[copy makeImmutable];

	return copy;
}

- (void)makeImmutable
{
	object_setClass(self, [OFURL class]);
}
@end

Added src/OFURL+Private.h version [d23950c061].


























1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
 *   Jonathan Schleifer <js@heap.zone>
 *
 * All rights reserved.
 *
 * This file is part of ObjFW. It may be distributed under the terms of the
 * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
 * the packaging of this file.
 *
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFURL.h"

OF_ASSUME_NONNULL_BEGIN

@interface OFURL ()
- (instancetype)of_init OF_METHOD_FAMILY(init);
@end

OF_ASSUME_NONNULL_END

Modified src/OFURL.h from [2905af2049] to [94ac818021].

22
23
24
25
26
27
28
29

30
31
32
33
34
35
36
37
38
39

40
41
42
43
44

45
46
47
48
49

50
51
52
53
54

55
56
57
58
59

60
61
62
63
64

65
66
67
68
69

70
71
72
73
74

75
76
77
78
79

80
81
82
83
84
85
86
87
88
89
90
91
92
93
22
23
24
25
26
27
28

29
30
31
32
33
34
35
36
37
38

39
40
41
42
43

44
45
46
47
48

49
50
51
52
53

54
55
56
57
58

59
60
61
62
63

64
65
66
67
68

69
70
71
72
73

74
75
76
77
78

79







80
81
82
83
84
85
86







-
+









-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+
-
-
-
-
-
-
-







@class OFString;

/*!
 * @class OFURL OFURL.h ObjFW/OFURL.h
 *
 * @brief A class for parsing URLs and accessing parts of it.
 */
@interface OFURL: OFObject <OFCopying, OFSerialization>
@interface OFURL: OFObject <OFCopying, OFMutableCopying, OFSerialization>
{
	OFString *_scheme, *_host;
	uint16_t _port;
	OFString *_user, *_password, *_path, *_parameters, *_query, *_fragment;
}

/*!
 * The scheme part of the URL.
 */
@property (nonatomic, copy) OFString *scheme;
@property (readonly, nonatomic, copy) OFString *scheme;

/*!
 * The host part of the URL.
 */
@property (nonatomic, copy) OFString *host;
@property (readonly, nonatomic, copy) OFString *host;

/*!
 * The port part of the URL.
 */
@property (nonatomic) uint16_t port;
@property (readonly, nonatomic) uint16_t port;

/*!
 * The user part of the URL.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *user;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *user;

/*!
 * The password part of the URL.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *password;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *password;

/*!
 * The path part of the URL.
 */
@property (nonatomic, copy) OFString *path;
@property (readonly, nonatomic, copy) OFString *path;

/*!
 * The parameters part of the URL.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *parameters;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *parameters;

/*!
 * The query part of the URL.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *query;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *query;

/*!
 * The fragment part of the URL.
 */
@property OF_NULLABLE_PROPERTY (nonatomic, copy) OFString *fragment;
@property OF_NULLABLE_PROPERTY (readonly, nonatomic, copy) OFString *fragment;

/*!
 * @brief Creates a new URL.
 *
 * @return A new, autoreleased OFURL
 */
+ (instancetype)URL;

/*!
 * @brief Creates a new URL with the specified string.
 *
 * @param string A string describing a URL
 * @return A new, autoreleased OFURL
 */
107
108
109
110
111
112
113


114
115
116
117
118
119
120
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115







+
+







/*!
 * @brief Creates a new URL with the specified local file path.
 *
 * @param path The local file path
 * @return A new, autoreleased OFURL
 */
+ (instancetype)fileURLWithPath: (OFString *)path;

- init OF_UNAVAILABLE;

/*!
 * @brief Initializes an already allocated OFURL with the specified string.
 *
 * @param string A string describing a URL
 * @return An initialized OFURL
 */
136
137
138
139
140
141
142


131
132
133
134
135
136
137
138
139







+
+
 *
 * @return The URL as a string
 */
- (OFString *)string;
@end

OF_ASSUME_NONNULL_END

#import "OFMutableURL.h"

Modified src/OFURL.m from [b76d8bb1be] to [114ec293ed].

16
17
18
19
20
21
22

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55

56
57
58
59


60
61
62
63
64










65
66
67
68
69
70
71
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32




33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80







+









-
-
-
-



















-
+




+
+





+
+
+
+
+
+
+
+
+
+








#include "config.h"

#include <stdlib.h>
#include <string.h>

#import "OFURL.h"
#import "OFURL+Private.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFXMLElement.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfMemoryException.h"

@implementation OFURL
@synthesize scheme = _scheme, host = _host, port = _port, user = _user;
@synthesize password = _password, path = _path, parameters = _parameters;
@synthesize query = _query, fragment = _fragment;

+ (instancetype)URL
{
	return [[[self alloc] init] autorelease];
}

+ (instancetype)URLWithString: (OFString *)string
{
	return [[[self alloc] initWithString: string] autorelease];
}

+ (instancetype)URLWithString: (OFString *)string
		relativeToURL: (OFURL *)URL
{
	return [[[self alloc] initWithString: string
			       relativeToURL: URL] autorelease];
}

+ (instancetype)fileURLWithPath: (OFString *)path
{
	OFURL *URL = [OFURL URL];
	OFMutableURL *URL = [OFMutableURL URL];
	void *pool = objc_autoreleasePoolPush();

	[URL setScheme: @"file"];
	[URL setPath: [[path pathComponents] componentsJoinedByString: @"/"]];

	[URL makeImmutable];

	objc_autoreleasePoolPop(pool);

	return URL;
}

- init
{
	OF_INVALID_INIT_METHOD
}

- (instancetype)of_init
{
	return [super init];
}

- initWithString: (OFString *)string
{
	char *UTF8String, *UTF8String2 = NULL;

	self = [super init];

357
358
359
360
361
362
363
364













































365
366


367
368





369
370
371
372
373
374
375
376
377
378









379
380
381
382
383
384
385
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422


423
424
425
426
427
428









429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444








+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+


+
+
-
-
+
+
+
+
+

-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+







	OF_HASH_ADD_HASH(hash, [_query hash]);
	OF_HASH_ADD_HASH(hash, [_fragment hash]);

	OF_HASH_FINALIZE(hash);

	return hash;
}

- (OFString *)scheme
{
	return _scheme;
}

- (OFString *)host
{
	return _host;
}

- (uint16_t)port
{
	return _port;
}

- (OFString *)user
{
	return _user;
}

- (OFString *)password
{
	return _password;
}

- (OFString *)path
{
	return _path;
}

- (OFString *)parameters
{
	return _parameters;
}

- (OFString *)query
{
	return _query;
}

- (OFString *)fragment
{
	return _fragment;
}

- copy
{
	return [self retain];
}
	OFURL *copy = [[[self class] alloc] init];


- mutableCopy
{
	OFMutableURL *copy = [[OFMutableURL alloc] init];

	@try {
		copy->_scheme = [_scheme copy];
		copy->_host = [_host copy];
		copy->_port = _port;
		copy->_user = [_user copy];
		copy->_password = [_password copy];
		copy->_path = [_path copy];
		copy->_parameters = [_parameters copy];
		copy->_query = [_query copy];
		copy->_fragment = [_fragment copy];
		[copy setScheme: _scheme];
		[copy setHost: _host];
		[copy setPort: _port];
		[copy setUser: _user];
		[copy setPassword: _password];
		[copy setPath: _path];
		[copy setParameters: _parameters];
		[copy setQuery: _query];
		[copy setFragment: _fragment];
	} @catch (id e) {
		[copy release];
		@throw e;
	}

	return copy;
}

Modified tests/OFArrayTests.m from [9dfa280d32] to [b0ab3f0686].

433
434
435
436
437
438
439
440
441
442



443
444
445
446
447
448
449
433
434
435
436
437
438
439



440
441
442
443
444
445
446
447
448
449







-
-
-
+
+
+







	    valueForKey: @"length"] isEqual:
	    [arrayClass arrayWithObjects: [OFNumber numberWithSize: 3],
	    [OFNumber numberWithSize: 3], [OFNumber numberWithSize: 6], nil]] &&
	    [[[arrayClass arrayWithObjects: @"1", @"2", nil]
	    valueForKey: @"@count"] isEqual: [OFNumber numberWithSize: 2]])

	m[0] = [mutableArrayClass arrayWithObjects:
	    [OFURL URLWithString: @"http://foo.bar/"],
	    [OFURL URLWithString: @"http://bar.qux/"],
	    [OFURL URLWithString: @"http://qux.quxqux/"], nil];
	    [OFMutableURL URLWithString: @"http://foo.bar/"],
	    [OFMutableURL URLWithString: @"http://bar.qux/"],
	    [OFMutableURL URLWithString: @"http://qux.quxqux/"], nil];
	TEST(@"-[setValue:forKey:]",
	    R([m[0] setValue: [OFNumber numberWithShort: 1234]
		      forKey: @"port"]) &&
	    [m[0] isEqual: [arrayClass arrayWithObjects:
	    [OFURL URLWithString: @"http://foo.bar:1234/"],
	    [OFURL URLWithString: @"http://bar.qux:1234/"],
	    [OFURL URLWithString: @"http://qux.quxqux:1234/"], nil]])