expose gnustep specific methods for old code

This commit is contained in:
Richard Frith-Macdonald 2018-12-05 10:43:59 +00:00
parent e01b592c51
commit 458b8a1e79
4 changed files with 54 additions and 6 deletions

View file

@ -1,4 +1,12 @@
2018-11-04 Richard Frith-Macdonald <rfm@gnu.org>
2018-12-05 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundartion/NSURLHandle.h:
* Source/NSURLHandle.m:
* Source/GSHTTPURLHandle.m:
Expose GNUstep specific methods for old code that depends on them.
Newere code should use the newer HTTP/HTTPS APIs
2018-12-04 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/GNUstepBase/NSURL+GNUstepBase.h:
* Source/NSURL.m:

View file

@ -211,12 +211,30 @@ typedef NSUInteger NSURLHandleStatus;
- (id) propertyForKeyIfAvailable: (NSString*)propertyKey;
- (void) removeClient: (id <NSURLHandleClient>)client;
- (NSData*) resourceData;
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
/** GNUstep extension to turn on debug logging for a handle. Returns the
* previous debug setting for the handle. Implemented for http/https only.
*/
- (int) setDebug: (int)flag;
/** GNUstep extension to turn on returning of complete http/https response
* even when the status code is not in the 200 to 299 success range.
*/
- (void) setReturnAll: (BOOL)flag;
/** GNUstep extension to change the URL that the handle sends requests to.
* Implemented for http/https only.
*/
- (void) setURL: (NSURL*)newUrl;
#endif
- (NSURLHandleStatus) status;
- (BOOL) writeData: (NSData*)data;
- (BOOL) writeProperty: (id)propertyValue
forKey: (NSString*)propertyKey;
@end
#if defined(__cplusplus)

View file

@ -134,9 +134,6 @@ static NSString *httpVersion = @"1.1";
NSString *out;
}
+ (void) setMaxCached: (NSUInteger)limit;
- (int) setDebug: (int)flag;
- (void) setReturnAll: (BOOL)flag;
- (void) setURL: (NSURL*)newUrl;
- (void) _tryLoadInBackground: (NSURL*)fromURL;
@end

View file

@ -561,7 +561,17 @@ static Class NSURLHandleClass = 0;
*/
- (int) setDebug: (int)aFlag
{
return NO;
return 0;
}
- (void) setReturnAll: (BOOL)flag
{
return;
}
- (void) setURL: (NSURL*)newUrl
{
return;
}
/**
@ -819,6 +829,21 @@ static NSLock *fileLock = nil;
return [_attributes objectForKey: propertyKey];
}
- (int) setDebug: (int)flag
{
return 0;
}
- (void) setReturnAll: (BOOL)flag
{
return;
}
- (void) setURL: (NSURL*)newUrl
{
return;
}
/**
* Writes the specified data as the contents of the file
* represented by the handle.