1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00

redis fix

This commit is contained in:
stefanocasazza 2018-07-17 17:01:13 +02:00
parent 8d5dfd4b06
commit aefd65d717
5 changed files with 23 additions and 4 deletions

View File

@ -686,6 +686,21 @@ public:
bool processMultiRequest(const char* format, uint32_t fmt_size, ...);
// REDI-SEARCH (@see https://oss.redislabs.com/redisearch/)
bool suggest(const char* key, uint32_t keyLength, const char* prefix, uint32_t prefixLength, bool fuzzy, bool withPayloads)
{
U_TRACE(0, "UREDISClient_Base::suggest(%.*S,%u,%.*S,%u,%b,%b)", keyLength, key, keyLength, prefixLength, prefix, prefixLength, fuzzy, withPayloads)
U_INTERNAL_ASSERT_EQUALS(u_buffer_len, 0)
return processRequest(U_RC_MULTIBULK, U_CONSTANT_TO_PARAM("FT.SUGGET"), u_buffer,
u__snprintf(u_buffer, U_BUFFER_SIZE, U_CONSTANT_TO_PARAM("%.*s %.*s %.*s %.*s"),
keyLength, key, prefixLength, prefix,
(fuzzy ? U_CONSTANT_SIZE("FUZZY") : 0), "FUZZY",
(withPayloads ? U_CONSTANT_SIZE("WITHPAYLOADS") : 0), "WITHPAYLOADS"));
}
#if defined(U_STDCPP_ENABLE) && defined(DEBUG)
const char* dump(bool reset) const;
#endif

View File

@ -111,7 +111,7 @@ void UREDISClient_Base::manageResponseBufferResize(uint32_t n)
U_INTERNAL_DUMP("rep = %p rep->parent = %p rep->references = %u rep->_length = %u rep->_capacity = %u",
rep, rep->parent, rep->references, rep->_length, rep->_capacity)
UStringRep* nrep = UStringRep::create(rep->_length, n, rep->data());
UStringRep* nrep = UStringRep::create(rep->_length, rep->_length+n, rep->data());
if ((n = pthis->vitem.size()))
{
@ -232,6 +232,8 @@ U_NO_EXPORT bool UREDISClient_Base::getResponseItem()
{
uint32_t d = UClient_Base::response.distance(ptr2);
manageResponseBufferResize(len);
if (UClient_Base::readResponse() == false)
{
U_RETURN(false);

View File

@ -78,6 +78,8 @@ bool USocketExt::read(USocket* sk, UString& buffer, uint32_t count, int timeoutM
else UString::_reserve(buffer, buffer.getReserveNeed(chunk));
ncount = buffer.space();
U_INTERNAL_ASSERT_MAJOR(ncount, 0)
}
ptr = buffer.c_pointer(start);

View File

@ -1 +1 @@
01E1
01E8

View File

@ -7,8 +7,8 @@ Debian 7.11 was released Saturday, 4th June 2016.
Debian 8.11, or jessie. Access this release through dists/oldstable
Debian 8.11 was released Saturday, 23rd June 2018.
Debian 9.4, or stretch. Access this release through dists/stable
Debian 9.4 was released Saturday, 10th March 2018.
Debian 9.5, or stretch. Access this release through dists/stable
Debian 9.5 was released Saturday, 14th July 2018.
Testing, or buster. Access this release through dists/testing. The
current tested development snapshot is named buster. Packages which