Update to match Google sources

git-svn-id: http://gtm-http-fetcher.googlecode.com/svn/trunk@143 b3aa69f0-f65c-a609-0a27-78855af037c1
diff --git a/Source/GTMHTTPFetcher.h b/Source/GTMHTTPFetcher.h
index ee1c447..81aa613 100755
--- a/Source/GTMHTTPFetcher.h
+++ b/Source/GTMHTTPFetcher.h
@@ -260,7 +260,9 @@
 #endif
 
 #if TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 40000)
-  #define GTM_BACKGROUND_FETCHING 1
+  #ifndef GTM_BACKGROUND_FETCHING
+    #define GTM_BACKGROUND_FETCHING 1
+  #endif
 #endif
 
 #ifndef GTM_ALLOW_INSECURE_REQUESTS
@@ -847,6 +849,7 @@
 // if logging is stripped, provide a stub for the main method
 // for controlling logging
 + (void)setLoggingEnabled:(BOOL)flag;
++ (BOOL)isLoggingEnabled;
 #endif // STRIP_GTM_FETCH_LOGGING
 
 @end
diff --git a/Source/GTMHTTPFetcher.m b/Source/GTMHTTPFetcher.m
index 99e1892..bdba5b7 100755
--- a/Source/GTMHTTPFetcher.m
+++ b/Source/GTMHTTPFetcher.m
@@ -1939,6 +1939,10 @@
 #if STRIP_GTM_FETCH_LOGGING
 + (void)setLoggingEnabled:(BOOL)flag {
 }
+
++ (BOOL)isLoggingEnabled {
+  return NO;
+}
 #endif // STRIP_GTM_FETCH_LOGGING
 
 @end
diff --git a/Source/GTMHTTPFetcher.xcodeproj/project.pbxproj b/Source/GTMHTTPFetcher.xcodeproj/project.pbxproj
index e78c9d4..66e6a70 100644
--- a/Source/GTMHTTPFetcher.xcodeproj/project.pbxproj
+++ b/Source/GTMHTTPFetcher.xcodeproj/project.pbxproj
@@ -309,10 +309,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				"ARCHS[sdk=iphoneos*]" = (
-					armv6,
-					armv7,
-				);
+				"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
 				COPY_PHASE_STRIP = NO;
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_OPTIMIZATION_LEVEL = 0;
@@ -327,10 +324,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				"ARCHS[sdk=iphoneos*]" = (
-					armv6,
-					armv7,
-				);
+				"ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
 				GCC_MODEL_TUNING = G5;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				INSTALL_PATH = /usr/local/lib;
@@ -350,7 +344,7 @@
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				ONLY_ACTIVE_ARCH = YES;
+				ONLY_ACTIVE_ARCH = NO;
 				OTHER_CFLAGS = "-DDEBUG=1";
 				OTHER_LDFLAGS = "-ObjC";
 				SDKROOT = macosx;
diff --git a/Source/GTMHTTPFetcherLogging.m b/Source/GTMHTTPFetcherLogging.m
index b4ca24e..20827ad 100644
--- a/Source/GTMHTTPFetcherLogging.m
+++ b/Source/GTMHTTPFetcherLogging.m
@@ -34,7 +34,7 @@
 // do not need to import the header, as some projects may not have it available
 #ifndef GTM_NSSTREAM_DELEGATE
 @interface GTMReadMonitorInputStream : NSInputStream
-+ (id)inputStreamWithStream:(NSInputStream *)input;
++ (instancetype)inputStreamWithStream:(NSInputStream *)input;
 @property (assign) id readDelegate;
 @property (assign) SEL readSelector;
 @property (retain) NSArray *runLoopModes;
@@ -417,7 +417,7 @@
   // and turn that munged buffer an NSString.  That gives us a string
   // we can use with NSScanner.
   NSMutableData *mutableData = [NSMutableData dataWithData:data];
-  unsigned char *bytes = [mutableData mutableBytes];
+  unsigned char *bytes = (unsigned char *)[mutableData mutableBytes];
 
   for (unsigned int idx = 0; idx < [mutableData length]; idx++) {
     if (bytes[idx] > 0x7F || bytes[idx] == 0) {
diff --git a/Source/GTMHTTPUploadFetcher.h b/Source/GTMHTTPUploadFetcher.h
index b0ce3b6..37845b6 100755
--- a/Source/GTMHTTPUploadFetcher.h
+++ b/Source/GTMHTTPUploadFetcher.h
@@ -25,7 +25,7 @@
 // needed for chunked upload as a single fetch operation.
 //
 // Protocol document:
-//   http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal
+//   https://developers.google.com/gdata/docs/resumable_upload
 //
 // To the client, the only fetcher that exists is this class; the subsidiary
 // fetchers needed for uploading chunks are not visible (though the most recent
diff --git a/Source/GTMHTTPUploadFetcher.m b/Source/GTMHTTPUploadFetcher.m
index a7cea24..83cfed8 100755
--- a/Source/GTMHTTPUploadFetcher.m
+++ b/Source/GTMHTTPUploadFetcher.m
@@ -722,10 +722,6 @@
   // we no longer need to be able to cancel this chunkFetcher
   [self destroyChunkFetcher];
 
-  // We may in the future handle Retry-After and ETag headers per
-  // http://code.google.com/p/gears/wiki/ResumableHttpRequestsProposal
-  // but they are not currently sent by the upload server
-
   [self uploadNextChunkWithOffset:newOffset
                 fetcherProperties:props];
 }
diff --git a/Source/GTMReadMonitorInputStream.h b/Source/GTMReadMonitorInputStream.h
index 9e4b3f7..9a117a5 100644
--- a/Source/GTMReadMonitorInputStream.h
+++ b/Source/GTMReadMonitorInputStream.h
@@ -45,9 +45,9 @@
 
 // length is passed to the progress callback; it may be zero
 // if the progress callback can handle that
-+ (id)inputStreamWithStream:(NSInputStream *)input;
++ (instancetype)inputStreamWithStream:(NSInputStream *)input;
 
-- (id)initWithStream:(NSInputStream *)input;
+- (instancetype)initWithStream:(NSInputStream *)input;
 
 // The read monitor selector is called when bytes have been read. It should
 // have a signature matching
diff --git a/Source/GTMReadMonitorInputStream.m b/Source/GTMReadMonitorInputStream.m
index 4a85de5..a6f0de6 100644
--- a/Source/GTMReadMonitorInputStream.m
+++ b/Source/GTMReadMonitorInputStream.m
@@ -52,11 +52,11 @@
 
 #pragma mark -
 
-+ (id)inputStreamWithStream:(NSInputStream *)input {
++ (instancetype)inputStreamWithStream:(NSInputStream *)input {
   return [[[self alloc] initWithStream:input] autorelease];
 }
 
-- (id)initWithStream:(NSInputStream *)input  {
+- (instancetype)initWithStream:(NSInputStream *)input  {
   self = [super init];
   if (self) {
     inputStream_ = [input retain];
@@ -65,7 +65,7 @@
   return self;
 }
 
-- (id)init {
+- (instancetype)init {
   return [self initWithStream:nil];
 }
 
diff --git a/Source/Tests/GTMHTTPServer.h b/Source/Tests/GTMHTTPServer.h
index f865a43..ae88df5 100644
--- a/Source/Tests/GTMHTTPServer.h
+++ b/Source/Tests/GTMHTTPServer.h
@@ -132,12 +132,12 @@
  @private
   CFHTTPMessageRef message_;
 }
-+ (id)responseWithString:(NSString *)plainText;
-+ (id)responseWithHTMLString:(NSString *)htmlString;
-+ (id)responseWithBody:(NSData *)body
-           contentType:(NSString *)contentType
-            statusCode:(int)statusCode;
-+ (id)emptyResponseWithCode:(int)statusCode;
++ (instancetype)responseWithString:(NSString *)plainText;
++ (instancetype)responseWithHTMLString:(NSString *)htmlString;
++ (instancetype)responseWithBody:(NSData *)body
+                     contentType:(NSString *)contentType
+                      statusCode:(int)statusCode;
++ (instancetype)emptyResponseWithCode:(int)statusCode;
 // TODO: class method for redirections?
 // TODO: add helper for expire/no-cache
 - (void)setValue:(NSString*)value forHeaderField:(NSString*)headerField;
diff --git a/Source/Tests/GTMHTTPServer.m b/Source/Tests/GTMHTTPServer.m
index 293b5c9..5e30661 100644
--- a/Source/Tests/GTMHTTPServer.m
+++ b/Source/Tests/GTMHTTPServer.m
@@ -540,20 +540,20 @@
   [super dealloc];
 }
 
-+ (id)responseWithString:(NSString *)plainText {
++ (instancetype)responseWithString:(NSString *)plainText {
   NSData *body = [plainText dataUsingEncoding:NSUTF8StringEncoding];
   return [self responseWithBody:body
                     contentType:@"text/plain; charset=UTF-8"
                      statusCode:200];
 }
 
-+ (id)responseWithHTMLString:(NSString *)htmlString {
++ (instancetype)responseWithHTMLString:(NSString *)htmlString {
   return [self responseWithBody:[htmlString dataUsingEncoding:NSUTF8StringEncoding]
                     contentType:@"text/html; charset=UTF-8"
                      statusCode:200];
 }
 
-+ (id)responseWithBody:(NSData *)body
++ (instancetype)responseWithBody:(NSData *)body
            contentType:(NSString *)contentType
             statusCode:(int)statusCode {
   return [[[[self class] alloc] initWithBody:body
@@ -561,7 +561,7 @@
                                   statusCode:statusCode] autorelease];
 }
 
-+ (id)emptyResponseWithCode:(int)statusCode {
++ (instancetype)emptyResponseWithCode:(int)statusCode {
   return [[[[self class] alloc] initWithBody:nil
                                  contentType:nil
                                   statusCode:statusCode] autorelease];