[CURLHandle-cvs] CURLHandleSource CURLHandle+extras.m,1.1.1.1,1.2 CURLHandle.m,1.1.1.1,1.2
Brought to you by:
dan_wood
|
From: <dan...@us...> - 2003-07-01 21:49:14
|
Update of /cvsroot/curlhandle/CURLHandleSource
In directory sc8-pr-cvs1:/tmp/cvs-serv4661
Modified Files:
CURLHandle+extras.m CURLHandle.m
Log Message:
1.8
Index: CURLHandle+extras.m
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleSource/CURLHandle+extras.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CURLHandle+extras.m 13 Mar 2003 05:39:58 -0000 1.1.1.1
--- CURLHandle+extras.m 1 Jul 2003 21:15:00 -0000 1.2
***************
*** 463,465 ****
--- 463,486 ----
}
+ /*" Sets the accepted encodings. If encodings is a non-zero length string, then it is used as the
+ value for the Accept-encoding header. If it is a zero length string, then all supported
+ encodings are used (gzip, deflate at the time of writing). If it is nil, then the Accept-encoding
+ header is cleared. gzip got support in version 7.10.5 or later of the curl library.
+ "*/
+ - (void)setAcceptEncoding:(NSString *)encodings
+ {
+ [self setString:encodings forKey:CURLOPT_ENCODING];
+ }
+
+ /*" Sets CURL to accept all supported encodings transparently.
+ "*/
+ - (void)setAcceptCompression:(BOOL)yorn
+ {
+ if( yorn )
+ [self setAcceptEncoding:@""];
+ else
+ [self setAcceptEncoding:nil];
+ }
+
+
@end
Index: CURLHandle.m
===================================================================
RCS file: /cvsroot/curlhandle/CURLHandleSource/CURLHandle.m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** CURLHandle.m 13 Mar 2003 05:39:58 -0000 1.1.1.1
--- CURLHandle.m 1 Jul 2003 21:15:00 -0000 1.2
***************
*** 273,277 ****
[mPort setDelegate:nil];
// And remove the port from the runloop
! [[NSRunLoop currentRunLoop] removePort:mPort forMode:NSDefaultRunLoopMode];
[mPort release];
--- 273,277 ----
[mPort setDelegate:nil];
// And remove the port from the runloop
! [[NSRunLoop currentRunLoop] removePort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
[mPort release];
***************
*** 351,355 ****
#if 1
#warning # this may be leaking ... there are two retains going on here. Apple bug report #2885852
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:NSDefaultRunLoopMode];
#else
#warning # This attempt to compensate for the leak causes crashes....
--- 351,355 ----
#if 1
#warning # this may be leaking ... there are two retains going on here. Apple bug report #2885852
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
#else
#warning # This attempt to compensate for the leak causes crashes....
***************
*** 357,361 ****
int oldCount = [mPort retainCount];
int newCount;
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:NSDefaultRunLoopMode];
newCount = [mPort retainCount];
--- 357,361 ----
int oldCount = [mPort retainCount];
int newCount;
! [[NSRunLoop currentRunLoop] addPort:mPort forMode:(NSString *)kCFRunLoopCommonModes];
newCount = [mPort retainCount];
***************
*** 645,648 ****
--- 645,649 ----
}
}
+ [proxies release];
}
***************
*** 863,873 ****
while ((key = [e nextObject]))
{
NSString *escapedKey
= (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) key, NULL, NULL, cfStrEnc);
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [[self objectForKey:key] description], NULL, NULL, cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
}
// Delete final & from the string
--- 864,892 ----
while ((key = [e nextObject]))
{
+ id keyObject = [self objectForKey: key];
+ // conform with rfc 1738 3.3, also escape URL-like characters that might be in the parameters
NSString *escapedKey
= (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) key, NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! if ([keyObject respondsToSelector: @selector(objectEnumerator)])
! {
! NSEnumerator *multipleValueEnum = [keyObject objectEnumerator];
! id aValue;
!
! while ((aValue = [multipleValueEnum nextObject]))
! {
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [aValue description], NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
! }
! }
! else
! {
! NSString *escapedObject
! = (NSString *) CFURLCreateStringByAddingPercentEscapes(
! NULL, (CFStringRef) [keyObject description], NULL, (CFStringRef) @";:@&=/", cfStrEnc);
! [s appendFormat:@"%@=%@&", escapedKey, escapedObject];
! }
}
// Delete final & from the string
|