<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hey All,</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Using memcached..</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So I&#39;ve noticed that while performing a cache_fetch I can&#39;t tell the difference between a cache failure and a NOT_FOUND. It seems the problem is actually in <span class="" style="background-color:rgb(255,255,204)">cachedb</span>.c because we do this at the end of cachedb_fetch:</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">    return cde-&gt;cdb_func.get(con,attr,val)&lt;0?-1:1;</div><div style="font-family:arial,sans-serif;font-size:13px">

 </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So I read this to basically say to return -1 on any failure regardless of the failure code. This is probably because of the generalized nature of the cache interface and since each cache backend has it&#39;s own return codes. I get that, but that being said, I can&#39;t tell what the failure is and respond properly.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">So I changed that one return line to look more like this:</div><div style="font-family:arial,sans-serif;font-size:13px">

<br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>        res = cde-&gt;cdb_func.get(con,attr,val);</div><div>        if (res &lt; 0) {</div><div>          return res;</div><div>        } else {</div>

<div>          return 1;</div><div>        }</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Is this acceptable? Will I run into problems I&#39;m not thinking about? The only real problem I can see is that a specific error number on one cache backend might mean something different on another. Obviously the only way to really fix this would be to have each cache backend to match up it&#39;s own backend&#39;s reply codes to a set of generic opensips cache engine reply codes separately enumerated.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thoughts? </div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">

Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Brett</div></div>