Overview
Comment: | Enhance exceptions; fix some FIXMEs in OFTCPSocket. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
a01c94d9dd4b73ce572c1b9fa9b9b05c |
User & Date: | js on 2008-12-10 18:00:59 |
Other Links: | manifest | tags |
Context
2008-12-10
| ||
20:53 | Fix FIXMEs in OFString; new exception. check-in: 4f7378978c user: js tags: trunk | |
18:00 | Enhance exceptions; fix some FIXMEs in OFTCPSocket. check-in: a01c94d9dd user: js tags: trunk | |
17:54 | When closing an OFTCPSocket, set it's internal socket to -1. check-in: e9f870cfc0 user: js tags: trunk | |
Changes
Modified src/OFExceptions.h from [c0dcb82286] to [077a4ec303].
︙ | |||
36 37 38 39 40 41 42 43 44 45 46 47 48 49 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + + + + + | * \param obj The object which caused the exception * \return An initialized OFException */ - initWithObject: (id)obj; - free; /** * \return The object that caused the exception */ - (id)object; /** * \return An error message for the exception as a C String */ - (char*)cString; @end /** |
︙ | |||
125 126 127 128 129 130 131 | 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | - - - + - - - + - - - - - - - | @end /** * An OFException indicating the given value is out of range. */ @interface OFOutOfRangeException: OFException {} /** |
︙ | |||
253 254 255 256 257 258 259 260 261 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 | + + + + + + + + + + + + + + + + + + + + + | /** * An OFException indicating a write to the file failed. */ @interface OFWriteFailedException: OFReadOrWriteFailedException {} /** * \return An error message for the exception as a C String */ - (char*)cString; @end /** * An OFException indicating a socket is not connected or bound. */ @interface OFNotConnectedException: OFException {} /** * \return An error message for the exception as a C string. */ - (char*)cString; @end /** * An OFException indicating an attempt to connect or bind an already connected * or bound socket */ @interface OFAlreadyConnectedException: OFException {} /** * \return An error message for the exception as a C string. */ - (char*)cString; @end |
Modified src/OFExceptions.m from [4ac6f2f10b] to [47e102896c].
︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | + + + + + | - free { if (string != NULL) free(string); return [super free]; } - (id)object { return object; } - (char*)cString { return string; } @end |
︙ | |||
76 77 78 79 80 81 82 | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | - - + + | } - (char*)cString { if (string != NULL) return string; |
︙ | |||
110 111 112 113 114 115 116 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | - + - - - - - + + + - - - - - - - - - - - + | } - (char*)cString { if (string != NULL) return string; |
︙ | |||
186 187 188 189 190 191 192 | 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | - - + + | } - (char*)cString { if (string != NULL) return string; |
︙ | |||
242 243 244 245 246 247 248 | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + | @implementation OFReadFailedException - (char*)cString { if (string != NULL) return string;; |
Modified src/OFTCPSocket.m from [594dc2652b] to [8a2ef1e3cd].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | - - + + - - | char portstr[6]; if (!port) { /* FIXME: Throw exception */ return nil; } |
︙ | |||
114 115 116 117 118 119 120 | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | - - + + - - | char portstr[6]; if (!port) { /* FIXME: Throw exception */ return nil; } |
︙ | |||
148 149 150 151 152 153 154 | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | - - + + - - - - + + - - | freeaddrinfo(res); return self; } - listenWithBackLog: (int)backlog { |
︙ | |||
210 211 212 213 214 215 216 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | - - + + - - - - + + - - - - + + - - - - + + - - - - + + - - | } - (size_t)readNBytes: (size_t)size intoBuffer: (uint8_t*)buf { ssize_t ret; |
Modified tests/OFArray/OFArray.m from [2327b3b399] to [6fb90c3139].
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | - + | #define CATCH_EXCEPTION(code, exception) \ caught = NO; \ @try { \ code; \ } @catch (exception *e) { \ caught = YES; \ puts("CAUGHT! Error string was:"); \ |
︙ |
Modified tests/OFObject/OFObject.m from [efc895790f] to [3c3dc8da7e].
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + | #define CATCH_EXCEPTION(code, exception) \ caught = NO; \ @try { \ code; \ } @catch (exception *e) { \ caught = YES; \ puts("CAUGHT! Error string was:"); \ |
︙ |
Modified tests/OFTCPSocket/OFTCPSocket.m from [5359cde91c] to [af4aa7dc3f].
︙ | |||
100 101 102 103 104 105 106 107 108 109 110 | 100 101 102 103 104 105 106 107 108 109 110 111 | + | } [accepted free]; [client close]; [server close]; } @catch(OFException *e) { printf("EXCEPTION: %s\n", [e cString]); return 1; } return 0; } |