10
10
This library is free software; you can redistribute it and/or
11
11
modify it under the terms of the GNU Lesser General Public
12
12
License as published by the Free Software Foundation; either
13
version 3 of the License, or (at your option) any later version.
13
version 2 of the License, or (at your option) any later version.
15
15
This library is distributed in the hope that it will be useful,
16
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
23
23
Boston, MA 02111 USA.
27
#include "Foundation/NSArray.h"
28
#include "Foundation/NSByteOrder.h"
29
#include "Foundation/NSData.h"
30
#include "Foundation/NSDebug.h"
31
#include "Foundation/NSException.h"
32
#include "Foundation/NSFileHandle.h"
33
#include "Foundation/NSHost.h"
34
#include "Foundation/NSLock.h"
35
#include "Foundation/NSMapTable.h"
36
#include "Foundation/NSNotification.h"
37
#include "Foundation/NSPathUtilities.h"
38
#include "Foundation/NSProcessInfo.h"
39
#include "Foundation/NSRunLoop.h"
40
#include "Foundation/NSString.h"
41
#include "Foundation/NSURL.h"
42
#include "Foundation/NSURLHandle.h"
43
#include "Foundation/NSValue.h"
44
#include "GNUstepBase/GSMime.h"
45
#include "GNUstepBase/GSLock.h"
46
#include "NSCallBacks.h"
47
#include "GSURLPrivate.h"
48
#include "GSPrivate.h"
27
#import "Foundation/NSArray.h"
28
#import "Foundation/NSDictionary.h"
29
#import "Foundation/NSEnumerator.h"
30
#import "Foundation/NSByteOrder.h"
31
#import "Foundation/NSData.h"
32
#import "Foundation/NSDebug.h"
33
#import "Foundation/NSException.h"
34
#import "Foundation/NSFileHandle.h"
35
#import "Foundation/NSHost.h"
36
#import "Foundation/NSLock.h"
37
#import "Foundation/NSMapTable.h"
38
#import "Foundation/NSNotification.h"
39
#import "Foundation/NSPathUtilities.h"
40
#import "Foundation/NSProcessInfo.h"
41
#import "Foundation/NSRunLoop.h"
42
#import "Foundation/NSString.h"
43
#import "Foundation/NSURL.h"
44
#import "Foundation/NSURLHandle.h"
45
#import "Foundation/NSValue.h"
46
#import "GNUstepBase/GSMime.h"
47
#import "GNUstepBase/GSLock.h"
48
#import "NSCallBacks.h"
49
#import "GSURLPrivate.h"
50
52
#include <string.h>
51
53
#ifdef HAVE_UNISTD_H
68
70
* captialisation of headers (some http software is faulty like that).
70
72
static unsigned int
71
_non_retained_id_hash(void *table, NSString* o)
73
_id_hash(void *table, NSString* o)
73
75
return [[o uppercaseString] hash];
77
_non_retained_id_is_equal(void *table, NSString *o, NSString *p)
79
_id_is_equal(void *table, NSString *o, NSString *p)
79
81
return ([o caseInsensitiveCompare: p] == NSOrderedSame) ? YES : NO;
88
90
static const NSMapTableKeyCallBacks writeKeyCallBacks =
90
(NSMT_hash_func_t) _non_retained_id_hash,
91
(NSMT_is_equal_func_t) _non_retained_id_is_equal,
92
(NSMT_retain_func_t) _NS_non_retained_id_retain,
93
(NSMT_release_func_t) _NS_non_retained_id_release,
94
(NSMT_describe_func_t) _NS_non_retained_id_describe,
92
(NSMT_hash_func_t) _id_hash,
93
(NSMT_is_equal_func_t) _id_is_equal,
94
(NSMT_retain_func_t) _NS_id_retain,
95
(NSMT_release_func_t) _NS_id_release,
96
(NSMT_describe_func_t) _NS_id_describe,
95
97
NSNotAPointerMapKey
383
385
+ (BOOL) canInitWithURL: (NSURL*)newUrl
385
if ([[newUrl scheme] isEqualToString: @"http"]
386
|| [[newUrl scheme] isEqualToString: @"https"])
387
NSString *scheme = [newUrl scheme];
389
if ([scheme isEqualToString: @"http"]
390
|| [scheme isEqualToString: @"https"])
981
985
if ([[u scheme] isEqualToString: @"https"])
984
* If we are an https connection, negotiate secure connection
987
/* If we are an https connection, negotiate secure connection.
988
* Make sure we are not an observer of the file handle while
989
* it is connecting...
991
[nc removeObserver: self name: nil object: sock];
986
992
if ([sock sslConnect] == NO)
988
994
[self endLoadInBackground];