Skip to content

Commit c998a18

Browse files
committed
Merge branch 'master' of github.com:AFNetworking/AFNetworking
2 parents 71ebcff + d6b97d4 commit c998a18

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

AFNetworking/AFJSONUtilities.m

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848

4949
NSUInteger serializeOptionFlags = 0;
5050
[invocation setArgument:&serializeOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
51-
[invocation setArgument:error atIndex:3];
51+
if (error != NULL) {
52+
[invocation setArgument:error atIndex:3];
53+
}
5254

5355
[invocation invoke];
5456
[invocation getReturnValue:&data];
@@ -99,7 +101,9 @@
99101
[invocation setArgument:&object atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
100102
NSUInteger writeOptions = 0;
101103
[invocation setArgument:&writeOptions atIndex:3];
102-
[invocation setArgument:error atIndex:4];
104+
if (error != NULL) {
105+
[invocation setArgument:error atIndex:4];
106+
}
103107

104108
[invocation invoke];
105109
[invocation getReturnValue:&data];
@@ -138,7 +142,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
138142

139143
NSUInteger parseOptionFlags = 0;
140144
[invocation setArgument:&parseOptionFlags atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
141-
[invocation setArgument:error atIndex:3];
145+
if (error != NULL) {
146+
[invocation setArgument:error atIndex:3];
147+
}
142148

143149
[invocation invoke];
144150
[invocation getReturnValue:&JSON];
@@ -158,7 +164,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
158164

159165
NSUInteger yajlParserOptions = 0;
160166
[invocation setArgument:&yajlParserOptions atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
161-
[invocation setArgument:error atIndex:3];
167+
if (error != NULL) {
168+
[invocation setArgument:error atIndex:3];
169+
}
162170

163171
[invocation invoke];
164172
[invocation getReturnValue:&JSON];
@@ -169,7 +177,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
169177
invocation.selector = _NXJsonParserSelector;
170178

171179
[invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
172-
[invocation setArgument:error atIndex:3];
180+
if (error != NULL) {
181+
[invocation setArgument:error atIndex:3];
182+
}
173183
[invocation setArgument:&nullOption atIndex:4];
174184

175185
[invocation invoke];
@@ -185,7 +195,9 @@ id AFJSONDecode(NSData *data, NSError **error) {
185195
[invocation setArgument:&data atIndex:2]; // arguments 0 and 1 are self and _cmd respectively, automatically set by NSInvocation
186196
NSUInteger readOptions = 0;
187197
[invocation setArgument:&readOptions atIndex:3];
188-
[invocation setArgument:error atIndex:4];
198+
if (error != NULL) {
199+
[invocation setArgument:error atIndex:4];
200+
}
189201

190202
[invocation invoke];
191203
[invocation getReturnValue:&JSON];

AFNetworking/AFURLConnectionOperation.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,18 +174,18 @@ extern NSString * const AFNetworkingOperationDidFinishNotification;
174174
///---------------------------------
175175

176176
/**
177-
Sets a callback to be called when an undetermined number of bytes have been downloaded from the server.
177+
Sets a callback to be called when an undetermined number of bytes have been uploaded to the server.
178178
179-
@param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times.
179+
@param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes three arguments: the number of bytes written since the last time the upload progress block was called, the total bytes written, and the total bytes expected to be written during the request, as initially determined by the length of the HTTP body. This block may be called multiple times.
180180
181181
@see setDownloadProgressBlock
182182
*/
183183
- (void)setUploadProgressBlock:(void (^)(NSInteger bytesWritten, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite))block;
184184

185185
/**
186-
Sets a callback to be called when an undetermined number of bytes have been uploaded to the server.
186+
Sets a callback to be called when an undetermined number of bytes have been downloaded from the server.
187187
188-
@param block A block object to be called when an undetermined number of bytes have been uploaded to the server. This block has no return value and takes three arguments: the number of bytes read since the last time the upload progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times.
188+
@param block A block object to be called when an undetermined number of bytes have been downloaded from the server. This block has no return value and takes three arguments: the number of bytes read since the last time the download progress block was called, the total bytes read, and the total bytes expected to be read during the request, as initially determined by the expected content size of the `NSHTTPURLResponse` object. This block may be called multiple times.
189189
190190
@see setUploadProgressBlock
191191
*/

0 commit comments

Comments
 (0)