ObjFW  Diff

Differences From Artifact [9070a0d7b2]:

To Artifact [3f2fb0c9c6]:

  • File src/OFTCPSocket.m — part of check-in [033054ad75] at 2009-05-29 19:21:57 on branch trunk — A few renames.

    OFExceptions:
    * OFNoMemException to OFOutOfMemoryException.
    * OFMemNotPartOfObjException to OFMemoryNotPartOfObjectException.

    OFObject:
    * -[addItemToMemoryPool:] to -[addMemoryToPool:].
    * -[allocWithSize:] to -[allocMemoryWithSize:].
    * -[allocNItems:withSize] to -[allocMemoryForNItems:withSize:].
    * -[resizeMem:toSize] to -[resizeMemory:toSize:].
    * -[resizeMem:toNItems:withSize:] to
    -[resizeMemoryToNItems:withSize:].
    * -[freeMem] to -[freeMemory:].

    OFString:
    * -[urlencode] to -[urlEncodedString].
    * -[urldecode] to -[urlDecodedString]. (user: js, size: 6709) [annotate] [blame] [check-ins using]


261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
	socklen_t addrlen;
	int s;

	newsock = [OFTCPSocket socket];
	addrlen = sizeof(struct sockaddr);

	@try {
		addr = [newsock allocWithSize: sizeof(struct sockaddr)];
	} @catch (OFException *e) {
		[newsock dealloc];
		@throw e;
	}

	if ((s = accept(sock, addr, &addrlen)) == INVALID_SOCKET) {
		[newsock dealloc];







|







261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
	socklen_t addrlen;
	int s;

	newsock = [OFTCPSocket socket];
	addrlen = sizeof(struct sockaddr);

	@try {
		addr = [newsock allocMemoryWithSize: sizeof(struct sockaddr)];
	} @catch (OFException *e) {
		[newsock dealloc];
		@throw e;
	}

	if ((s = accept(sock, addr, &addrlen)) == INVALID_SOCKET) {
		[newsock dealloc];
297
298
299
300
301
302
303
304
305
306
307
308
309
{
	if (sock == INVALID_SOCKET)
		@throw [OFNotConnectedException newWithClass: isa];

	sock = INVALID_SOCKET;

	if (saddr != NULL)
		[self freeMem: saddr];
	saddr_len = 0;

	return self;
}
@end







|





297
298
299
300
301
302
303
304
305
306
307
308
309
{
	if (sock == INVALID_SOCKET)
		@throw [OFNotConnectedException newWithClass: isa];

	sock = INVALID_SOCKET;

	if (saddr != NULL)
		[self freeMemory: saddr];
	saddr_len = 0;

	return self;
}
@end