ObjFW  Check-in [53213f1d41]

Overview
Comment:Rename -[result] to -[perform] in OFHTTPRequest.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 53213f1d41174639a1ba9c21780edb8c0642cf68e651bdf833dcc7fd88d0c35e
User & Date: js on 2011-02-27 00:35:35
Other Links: manifest | tags
Context
2011-02-27
02:11
Don't call an OFTLSKey destructor if it is NULL. check-in: 1fe847a754 user: js tags: trunk
00:35
Rename -[result] to -[perform] in OFHTTPRequest. check-in: 53213f1d41 user: js tags: trunk
00:09
OFURL: Include the / in the path for http(s). check-in: 3d041cd4bf user: js tags: trunk
Changes

Modified src/OFHTTPRequest.h from [9575ac8a9b] to [15378426fb].

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
- (OFDictionary*)headers;

/**
 * Performs the HTTP request and returns an OFHTTPRequestResult.
 *
 * \return An OFHTTPRequestResult with the result of the HTTP request
 */
- (OFHTTPRequestResult*)result;

/**
 * Performs the HTTP request and returns an OFHTTPRequestResult.
 *
 * \param redirects The maximum number of redirects after which no further
 *		    attempt is done to follow the redirect, but instead the
 *		    redirect is returned as an OFHTTPRequest
 * \return An OFHTTPRequestResult with the result of the HTTP request
 */
- (OFHTTPRequestResult*)resultWithRedirects: (size_t)redirects;
@end

/**
 * \brief A class for storing the result of an HTTP request.
 */
@interface OFHTTPRequestResult: OFObject
{







|









|







100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
- (OFDictionary*)headers;

/**
 * Performs the HTTP request and returns an OFHTTPRequestResult.
 *
 * \return An OFHTTPRequestResult with the result of the HTTP request
 */
- (OFHTTPRequestResult*)perform;

/**
 * Performs the HTTP request and returns an OFHTTPRequestResult.
 *
 * \param redirects The maximum number of redirects after which no further
 *		    attempt is done to follow the redirect, but instead the
 *		    redirect is returned as an OFHTTPRequest
 * \return An OFHTTPRequestResult with the result of the HTTP request
 */
- (OFHTTPRequestResult*)performWithRedirects: (size_t)redirects;
@end

/**
 * \brief A class for storing the result of an HTTP request.
 */
@interface OFHTTPRequestResult: OFObject
{

Modified src/OFHTTPRequest.m from [f906f98e49] to [498ef03a59].

98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
}

- (OFDictionary*)headers
{
	return [[headers copy] autorelease];
}

- (OFHTTPRequestResult*)result
{
	return [self resultWithRedirects: 10];
}

- (OFHTTPRequestResult*)resultWithRedirects: (size_t)redirects
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *scheme = [URL scheme];
	OFTCPSocket *sock;
	OFHTTPRequestResult *result;

	if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])







|

|


|







98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
}

- (OFDictionary*)headers
{
	return [[headers copy] autorelease];
}

- (OFHTTPRequestResult*)perform
{
	return [self performWithRedirects: 10];
}

- (OFHTTPRequestResult*)performWithRedirects: (size_t)redirects
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFString *scheme = [URL scheme];
	OFTCPSocket *sock;
	OFHTTPRequestResult *result;

	if (![scheme isEqual: @"http"] && ![scheme isEqual: @"https"])
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
					[queryString release];
					queryString = nil;
				}

				[pool release];
				pool = nil;

				return [self resultWithRedirects:
				    redirects - 1];
			}

			[s_headers setObject: value
				      forKey: key];
		}








|







252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
					[queryString release];
					queryString = nil;
				}

				[pool release];
				pool = nil;

				return [self performWithRedirects:
				    redirects - 1];
			}

			[s_headers setObject: value
				      forKey: key];
		}

Modified src/OFString.m from [88740728b0] to [117e48e1f5].

707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
						encoding: encoding];
		[pool release];
		return self;
	}

	req = [OFHTTPRequest request];
	[req setURL: url];
	res = [req result];

	if ([res statusCode] != 200)
		@throw [OFHTTPRequestFailedException
		    newWithClass: [req class]
		     HTTPRequest: req
		      statusCode: [res statusCode]];








|







707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
						encoding: encoding];
		[pool release];
		return self;
	}

	req = [OFHTTPRequest request];
	[req setURL: url];
	res = [req perform];

	if ([res statusCode] != 200)
		@throw [OFHTTPRequestFailedException
		    newWithClass: [req class]
		     HTTPRequest: req
		      statusCode: [res statusCode]];