moves DB path information (from limbo transaction) to another buffer
| 1556 | |
| 1557 | // moves DB path information (from limbo transaction) to another buffer |
| 1558 | void getDbPathInfo(unsigned int& itemsLength, const unsigned char*& items, |
| 1559 | unsigned int& bufferLength, unsigned char*& buffer, |
| 1560 | Firebird::Array<unsigned char>& newItemsBuffer, const Firebird::PathName& dbpath) |
| 1561 | { |
| 1562 | if (itemsLength && items) |
| 1563 | { |
| 1564 | const unsigned char* ptr = (const unsigned char*) memchr(items, fb_info_tra_dbpath, itemsLength); |
| 1565 | if (ptr) |
| 1566 | { |
| 1567 | newItemsBuffer.add(items, itemsLength); |
| 1568 | newItemsBuffer.remove(ptr - items); |
| 1569 | items = newItemsBuffer.begin(); |
| 1570 | --itemsLength; |
| 1571 | |
| 1572 | unsigned int len = dbpath.length(); |
| 1573 | if (len + 4 > bufferLength) |
| 1574 | { |
| 1575 | len = bufferLength - 4; |
| 1576 | } |
| 1577 | bufferLength -= (len + 3); |
| 1578 | *buffer++ = fb_info_tra_dbpath; |
| 1579 | *buffer++ = len; |
| 1580 | *buffer++ = len >> 8; |
| 1581 | memcpy(buffer, dbpath.c_str(), len); |
| 1582 | buffer += len; |
| 1583 | *buffer = isc_info_end; |
| 1584 | } |
| 1585 | } |
| 1586 | } |
| 1587 | |
| 1588 | // returns true if passed info items work with running svc thread |
| 1589 | bool isRunningCheck(const UCHAR* items, unsigned int length) |