Differences From Artifact [086ef33868]:
- File
tests/OFHTTPClientTests.m
— part of check-in
[7f102e8c95]
at
2020-10-31 19:16:46
on branch trunk
— OFHTTPClient: Remove didFailWithException
Instead, add an exception to didPerformRequest, to make it more
consistent with other places. (user: js, size: 3828) [annotate] [blame] [check-ins using] [more...]
To Artifact [2d2b40724b]:
- File tests/OFHTTPClientTests.m — part of check-in [1b82d3bf4f] at 2021-03-07 20:25:21 on branch trunk — *.m: Fold methods into one line where it fits (user: js, size: 3730) [annotate] [blame] [check-ins using] [more...]
1 | /* | < < | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
41 42 43 44 45 46 47 | { OFTCPSocket *listener, *client; char buffer[5]; [cond lock]; listener = [OFTCPSocket socket]; | | < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | { OFTCPSocket *listener, *client; char buffer[5]; [cond lock]; listener = [OFTCPSocket socket]; _port = [listener bindToHost: @"127.0.0.1" port: 0]; [listener listen]; [cond signal]; [cond unlock]; client = [listener accept]; |
︙ | ︙ | |||
70 71 72 73 74 75 76 | if (![[client readLine] isEqual: [OFString stringWithFormat: @"Host: 127.0.0.1:%" @PRIu16, _port]]) OF_ENSURE(0); if (![[client readLine] isEqual: @""]) OF_ENSURE(0); | | < | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | if (![[client readLine] isEqual: [OFString stringWithFormat: @"Host: 127.0.0.1:%" @PRIu16, _port]]) OF_ENSURE(0); if (![[client readLine] isEqual: @""]) OF_ENSURE(0); [client readIntoBuffer: buffer exactLength: 5]; if (memcmp(buffer, "Hello", 5) != 0) OF_ENSURE(0); [client writeString: @"HTTP/1.0 200 OK\r\n" @"cONTeNT-lENgTH: 7\r\n" @"\r\n" @"foo\n" |
︙ | ︙ |