| 499 | } |
| 500 | |
| 501 | void fxReadNetworkBuffer(txSerialMachine machine, char* buffer, int size) |
| 502 | { |
| 503 | if (!machine->suppress) { |
| 504 | txSerialTool self = machine->tool; |
| 505 | char* former = buffer; |
| 506 | char* current = buffer; |
| 507 | char* limit = buffer + size; |
| 508 | int offset; |
| 509 | while (current < limit) { |
| 510 | offset = current - former; |
| 511 | if ((offset >= 3) && (current[-3] == 13) && (current[-2] == 10) && (current[-1] == '<')) { |
| 512 | fxWriteSerial(self, former, offset); |
| 513 | fxWriteSerial(self, machine->tag, mxTagSize); |
| 514 | former = current; |
| 515 | } |
| 516 | current++; |
| 517 | } |
| 518 | offset = limit - former; |
| 519 | if (offset) { |
| 520 | static char* logout = "logout/>\r\n"; |
| 521 | static int c = 10; |
| 522 | fxWriteSerial(self, former, offset); |
| 523 | if (offset >= c) { |
| 524 | int i; |
| 525 | for (i = 0; i < c; i++) { |
| 526 | if (former[i] != logout[i]) |
| 527 | break; |
| 528 | } |
| 529 | if (i == c) { |
| 530 | exit(0); |
| 531 | } |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | void fxReadSerialBuffer(txSerialTool self, char* buffer, int size) |
| 538 | { |
no test coverage detected