| 1302 | } |
| 1303 | |
| 1304 | void socketClearPending(void *the, void *refcon, uint8_t *message, uint16_t messageLength) |
| 1305 | { |
| 1306 | xsSocket xss = refcon; |
| 1307 | uint8_t pending; |
| 1308 | |
| 1309 | if (xss->suspended) |
| 1310 | return; |
| 1311 | |
| 1312 | modCriticalSectionBegin(); |
| 1313 | |
| 1314 | pending = xss->pending; |
| 1315 | xss->pending &= kPendingClose; // don't clear close flag |
| 1316 | |
| 1317 | modCriticalSectionEnd(); |
| 1318 | |
| 1319 | if (!pending) { |
| 1320 | modLog("socketClearPending called - NOTHING PENDING?"); |
| 1321 | goto done; // return or done... |
| 1322 | } |
| 1323 | |
| 1324 | if ((pending & kPendingConnect) && !(xss->pending & kPendingClose)) |
| 1325 | socketMsgConnect(xss); |
| 1326 | |
| 1327 | if ((pending & kPendingReceive) && !(xss->pending & kPendingClose)) |
| 1328 | socketMsgDataReceived(xss); |
| 1329 | |
| 1330 | if ((pending & kPendingSent) && !(xss->pending & kPendingClose)) |
| 1331 | socketMsgDataSent(xss); |
| 1332 | |
| 1333 | if ((pending & kPendingOutput) && !(xss->pending & kPendingClose) && xss->skt) |
| 1334 | tcp_output_safe(xss->skt); |
| 1335 | |
| 1336 | if ((pending & kPendingDisconnect) && !(xss->pending & kPendingClose)) |
| 1337 | socketMsgDisconnect(xss); |
| 1338 | |
| 1339 | if ((pending & kPendingError) && !(xss->pending & kPendingClose)) |
| 1340 | socketMsgError(xss); |
| 1341 | |
| 1342 | if ((pending & kPendingAcceptListener) && !(xss->pending & kPendingClose)) |
| 1343 | listenerMsgNew((xsListener)xss); |
| 1344 | |
| 1345 | if (pending & kPendingClose) { |
| 1346 | if (socketDownUseCount(xss->the, xss)) |
| 1347 | return; |
| 1348 | } |
| 1349 | |
| 1350 | done: |
| 1351 | socketDownUseCount(xss->the, xss); |
| 1352 | } |
| 1353 | |
| 1354 | void *modSocketGetLWIP(xsMachine *the, xsSlot *slot) |
| 1355 | { |
nothing calls this directly
no test coverage detected