mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
redis fix
This commit is contained in:
parent
8d5dfd4b06
commit
aefd65d717
|
@ -686,6 +686,21 @@ public:
|
||||||
|
|
||||||
bool processMultiRequest(const char* format, uint32_t fmt_size, ...);
|
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)
|
#if defined(U_STDCPP_ENABLE) && defined(DEBUG)
|
||||||
const char* dump(bool reset) const;
|
const char* dump(bool reset) const;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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",
|
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)
|
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()))
|
if ((n = pthis->vitem.size()))
|
||||||
{
|
{
|
||||||
|
@ -232,6 +232,8 @@ U_NO_EXPORT bool UREDISClient_Base::getResponseItem()
|
||||||
{
|
{
|
||||||
uint32_t d = UClient_Base::response.distance(ptr2);
|
uint32_t d = UClient_Base::response.distance(ptr2);
|
||||||
|
|
||||||
|
manageResponseBufferResize(len);
|
||||||
|
|
||||||
if (UClient_Base::readResponse() == false)
|
if (UClient_Base::readResponse() == false)
|
||||||
{
|
{
|
||||||
U_RETURN(false);
|
U_RETURN(false);
|
||||||
|
|
|
@ -78,6 +78,8 @@ bool USocketExt::read(USocket* sk, UString& buffer, uint32_t count, int timeoutM
|
||||||
else UString::_reserve(buffer, buffer.getReserveNeed(chunk));
|
else UString::_reserve(buffer, buffer.getReserveNeed(chunk));
|
||||||
|
|
||||||
ncount = buffer.space();
|
ncount = buffer.space();
|
||||||
|
|
||||||
|
U_INTERNAL_ASSERT_MAJOR(ncount, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = buffer.c_pointer(start);
|
ptr = buffer.c_pointer(start);
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
01E1
|
01E8
|
||||||
|
|
|
@ -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, or jessie. Access this release through dists/oldstable
|
||||||
Debian 8.11 was released Saturday, 23rd June 2018.
|
Debian 8.11 was released Saturday, 23rd June 2018.
|
||||||
|
|
||||||
Debian 9.4, or stretch. Access this release through dists/stable
|
Debian 9.5, or stretch. Access this release through dists/stable
|
||||||
Debian 9.4 was released Saturday, 10th March 2018.
|
Debian 9.5 was released Saturday, 14th July 2018.
|
||||||
|
|
||||||
Testing, or buster. Access this release through dists/testing. The
|
Testing, or buster. Access this release through dists/testing. The
|
||||||
current tested development snapshot is named buster. Packages which
|
current tested development snapshot is named buster. Packages which
|
||||||
|
|
Loading…
Reference in New Issue
Block a user