Toggle navigation
Toggle navigation
This project
Loading...
Sign in
iOS
/
asi-http-request
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Ben Copsey
2010-01-29 16:09:16 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
74ff7671a38dfb39e7c9a83bdbe38ec6b4db5c15
74ff7671
1 parent
8374c40d
Print more information when using DEBUG_REQUEST_STATUS
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
Classes/ASIHTTPRequest.m
Classes/ASIHTTPRequestConfig.h
Classes/ASIHTTPRequest.m
View file @
74ff767
...
...
@@ -21,7 +21,7 @@
#import "ASIInputStream.h"
// Automatically set on build
NSString
*
ASIHTTPRequestVersion
=
@"v1.5-3
6
2010-01-29"
;
NSString
*
ASIHTTPRequestVersion
=
@"v1.5-3
7
2010-01-29"
;
NSString
*
const
NetworkRequestErrorDomain
=
@"ASIHTTPRequestErrorDomain"
;
...
...
@@ -1005,8 +1005,6 @@ static BOOL isiPhoneOS2;
return
;
}
[[
self
cancelledLock
]
unlock
];
if
(
shouldResetProgressIndicators
)
{
...
...
@@ -1147,8 +1145,15 @@ static BOOL isiPhoneOS2;
// Find out how much data we've uploaded so far
[
self
setTotalBytesSent
:[[(
NSNumber
*
)
CFReadStreamCopyProperty
((
CFReadStreamRef
)[
self
readStream
],
kCFStreamPropertyHTTPRequestBytesWrittenCount
)
autorelease
]
unsignedLongLongValue
]];
[
ASIHTTPRequest
incrementBandwidthUsedInLastSecond
:(
unsigned
long
)(
totalBytesSent
-
lastBytesSent
)];
if
(
totalBytesSent
>
lastBytesSent
)
{
[
ASIHTTPRequest
incrementBandwidthUsedInLastSecond
:(
unsigned
long
)(
totalBytesSent
-
lastBytesSent
)];
#if DEBUG_REQUEST_STATUS
if
([
self
totalBytesSent
]
==
[
self
postLength
])
{
NSLog
(
@"Request %@ finished uploading data"
,
self
);
}
#endif
}
}
[
self
updateProgressIndicators
];
...
...
@@ -1608,7 +1613,13 @@ static BOOL isiPhoneOS2;
return
;
}
if
(
CFHTTPMessageIsHeaderComplete
(
headers
))
{
#if DEBUG_REQUEST_STATUS
if
([
self
totalBytesSent
]
==
[
self
postLength
])
{
NSLog
(
@"Request %@ received response headers"
,
self
);
}
#endif
CFDictionaryRef
headerFields
=
CFHTTPMessageCopyAllHeaderFields
(
headers
);
[
self
setResponseHeaders
:(
NSDictionary
*
)
headerFields
];
...
...
@@ -2473,6 +2484,10 @@ static BOOL isiPhoneOS2;
-
(
void
)
handleStreamComplete
{
#if DEBUG_REQUEST_STATUS
NSLog
(
@"Request %@ finished downloading data"
,
self
);
#endif
if
(
!
[
self
responseHeaders
])
{
[
self
readResponseHeaders
];
}
...
...
Classes/ASIHTTPRequestConfig.h
View file @
74ff767
...
...
@@ -13,7 +13,7 @@
// When set to 1 ASIHTTPRequests will print information about what a request is doing
#ifndef DEBUG_REQUEST_STATUS
#define DEBUG_REQUEST_STATUS
0
#define DEBUG_REQUEST_STATUS
1
#endif
// When set to 1, ASIFormDataRequests will print information about the request body to the console
...
...
Please
register
or
login
to post a comment