Commit graph

8513 commits

Author SHA1 Message Date
Frederik Seiffert
f0e33a48d5 Fix NSFileManager thread safety 2023-07-26 11:56:04 +02:00
Royal Stewart
337ebbea0b Initial commit of updated IPv6 2023-07-25 10:06:20 -06:00
Richard Frith-Macdonald
c6df659d35 iClose socket if we end loading with an I/O operation in progress 2023-06-26 12:55:01 +01:00
Richard Frith-Macdonald
e3b7fa5720 Fix for possible crash after instance deallocated 2023-06-15 10:21:39 +01:00
Frederik Seiffert
f3555406af Add stub methods for secure unarchiving 2023-05-10 06:59:40 +02:00
Frederik Seiffert
810061f6e7 NSOrderedSet: Fix keyed encoding to match Apple platforms 2023-05-04 12:46:37 +02:00
Frederik Seiffert
37913d006d Fix GSXML compatibility with libxml2 v2.11.0
Fixes #294.
2023-05-04 12:46:08 +02:00
Richard Frith-Macdonald
a5a1ef0413 Ignorew writabel descriptor when we have nothng to write 2023-05-04 09:59:31 +01:00
Frederik Seiffert
52548e3d09 Fix -[NSFileManager contentsOfDirectoryAtURL:...] 2023-04-27 10:51:15 +02:00
Richard Frith-Macdonald
a2f63bfec0 use non-blocking mode to accept connections 2023-04-13 14:27:09 +01:00
rfm
96a8613dbc
Merge pull request #291 from qmfrederik/fixes/nsdata-base64-empty-string
`[NSData initWithBase64EncodedString]`: Fix decoding of an empty string
2023-04-07 15:29:22 +01:00
Frederik Carlier
081f890be8 [NSData initWithBase64EncodedString]: Fix decoding of an empty string
Don't call `NSZoneRealloc` with a length of 0, but free the zone and return an empty `NSData` buffer instead.
2023-04-06 21:54:46 +00:00
Richard Frith-Macdonald
c7125ec291 Fix for github bug #289 2023-03-23 21:38:46 +00:00
Frederik Seiffert
72b1233c2a NSURLSession: fix memory management in GSTransferState 2023-03-11 20:22:00 +01:00
Frederik Seiffert
7e7cac89aa NSURLSession: fix libcurl debug output 2023-03-11 20:22:00 +01:00
Frederik Seiffert
1efd805421 NSURLSession: improve protocol detection 2023-03-11 20:22:00 +01:00
Frederik Seiffert
82d9917c2c NSURLSession: implement missing body data for data completion handlers
Now using the previously unused "in-memory" body data drain if a task has a completion handler, which requires the full body to be passed on completion.

Also consolidated private NSURLSessionTask methods, some of which were previously implemented twice in separate categories with the same name, leading to possible undefined runtime behavior.
2023-03-11 20:22:00 +01:00
Frederik Seiffert
153482ea94 NSURLSession: use mutable data for transfer state body 2023-03-11 20:22:00 +01:00
Frederik Seiffert
c0a6227013 NSURLSession: call getTasks callbacks on delegate queue
Matches the documented behavior.
2023-03-11 20:22:00 +01:00
Frederik Seiffert
3c27683c03 NSURLSession: create dispatch queues using target and use lock instead of queue for session identifier
Creating stand-alone dispatch queues without a target is discouraged.
2023-03-11 20:22:00 +01:00
Frederik Seiffert
15499e1017 NSURLSession: optimized timout timer and fixed memory management 2023-03-11 20:22:00 +01:00
Frederik Seiffert
cb6c53b84d Fix NSURLSession header fields not always being matched case insensitive. 2023-03-11 20:22:00 +01:00
Frederik Seiffert
18f81f9ccc Fix NSURLSession memory management of libdispatch objects and overrelease in GSHTTPURLProtocol. 2023-03-11 20:22:00 +01:00
Frederik Seiffert
2f5b26df06 Add missing NSURLSession APIs 2023-03-11 20:22:00 +01:00
Richard Frith-Macdonald
3631c4b068 Fix possible exception setting header value 2023-02-09 11:03:21 +00:00
Richard Frith-Macdonald
b8aedfc53e Fix recently introduced bug with premature connection close 2023-02-01 19:17:12 +00:00
Richard Frith-Macdonald
b549e72432 assign result of init to self 2023-01-25 11:44:06 +00:00
Richard Frith-Macdonald
d17ad36c53 Tidied to assign result of init to self 2023-01-25 11:40:50 +00:00
Richard Frith-Macdonald
10f86fed2d revert stupid change 2023-01-24 14:09:53 +00:00
Richard Frith-Macdonald
35a763f3cb Aim to improve thread safety of stacktrace generation. 2023-01-24 11:35:14 +00:00
Fred Kiefer
47b6e9d052
Merge pull request #283 from qmfrederik/features/nsfilemanager-setattribute
implement setAttributes:ofItemAtPath:error: method
2022-12-11 18:14:26 +01:00
Doug Simons
bf586eca1b implement setAttributes:ofItemAtPath:error: method
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/gnustep_testplant_branch@40428 72102866-910b-0410-8b05-ffd578937521
2022-12-09 15:58:39 +01:00
Richard Frith-Macdonald
91108c69c3 tweak handling of parser abort 2022-12-09 10:23:14 +00:00
Richard Frith-Macdonald
1cb6ef8572 Attept to support proxy environment variables 2022-11-29 11:16:36 +00:00
Fred Kiefer
1a96e83c08 * Source/Additions/GSXML.m: Remove usage of deprecated function
when a newer version of libxml is used.
2022-11-26 14:26:30 +01:00
Richard Frith-Macdonald
4a03bbc328 make bitfield flags obey consistency standards for BOOL ... set based on a C truth value, get a YES or a NO 2022-11-22 14:43:19 +00:00
Richard Frith-Macdonald
8cb9495ad7 Cosmetic coding standard tweak for clarity and to avoid unreasonably long lines. 2022-11-22 14:22:03 +00:00
Wolfgang Lux
47d2446df4 Really skip hidden files when requested in a directory enumeration 2022-11-21 12:03:06 +01:00
Richard Frith-Macdonald
d5d8a71c79 Allow certificate based rejection of DO connection attempts. 2022-11-21 10:40:33 +00:00
rfm
a9901204e2
Merge pull request #269 from gnustep/libcurl-autoconf
Rewrite autoconf libcurl detection
2022-11-21 10:30:41 +00:00
Richard Frith-Macdonald
326da37967 improve event handling when there is data in the tls buffers 2022-11-15 15:28:31 +00:00
Richard Frith-Macdonald
78642305c6 Fix for occasional hang 2022-11-07 10:03:16 +00:00
sbeard-eh
1a3d869ab1
Fix for locale handling changes in ICU 64
Since ICU 64, the locale handling has changed such that passing an empty string to uloc_canonicalize no longer returns the en_US_POSIX locale as it did in previous versions. 
See https://icu.unicode.org/download/64#h.plg55ia6o3du
2022-11-01 20:20:48 +00:00
Richard Frith-Macdonald
37f5a2f9e1 tweak life of the I/O of a connection. 2022-10-21 16:37:54 +01:00
Richard Frith-Macdonald
09a9a8fe5b Honor SSL_CERT_FILE environment vartiable 2022-10-20 10:24:42 +01:00
Richard Frith-Macdonald
0ca9110ef5 fix trivial typo in cache key format 2022-10-18 20:04:28 +01:00
Richard Frith-Macdonald
726d24bac7 Make http keepalive for GSHTTPURLHandle more robust. 2022-10-18 18:01:02 +01:00
Richard Frith-Macdonald
9581933fd6 Add hints for static analyzer and correct function return type. 2022-09-28 13:48:35 +01:00
Richard Frith-Macdonald
0f9edb188b fix leak 2022-09-26 16:23:15 +01:00
Richard Frith-Macdonald
a38cc90403 fix leak 2022-09-26 16:18:39 +01:00
Richard Frith-Macdonald
b847a444b3 fix leak 2022-09-26 16:15:47 +01:00
Richard Frith-Macdonald
a021005af7 fix leak 2022-09-26 16:03:32 +01:00
Richard Frith-Macdonald
e48cfb9587 Minor mutability corrections 2022-09-15 14:52:15 +01:00
Richard Frith-Macdonald
bdfdb7a51b Revert "Add header needed on OSX" ... made in wrong branch
This reverts commit 0a6ced7713.
2022-08-25 09:53:28 +01:00
Richard Frith-Macdonald
86461e2c95 tweaks to build on OSX 2022-08-25 09:45:34 +01:00
Richard Frith-Macdonald
0a6ced7713 Add header needed on OSX 2022-08-25 09:35:40 +01:00
Hugo Melder
7fd20d1ae3
NSPredicate Value Fix
* Check if object is an NSExpression object

* Fix Indentation

* Update Changelog

* Add test case
2022-08-24 18:01:30 +02:00
Hugo Melder
a2eb35fd2f Remove undefined macro 2022-08-23 19:12:01 +02:00
Hugo Melder
32eb5d2acd
win32: Support overlapped (asynchronous) I/O on standard streams in GSFileHandle
* win32: Support overlapped I/O on standard streams in GSFileHandle

* Add isStandardInput instance variable

* Restrict PeekConsoleInput on stdin

* Update ChangeLog
2022-08-23 18:43:14 +02:00
Richard Frith-Macdonald
560b1d19fb relax limit on maximum concurrent operations 2022-08-16 09:36:27 +01:00
Hugo Melder
9a0b660299
Merge branch 'master' into NSTimeZone-win32-fix 2022-08-11 11:59:07 +02:00
Hugo Melder
baf1bb9f73 initWithScheme:host:path: update parser to detect Windows ALPHA symbol 2022-08-10 17:14:24 +02:00
Hugo Melder
3aa2d1912c Enclose changes into preprocessor conditional 2022-08-08 11:08:03 +02:00
Hugo Melder
3c095da62f Windows to IANA time zone conversion: remove unsupported TIME_ZONE_ID_DAYLIGHT conversion 2022-08-07 10:55:20 +02:00
Frederik Seiffert
42efca0754 Fix time zone lookup on Windows MSVC when using non-English locale 2022-08-03 17:05:23 +02:00
Richard Frith-Macdonald
abd5223579 Fixup debug logging of http requests with authentication 2022-07-27 13:52:01 +01:00
Richard Frith-Macdonald
2ffa8c1cad Return errors and use them to raise exception in -launch 2022-06-16 11:52:04 +01:00
Gregory John Casamento
94b08cf647 Implement launch in terms of launchAndReturnError: 2022-06-14 03:16:21 -04:00
Gregory John Casamento
dcb1a0ab1a Implement launchAndReturnError: 2022-06-08 14:58:18 -04:00
Gregory John Casamento
664daf4ed0 Fix accidental close parenthesis 2022-06-08 14:37:17 -04:00
Gregory John Casamento
bcc87bccda Implement 10.13 methods for NSTask 2022-06-08 14:09:09 -04:00
Gregory John Casamento
6c7386f5e1 Add new methods for NSTask 2022-06-07 21:32:11 -04:00
Richard Frith-Macdonald
1934ce6205 Changes to avoid placing sensitive information in debug logs. 2022-05-20 12:32:31 +01:00
Frederik Seiffert
8ca4381676 Add userInfo accessor to NSProgress. 2022-04-29 19:54:09 +02:00
Richard Frith-Macdonald
57eae2e779 Small logging improvement for exception returned when we are expecting nothing 2022-04-14 15:46:21 +01:00
Richard Frith-Macdonald
9460d6a469 Normalize repeated combining characters to a single one 2022-04-07 14:35:05 +01:00
Gregory John Casamento
71e07e1a82 Add component:fromDate: 2022-04-04 23:57:10 -04:00
Gregory John Casamento
cb87724a21 Add 10.9 methods for getEra:..., getHour:... etc 2022-04-04 19:26:22 -04:00
Gregory John Casamento
95a24fb651 Add new methods for NSIndexPath. Add row, section, item and new init methods 2022-03-07 07:35:12 -05:00
Richard Frith-Macdonald
ae72ee4593 Fix for #243 2022-03-07 10:13:44 +00:00
Gregory John Casamento
77e6315e2e Correct issues as discussed in PR by Fred and Richard. 2022-03-06 20:59:27 -05:00
Gregory John Casamento
f42def6ea5 Add necessary methods to NSIndexPath to support NSCollectionView with layouts. Needed item,section information in NSIndexPath object 2022-03-03 02:26:33 -05:00
Richard Frith-Macdonald
ea1575b63c fix bug in testing whether an NSDistantObject responds to selectors. 2022-02-25 13:00:55 +00:00
Gregory John Casamento
0fd132fe9f Minor change: Update DocMakefile with all headers. 2022-02-21 14:47:08 -05:00
Frederik Seiffert
b6740f0f6c Fix some checks when using ICU DLL from Windows 10 2022-02-18 19:06:54 +01:00
Richard Frith-Macdonald
0b1a2d4d66 Tidy positioning of semicolon to be inside IF_NO_ARC() macros so it won't appear in the source when compiled with ARC 2022-02-17 10:21:36 +00:00
Richard Frith-Macdonald
c76ebf2962 Replaced IF_NO_GC() macro calls with the more descriptive IF_NO_ARC()
and deprecate it.  Searched for and removed obsolete references to
garbage collection in comments and documentation.
2022-02-17 10:08:18 +00:00
Richard Frith-Macdonald
6837924e60 Provde more informative debug output when TLS handshake fails 2022-02-17 09:05:49 +00:00
Richard Frith-Macdonald
3bc05ad580 Patch by Larry Campvell for git #237 2022-02-12 13:06:23 +00:00
Richard Frith-Macdonald
a89dc604dd Fix minor debug logging error 2022-02-11 17:39:47 +00:00
Richard Frith-Macdonald
e9ed77fb68 Fixups for memory amangement and thread safety issues 2022-01-31 16:57:10 +00:00
Richard Frith-Macdonald
f1b3144209 Rewrite last change to be a little more efficient 2022-01-31 12:18:24 +00:00
Richard Frith-Macdonald
f3344628e5 fix for arrya constant 2022-01-30 17:24:32 +00:00
Sergei Golovin
cce60ccc51 * use handle from the cache only if the caller asked 2022-01-30 06:54:56 +04:00
Frederik Seiffert
6657796e15 Use GSNativeChar where applicable 2022-01-26 10:33:33 +01:00
Frederik Seiffert
1aab02b622 Fix NSTemporaryDirectory() returning path with backslashes on Windows 2022-01-26 10:33:33 +01:00
Frederik Seiffert
542d870302 Fix time zone lookup on Windows MSVC by converting Windows timezone name to IANA identifier 2022-01-26 10:33:33 +01:00
Richard Frith-Macdonald
bed2935a7e change to avoid compiler warning 2022-01-04 12:57:55 +00:00
Richard Frith-Macdonald
cc38a942f2 Restore Canonical names of gnustep extension encodings 2022-01-04 12:46:56 +00:00
Richard Frith-Macdonald
81ad2f403b Reinstate removed string encodings. 2022-01-04 10:12:58 +00:00
Fred Kiefer
e6fc2740a2
Merge pull request #228 from levinli303/simplified-chinese
Add support for Simplified Chinese
2021-12-31 11:19:30 +01:00
Fred Kiefer
d7dc4d5323
Merge pull request #227 from levinli303/master
Complete string encoding localization
2021-12-31 11:18:10 +01:00
Levin Li
e9a21ffd2b Fix test failure by adding memset 2021-12-31 15:18:04 +08:00
Levin Li
c4730de6bd Add Simplified Chinese resources 2021-12-30 21:26:53 +08:00
Levin Li
f64f13c2a7 Implement NSGB_18030_2000StringEncoding, NSGB_2312_80StringEncoding, NSGBK_95StringEncoding 2021-12-30 21:06:28 +08:00
Frederik Seiffert
b4ae7f7486 Fix handling of concurrent NSOperations 2021-12-27 21:52:34 +01:00
Fred Kiefer
e797128a03
Merge pull request #226 from levinli303/master
Support more DOS/Windows string encodings
2021-12-26 13:08:56 +01:00
Frederik Seiffert
7a5c2a6550 Default to UTF-8 when reading localized string files without BOM. 2021-12-26 11:43:43 +01:00
Frederik Seiffert
4c1b2ef7d6 Fix Unicode checks for Windows using icu.h 2021-12-26 11:43:43 +01:00
Levin Li
fe2f41c7f1 Use encoding number values from Apple 2021-12-26 14:22:04 +08:00
Levin Li
ca6145efdd Support more DOS/Windows encodings 2021-12-25 16:36:18 +08:00
rfm
5f259c1658
Merge pull request #222 from iamleeg/nsdebugenabled
Add the NSDebugEnabled boolean
2021-12-21 08:55:51 +00:00
rfm
4db3f5c881
Merge pull request #220 from levinli303/patch-1
Do not call handler blocks if they are nil
2021-12-21 08:39:38 +00:00
Richard Frith-Macdonald
40de7fa39a Try to improve tls disconnect behavior where there are networking issues 2021-12-07 19:28:23 +00:00
Steven R. Baker
7525d942b7 Add the NSDebugEnabled boolean 2021-11-30 21:14:29 +00:00
Richard Frith-Macdonald
0950bed43b Tweak whitespace for code consistency 2021-11-29 14:01:41 +00:00
Richard Frith-Macdonald
85711ee5f8 coding standard tweaks 2021-11-27 10:59:15 +00:00
Levin Li
5b151c5fa0 Do not call handler blocks if they are nil 2021-11-23 18:34:34 +08:00
Frederik Seiffert
0af2c6de72 Add required cast in case nil is not defined as id 2021-11-13 22:16:46 +01:00
Richard Frith-Macdonald
b55ee6b0c5 Clarify that run loop watchers are NOT retained, and are responsible for removing themselves from the run loop when they have finished watching for events. 2021-11-11 10:01:52 +00:00
Mads Marquart
4033ee28a8 Fix NSGetSizeAndAlignment usage
The argument order is (*sizep, *alignp), but it was often incorrectly used the other way around.
2021-11-02 10:18:05 +01:00
Mads Marquart
d439847ba6
Fix NSData initWithBytesNoCopy:length:deallocator:
The previous implementation simply swizzled `NSData` into `NSDataWithDeallocatorBlock`, and forgot to actually assign `bytes` and `length`.
2021-10-29 09:17:56 +02:00
Frederik Seiffert
47480d781a Add missing export declarations required by libs-gui on Windows MSVC 2021-10-26 10:28:51 +02:00
Frederik Seiffert
80f05c2278 Fix -[NSFileManager URLForDirectory:...] using incorrect NSURL initializer and simplified implementation 2021-10-20 18:42:21 +02:00
Richard Frith-Macdonald
c307a04a39 Fix minor leaks 2021-09-16 10:25:26 +01:00
Richard Frith-Macdonald
149acc40ae fix minor potential leaks 2021-09-16 10:20:41 +01:00
Nuntius
b2983dc77a Workaround for the session retain loop 2021-09-04 13:07:14 +02:00
Nuntius
a5c66e7c5d Apply requested changes 2021-08-29 17:47:01 +02:00
Nuntius
a0ab740234 Implement URLSession:downloadTask:didFinishDownloadingToURL: delegate 2021-08-28 20:33:19 +02:00
Nuntius
d3e40dfc9d Begin implementation of NSURLSessionDownloadTask 2021-08-27 21:56:08 +02:00
Richard Frith-Macdonald
6d5084e3e1 Delete commented out code accidentally left in on last commit 2021-08-27 10:52:32 +01:00
Richard Frith-Macdonald
00db92e146 Merge remote-tracking branch 'origin/master' into nstimezone 2021-08-27 09:37:51 +01:00
Richard Frith-Macdonald
0d12a1e77e Changes to address mostm of Fred's comments 2021-08-27 09:19:38 +01:00
Frederik Seiffert
170701f7e6 Fix building for Windows MSVC with recent toolchain 2021-08-19 11:05:33 +02:00
rfm
1e8ff8e628
Merge branch 'master' into nstimezone 2021-08-18 14:52:24 +01:00
Richard Frith-Macdonald
1fe008304a Formatting tidyups 2021-08-18 14:03:25 +01:00
Nuntius
ca5e4fc239 Adjust formatting 2021-08-17 15:03:09 +00:00
Nuntius
c3daa41f2d Fix indentation 2021-08-17 13:57:37 +00:00
Nuntius
866bdd0636 Merge branch 'master' of https://github.com/Fokka-Engineering/libs-base into new-nsurl-methods 2021-08-17 13:00:09 +00:00
Nuntius
9b3caf99fd Implement 10.11 NSURL initFileURLWithPath: initializers 2021-08-17 10:30:19 +00:00
Richard Frith-Macdonald
96ef94862f Add debug log for certificat request which is not for x509 2021-08-17 11:10:23 +01:00
Richard Frith-Macdonald
ae8d496f91 Remove spurous line in last change 2021-08-16 14:00:09 +01:00
Richard Frith-Macdonald
19809ac46d tweak for ms-windows 2021-08-16 12:48:48 +01:00
Richard Frith-Macdonald
78ab878029 more simplifications and removal of unused defines etc 2021-08-16 11:45:42 +01:00
Richard Frith-Macdonald
a0852146c9 Avoid O_CLOEXEC for portability 2021-08-14 12:49:12 +01:00
Richard Frith-Macdonald
b71a5bfc40 Use our own struct tm 2021-08-14 12:43:44 +01:00
Richard Frith-Macdonald
11c50770d3 Use our own struct tm equivalent for portability 2021-08-14 12:42:26 +01:00
Richard Frith-Macdonald
2f2869ff20 Remove some useless defines and declarations 2021-08-14 12:22:03 +01:00
Richard Frith-Macdonald
c43ea6d474 Update for handling more future dates, and further testing. 2021-08-14 11:25:23 +01:00
Frederik Seiffert
f67c99dbcc win32: initialize Windows Sockets in NSObject only
And update to Windows Socket version 2.2. Also clean up the DllMain initialization to handle CRT init errors and call _CRT_INIT also on DLL/thread detach, and remove uneeded .idata section after removing WSAStartup() import.

WSAStartup() should not be called from DllMain according to MS documentation. Fixes #186.
2021-08-11 19:32:21 +02:00
Frederik Seiffert
b2f2a3a429 win32: fix warnings 2021-08-11 19:32:21 +02:00
Frederik Seiffert
acde7b062a Fix release method signature to match NSObject 2021-08-11 19:32:21 +02:00
Frederik Seiffert
27c06a9209 Fix various incorrect format string types 2021-08-11 19:32:21 +02:00
Frederik Seiffert
87dc8ab70c Fix incorrect method signature in win32/NSMessagePort 2021-08-11 19:32:21 +02:00
Frederik Seiffert
5a46f744df Fix incorrect string format in NSException 2021-08-11 19:32:21 +02:00
Frederik Seiffert
2d45396de0 Fix various incorrect log statements 2021-08-11 19:32:21 +02:00
Richard Frith-Macdonald
5162d888dc timezone updates for version2 files 2021-08-11 08:43:20 +01:00
Richard Frith-Macdonald
25b25080c3 Fix possible buffer overrun/corruption spotted by Fred. 2021-08-09 08:29:15 +01:00
Frederik Seiffert
35ef9423e0 Annotate callback functions with __stdcall on Windows
Fixes crash on exit on Windows x86.
2021-08-08 17:27:40 +02:00
Frederik Seiffert
55da62c1c1 Add missing import declaration on runtime declarations
Fixes warnings when building for Windows MSVC.
2021-08-08 17:27:40 +02:00
Frederik Seiffert
40f88bc622 Enable _C_BOOL on non GNU C compilers 2021-08-08 17:27:40 +02:00
Frederik Seiffert
3b8009654c Improve robustness of finding devroot on Windows
Fixes possible infinite loop if developer root is not found.

Also disable devroot() code under MSVC, as there will be no MSYS environment.
2021-08-08 17:27:40 +02:00
Frederik Seiffert
b41953d274 More robust check for Windows ICU
Also ensure that we don't include both unicode/*.h and icu.h.
2021-08-08 17:27:40 +02:00
Frederik Seiffert
dc32970502 Add support for using ICU DLL from Windows 10
Requires Windows 10 version 1903 (May 2019 Update):
https://docs.microsoft.com/en-us/windows/win32/intl/international-components-for-unicode--icu-

Also adds missing configure check for unicode/utext.h.
2021-08-03 16:52:38 +02:00
Frederik Seiffert
cf2dae1e21 Improve NSThread thread priority error handling
Now using sched_get_priority_min/max instead of PTHREAD_MIN/MAX_PRIORITY defines, and prevent error log when min/max priority are equal (e.g. 0), which happens e.g. on Android when thread priorities are not settable.
2021-07-29 14:22:27 +02:00
Frederik Seiffert
abfe4e2a04 Use native threading and locking APIs on Windows
Removes dependency on pthread library and uses fast Slim Reader/Writer (SRW) locks for NSLock/NSRecursiveLock/NSCondition/NSConditionLock as well as all internal locks. Adds GS_MUTEX_*() macros in GSPThread.h, that are being used for all internal locking instead of pthread APIs.

Also adds support for thread priorities on Windows, fixes method signature of +[NSThread setThreadPriority:] to match Apple platforms, and adds error handling in same method.
2021-07-29 14:22:27 +02:00
Richard Frith-Macdonald
3b8bbb00ba Try to make timezone parsing more robust: always use standard header for posix time zone files. 2021-07-29 10:35:19 +01:00
Richard Frith-Macdonald
0b3f2a9fb0 Fixup for incorrect method implementation used in sloppy parser. 2021-07-26 14:57:41 +01:00
Richard Frith-Macdonald
395fafde6f Set file version consistently to avoid misunderstanding 2021-07-25 07:50:31 +01:00
Richard Frith-Macdonald
7245156336 Add sup[port for 64bit time transitions 2021-07-22 10:33:49 +01:00
Frederik Seiffert
a377a86094 Fix possible memory corruption in string handling 2021-07-19 12:23:15 +02:00
Frederik Seiffert
813ae35d39 Export GSPathHandling() in GNUstep headers.
Fixes linker errors for some tests under Windows MSVC.
2021-07-14 10:09:45 +02:00
Frederik Seiffert
47ed291b80 Fix possible heap corruption when converting to NSNonLossyASCIIStringEncoding. 2021-07-03 08:34:14 +02:00
Richard Frith-Macdonald
a29248bd4d Differentiate between client/server for DO over TLS 2021-06-24 08:50:28 +01:00
Richard Frith-Macdonald
640198a395 add missing brace 2021-06-21 09:15:11 +01:00
Richard Frith-Macdonald
e34584e323 Encryption emprovements 2021-06-19 14:40:47 +01:00
Richard Frith-Macdonald
b252f4067a remove a couple of redundent lines 2021-06-18 10:02:48 +01:00
rfm
a1b0c1c8db
Merge pull request #185 from triplef/fix-unicode-lookup
Fix lookup of string encodings with high numeric values in encoding table
2021-06-18 10:01:36 +01:00
Frederik Seiffert
8137b5a2a0 Fix lookup of string encodings with high numeric values in encoding table 2021-06-17 17:53:22 +02:00
Richard Frith-Macdonald
dd3b6c3d7f fix typo in name 2021-06-17 16:22:31 +01:00
Richard Frith-Macdonald
7ea49c252b encryption fixes and debug improvements 2021-06-03 14:59:09 +01:00
Richard Frith-Macdonald
e9d3ba8179 Improve debug logging ... use the I/O handle as the tag for debug logs so that they can more easily be matched to the object for which the I/O is taking place. 2021-06-03 14:54:16 +01:00
Richard Frith-Macdonald
2fc16eae5e Tidyups for when TLS is not used 2021-06-02 14:12:28 +01:00
Richard Frith-Macdonald
f72f46efa4 Minor debug improvement 2021-06-02 13:32:44 +01:00
Richard Frith-Macdonald
a2298990fc Improve debug logging and fix tls session startup when we have to try connecting to multiple possible destinations 2021-06-01 16:32:25 +01:00
Richard Frith-Macdonald
dd52dfb36d Do more logging based on 'RMC' so we can track send/receive of messages 2021-06-01 16:31:21 +01:00
Richard Frith-Macdonald
29f76a5cba minor thread safety fix 2021-05-31 14:27:42 +01:00
Richard Frith-Macdonald
e42d9fdc6b New code for secure (encrypted) inter-host distrinuted objects. 2021-05-31 13:19:42 +01:00
Richard Frith-Macdonald
1bcb73f0f8 If space becomes available for a stream whose status is writing, we
should change the status to be open (the write completed).
2021-05-23 10:58:09 +01:00
Richard Frith-Macdonald
391c00b058 Added some debug logging 2021-05-19 11:15:29 +01:00
Richard Frith-Macdonald
12c88716d0 indentation tweaks 2021-05-19 11:06:10 +01:00
rfm
1aa11956b5
Merge pull request #183 from gnustep/windows-keepalive-fix
The portable way to detect if a socket is reusable or has been closed
2021-05-19 10:57:54 +01:00
Richard Frith-Macdonald
8b8fe60070 break out of loop if write fails 2021-05-15 17:53:44 +01:00
Richard Frith-Macdonald
ed9bb899a7 Support writing large chunks of data over tls on windows 2021-05-15 16:10:23 +01:00
Richard Frith-Macdonald
782e7aed31 Fix for -setHTTPMaximumConnectionLifetime: 2021-05-05 12:04:28 +01:00
Richard Frith-Macdonald
713c7c0f7e Fix one character truncation of certificate name/issuer in debug output 2021-04-28 15:27:23 +01:00
Richard Frith-Macdonald
31f2528b93 Ignore GS_EXPORT_CLASS when generating documentation for base/additions 2021-04-23 06:56:00 +01:00
Richard Frith-Macdonald
bd5f2909e6 Simplify conversion of a string to data (use base class code) and fix to handle the insertion of BOM consistently (as on OSX) for encodings where the byte order matters but is not specified by the encoding. 2021-04-14 09:57:11 +01:00
Riccardo Mottola
19d76d2478 The portable way to detect if a socket is reusable or has been closed
was failed, since its test read would leave the file handle with a read
in progress, invalidating further background reads. More recent versions
of Windows seem to handle the unix way.
2021-04-13 23:59:45 +02:00
Frederik Seiffert
843800d413 Add support for libobjc2 runtime in NSObject on Windows 2021-03-29 11:22:00 +02:00
Frederik Seiffert
0582eddd96 Export string constants and annotate exported function implementations
Moves scattered string constants to externs.m, and removes obsolete code replacing constant strings.
2021-03-27 17:36:15 +01:00
Frederik Seiffert
fb84b3b1e8 Revert "Export objc_enumerationMutation."
This is now correctly exported in the libobjc2 runtime.

This reverts commit c52f1e3223.
2021-03-26 21:03:48 +01:00
Frederik Seiffert
b05481a8c8 Don't resurrect GSFileHandle singletons.
It seems to be no longer possible to call -retain from -dealloc with the latest libobjc2, which was causing the tests to fail.

We are also throwing an exception in this case, which would need to be specifically caught in order for the resurrection to be of value to users, so this simply removes the -retain call and resets the singleton variables to nil in order to not have invalid pointers and for the singletons to be re-created on subsequent access.
2021-03-26 13:17:36 +01:00
Frederik Seiffert
c52f1e3223 Export objc_enumerationMutation.
When using clang a call to this is inserted by the compiler, so we need to always export it.
2021-03-26 13:17:36 +01:00
Frederik Seiffert
7800e27879 Add missing GS_EXPORT annotations to various string constants. 2021-03-26 13:17:36 +01:00
Riccardo Mottola
c9020acd4b suppress warning, compiler is confused by exception handler 2021-03-18 23:06:54 +01:00
Richard Frith-Macdonald
b489f9b82b Changes to detect that bfd_get_section_vma has changed to bfd_section_vma and make corresponding changes so we can support use of binutils 2.34 and later. 2021-03-18 21:35:34 +00:00
Richard Frith-Macdonald
4e61056743 The code in GSPrivateReturnAddresses() and the -symbols method must have ifdefs in matching order so that setup of the information from the stack matches the code used to generate the corresponding symbols. 2021-03-18 20:17:35 +00:00
Frederik Seiffert
5fb5fb46c4 Win MSVC: add NSFileManager support
Also unifies _CHAR in NSFileManager with GSNativeChar, as they are internally required to be the same.
2021-03-17 17:42:15 +01:00
Frederik Seiffert
54ae296b69 Fix libdispatch integration compilation error on Windows. 2021-03-17 17:42:15 +01:00
Richard Frith-Macdonald
d7e4086f6b Rewrite handling of tls handshake to operate asynchronously, attempting continuation of the handshake when the socket becomes readable. The point of this is to prevent recursive entry into the runloop (and possible stack overflow) if the remote end fails to send anything for a while. 2021-03-05 11:54:32 +00:00
Frederik Seiffert
172e75b865 Add unscheduled NSTimer block initializer. 2021-03-03 10:03:14 +01:00
Richard Frith-Macdonald
7c9c3b8605 Fix potential deadlock found by Wolfgang 2021-02-22 15:59:29 +00:00
Richard Frith-Macdonald
edc771775f fix missing check to see whether we have already initialised 2021-02-18 21:27:21 +00:00
Richard Frith-Macdonald
958449e90f Initialise XMLParser in main thread 2021-02-18 21:18:41 +00:00
Richard Frith-Macdonald
a93eab8549 fix typos in comments and remove leftover debug line 2021-02-15 19:58:30 +00:00
Richard Frith-Macdonald
b45feeb8d7 Fixes for SSL/TLS support using GNUTLS under MinGW. Use send/recv
rather than read/write in TLS push/pull functions (works with winsock
and unix) and perform mappings between winsock error codes and
unix/gnutls error codes so that we correctly repeat operations whe they
fail in non-blockign mode.
2021-02-13 11:08:06 +00:00
Richard Frith-Macdonald
19c32ba0f5 Enable NSFileHandle TLS support under mingw 2021-02-11 20:03:41 +00:00
Richard Frith-Macdonald
8f0a021adb Fix failure to send large requests, when the write operation succeeds but we have not written all the data we need to, we should write more as long as the stream has space available. 2021-02-06 11:23:09 +00:00
Richard Frith-Macdonald
b8169e26eb Fix null pointer dereference 2021-02-04 11:00:05 +00:00
Richard Frith-Macdonald
be173ab404 Fix resource leaks (failure to close) on error. 2021-02-03 16:23:43 +00:00
Frederik Seiffert
61709e6101 Support building on Windows with Clang MSVC target 2021-02-03 15:02:27 +01:00
Riccardo Mottola
ece6fc97ff Add check for statbuf.st_mtim if available and use statbuf.st_mtim to get nanosecond precision in modification date, also fix conversion of nanoseconds in creation date. 2021-02-02 23:30:18 +01:00
Richard Frith-Macdonald
625e8541a9 Call -cancel at the end of a synchronous load so that we stop our NSURLProtocol instance from retaining us as its client. 2021-01-26 14:38:29 +00:00
Richard Frith-Macdonald
747f47d83d Mark function call as requiring void return; hint to tell coverity that we do not want the return value from this function (there's nothing we could do with it and the function should never fail with the input we provide). 2021-01-25 12:25:49 +00:00
Richard Frith-Macdonald
4d0dc010ab Was checking incorrect variable to avoid assignment to nul pointer. 2021-01-21 14:27:21 +00:00
Richard Frith-Macdonald
72af51982f fix leak of set 2021-01-18 12:20:46 +00:00
Richard Frith-Macdonald
925023e8c0 Fix leak evaluating a cast 2021-01-18 11:56:44 +00:00
Richard Frith-Macdonald
d63b2e0035 Fix memory leaks 2021-01-18 11:52:37 +00:00
Richard Frith-Macdonald
fe7d9b6435 Use NSZoneMalloc and NSZoneRealloc for memory used by data, so it is in the correct zone for the instance (and to avoid complaints from static analyser). 2021-01-18 11:47:39 +00:00
Richard Frith-Macdonald
dca9b65313 Remove stream from handler upon deallocation, to avlid handler sending messages to deallocated stream. 2021-01-16 06:23:25 +00:00
Richard Frith-Macdonald
fa27dfeed4 Fix failure to re-set flag to say whether a string is unicode 2020-12-30 09:12:37 -05:00
Richard Frith-Macdonald
d664bd89e8 Fix potential problem with new optimisation for direct access to contents of 8bit strings ... when the decimal separator is not an ascii character we may need to convert the 8bit value to unicode. 2020-12-30 12:54:19 +00:00
Richard Frith-Macdonald
3dc437524e Use new private method to scan double values. 2020-12-30 12:25:18 +00:00
Richard Frith-Macdonald
657e49edeb Remove internal GSScanInt and GSScanDouble functions after moving functionality into the -scanDouble: method. Add private class method to support scanning a string for a double without having to create a new scanner each time (use a shared lock-protected, instance with resetting of the string being scanned). 2020-12-30 11:58:19 +00:00
Richard Frith-Macdonald
168dd211e3 remove unused header import 2020-12-30 11:55:44 +00:00
Richard Frith-Macdonald
95c10d7fa7 Use superclass implementation of -doubleValue and -floatValue 2020-12-30 11:54:57 +00:00
Richard Frith-Macdonald
81021528e1 Change -scanDouble: to call GSScanDouble() to perform conversion. Fix GSScanDouble to cope with leading zeros. 2020-12-29 11:54:34 +00:00
Richard Frith-Macdonald
6d20773f56 Consistently use __typeof__() rather than typeof() or __typeof() for compatibility (GCC and clang and, perhaps, other future compilers) irrespective of -std= compilation options. 2020-12-15 13:01:00 +00:00
Richard Frith-Macdonald
bcbdeb64a8 Fix initialisation of NSUUID from string (permit mixed case hex digits) 2020-12-15 10:40:55 +00:00
Richard Frith-Macdonald
c1d98567a8 fixup incorrect commit 2020-12-11 12:19:52 +00:00
Richard Frith-Macdonald
31fbd3f9c7 Improve diagnostic logging 2020-12-11 12:12:59 +00:00
Richard Frith-Macdonald
afde524e82 Fix unused variable on windows 2020-12-09 16:37:22 +00:00
Richard Frith-Macdonald
c2fea0a825 Add fake interface for NSUserDefaultsWin32 to avoid compiler warning 2020-12-09 15:17:46 +00:00
Richard Frith-Macdonald
02b69ca57e Only declare variables for systems which use them. 2020-12-09 15:12:11 +00:00
Richard Frith-Macdonald
db4c3c1006 Fix typo in comment (incorrect RFC number) 2020-12-07 11:46:09 -05:00
Richard Frith-Macdonald
b8f1fc4129 Avoid compiler warnings when we do not have real blocks 2020-12-07 07:47:15 -05:00
Richard Frith-Macdonald
dfba8adba7 Fixup to import local headers rather than installed versions 2020-12-07 07:34:44 -05:00
Richard Frith-Macdonald
ea9aa71eeb Avoid compiler warnings on system with pseudo-blocks 2020-12-07 07:23:30 -05:00
Richard Frith-Macdonald
10a8e9faf8 fix format string error in -description 2020-12-07 11:21:16 +00:00
Richard Frith-Macdonald
3bf1fc5490 Improve diagnostic output 2020-12-07 11:18:51 +00:00
Richard Frith-Macdonald
d7e5158a09 An error in a socketpair only applies to the other socket if still opening 2020-12-06 09:38:17 -05:00
Richard Frith-Macdonald
71e636cf49 Use uinsigned logn for fast enumeration version counter 2020-12-04 11:16:13 -05:00
Richard Frith-Macdonald
e111315f87 fix typo 2020-12-04 11:09:33 -05:00
Richard Frith-Macdonald
09e527c0fd Fix to make value pointed to by mutationsPtr be unsigned long. 2020-12-04 11:08:16 -05:00
Richard Frith-Macdonald
897e5fc7dd Fix range check for decoded 32bit integer 2020-12-04 06:04:22 -05:00
Richard Frith-Macdonald
60038cbf38 Merge branch 'master' of ssh://github.com/gnustep/libs-base into master 2020-12-04 04:44:02 -05:00
Richard Frith-Macdonald
02d1cbd34d Suppress warnings about use of 'private' functions from libdispatch 2020-12-04 04:43:28 -05:00
Richard Frith-Macdonald
190bafad72 declare external block as const void rather than void for consistency and to avoid compiler warning 2020-12-04 04:36:42 -05:00
Richard Frith-Macdonald
aeca9c8698 Suppress dll import warnings for objc_enumerationMutation() on mingw 2020-12-04 04:25:39 -05:00
Richard Frith-Macdonald
468b62bdde use memcpy rather than strncpy to avoid compiler warnings 2020-12-03 12:54:41 -05:00
Richard Frith-Macdonald
facfbad126 avoid compiler warning 2020-12-03 12:48:22 -05:00
Richard Frith-Macdonald
8141fe03f7 use memcpy rather than strncpy to avoid compiler warning 2020-12-03 12:29:53 -05:00
Richard Frith-Macdonald
679272b50c Use memcpy rather than strncpy/strncat to avoid compiler warnings 2020-12-03 12:07:33 -05:00
Richard Frith-Macdonald
379f5f0040 use memcpy rather than strncpy to avoid compiler warnings 2020-12-03 11:59:37 -05:00
Richard Frith-Macdonald
f18594ff3e tweaks to avoid compiler warnings 2020-12-03 11:56:14 -05:00
Richard Frith-Macdonald
1b7bf26bea Merge changes for NSURLSession from EngageHub (formerly Brainstorm). 2020-11-29 06:57:47 -05:00
Richard Frith-Macdonald
0dbd863dde Add optimisation for the use of GSImmutableString so that it can make use of the layout of the underlying mutable string that the GSImmutableString is a proxy for. 2020-11-22 09:55:39 -05:00
Richard Frith-Macdonald
7fcd11d6c9 Rewrite -replaceCharactersInRange:withString: to cope with the case where the string argument is the receiver (or some proxy to the receiver etc). 2020-11-22 08:08:34 -05:00
Richard Frith-Macdonald
3bb72398ee Report YES for GSImmutableString being a proxy 2020-11-22 08:08:00 -05:00
Richard Frith-Macdonald
5ec87d80b4 Fix for text storage objects setting their content to their own immutable proxy 2020-11-21 08:23:53 +00:00
Richard Frith-Macdonald
1170e0c0c1 add casts to avoid compiler warnings 2020-11-20 01:42:33 -05:00
Richard Frith-Macdonald
aa0beb0758 Minor tidyup for clearer indentation 2020-11-19 08:33:20 -05:00
Richard Frith-Macdonald
8178e52806 Correct checks for validity of the second UTF16 value in a surrogate pair 2020-11-19 08:27:06 -05:00
rfm
d27dcfbed6
Merge pull request #164 from triplef/add-nsfilehandle-url-methods
Add NSFileHandle URL initializers.
2020-11-18 09:21:13 +00:00
Richard Frith-Macdonald
e7035cadf3 Be defensive about checking for key beginning with @ 2020-11-18 09:09:48 +00:00
Frederik Seiffert
88a2e0809f Add NSFileHandle URL initializers.
Also use "instancetype" for all initializers.
2020-11-17 19:48:05 +01:00
Richard Frith-Macdonald
d4df4b6d87 Add methods to control size of in-memory queue os emails 2020-11-14 04:25:34 +00:00
Richard Frith-Macdonald
23d431234c Fix bug in offset 2020-11-13 05:41:42 +00:00
Richard Frith-Macdonald
a34beadb8e Merge branch 'gnustep_testplant_mergeback' of https://github.com/TestPlant/libs-base into TestPlant-gnustep_testplant_mergeback
Conflicts:
	ChangeLog
2020-11-13 05:39:15 +00:00
Frederik Seiffert
06fa7792a5 Fix compilation with ICU 68. 2020-11-12 17:18:09 +01:00
Richard Frith-Macdonald
ae90743153 Avoid building unused functions when new string API is used. 2020-11-11 22:23:13 +00:00
rfm
17af685b1a
Merge branch 'master' into nsurl-additions 2020-11-06 09:36:42 +00:00
rfm
8ccd6e2675
Merge pull request #102 from Artoria2e5/pluti
Add plutil utility
2020-11-06 09:12:33 +00:00
Richard Frith-Macdonald
efabfab3d0 Merge branch 'master' of ssh://github.com/gnustep/libs-base 2020-10-29 09:05:51 +00:00
Richard Frith-Macdonald
2b840550f0 Improve logging of an exception when posting a notification so that, if possible, we include the details of the notification being posted. 2020-10-29 09:04:51 +00:00
Gregory John Casamento
2ba26ce34a fix for compilation error 2020-10-27 09:44:21 -04:00
Gregory Casamento
e5a7733f04
Merge pull request #161 from gnustep/nsurlconnection_10_5_methods
Add methods from 10.5
2020-10-27 08:14:22 -04:00
Gregory John Casamento
85f590f88e Add methods for 10.5 2020-10-26 23:53:11 -04:00
Richard Frith-Macdonald
feac65a23f Fix use of potentially invalid value from heap 2020-10-24 17:54:55 +01:00
Adam Fox
0b69d88ee2 Implementation of [NSData rangeOfData:options:range], adapted from [NSString rangeOfString:options:range]. 2020-10-12 12:22:00 -06:00
Richard Frith-Macdonald
ba5b950fa5 fix retain/release error 2020-10-11 11:24:49 +01:00
Richard Frith-Macdonald
57efbdb09e improve comments 2020-10-03 15:18:21 +01:00
Richard Frith-Macdonald
21839365a9 Remove unnecessary retain/release 2020-09-30 10:08:36 +01:00
Richard Frith-Macdonald
98dfa140ec added autorelease pool around each operation to catch any autoreleased
objects produced by the operation being executed. This should prevent
objects living until the end of the thread.
2020-09-30 09:56:24 +01:00
Richard Frith-Macdonald
6ae48bd3d3 Tidied code 2020-09-30 09:55:43 +01:00
Richard Frith-Macdonald
7977bcb19d Tidied some whitespace/indentation and removed obsolete comment 2020-09-21 11:41:39 +01:00
Riccardo Mottola
18dfe7b8f6 Windows linker doesn't really support WEAK symbols, not even with gcc10. binutils 2.3.5 fails to link because not all symbols were exported 2020-09-17 23:46:37 +02:00
Richard Frith-Macdonald
938f280b87 Implement fast enumeration for insensitive dictionary 2020-09-08 15:14:19 +01:00
fredkiefer
7dc4a8f532 Add missing break 2020-09-05 22:34:48 +02:00