1
0
mirror of https://github.com/stefanocasazza/ULib.git synced 2025-09-28 19:05:55 +08:00
This commit is contained in:
stefanocasazza 2017-09-12 18:56:56 +02:00
parent a8d2a9d797
commit 6d4c5e19ae
11 changed files with 32 additions and 25 deletions

View File

@ -156,7 +156,7 @@ static inline uint8_t u_loadavg(const char* buffer)
* Output range: [2..2147483648]
*/
static inline uint64_t u_nextPowerOfTwo(uint32_t n)
static inline uint32_t u_nextPowerOfTwo(uint32_t n)
{
U_INTERNAL_TRACE("u_nextPowerOfTwo(%u)", n)

View File

@ -249,7 +249,7 @@ protected:
static bool setHandler(int fd);
private:
static void handlerDelete(int fd, int mask);
static void handlerDelete(unsigned int fd, int mask);
#ifndef USE_LIBEVENT
static void notifyHandlerEvent() U_NO_EXPORT;

View File

@ -1000,7 +1000,9 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
ze.crc = crc32(ze.crc, (Bytef*)rd_buff, rdamt);
# ifndef U_COVERITY_FALSE_POSITIVE // NEGATIVE_RETURNS
(void) write(f_fd, rd_buff, rdamt);
# endif
out_a += rdamt;
in_a -= rdamt;

View File

@ -975,7 +975,9 @@ U_EXPORT istream& operator>>(istream& is, UCDB& cdb)
{
u_put_unaligned32(hr->dlen, dlen);
# ifndef U_COVERITY_FALSE_POSITIVE // TAINTED_SCALAR
is.read(ptr, dlen);
# endif
U_INTERNAL_DUMP("data = %.*S", dlen, ptr)

View File

@ -17,6 +17,7 @@ void* UPlugIn<void*>::create(const char* name, uint32_t name_len)
{
U_TRACE(0, "UPlugIn<void*>::create(%.*S,%u)", name_len, name, name_len)
#ifndef U_COVERITY_FALSE_POSITIVE
HINSTANCE handle = UDynamic::dload(name, name_len);
if (handle)
@ -36,6 +37,7 @@ void* UPlugIn<void*>::create(const char* name, uint32_t name_len)
return obj;
}
}
#endif
return U_NULLPTR;
}

View File

@ -479,7 +479,9 @@ void ULog::write(const struct iovec* iov, int n)
if (file_ptr <= log_gzip_sz)
{
# ifndef U_COVERITY_FALSE_POSITIVE // FORWARD_NULL
checkForLogRotateDataToWrite(); // check if there are previous data to write
# endif
ptr_log_data->gzip_len = u_gz_deflate(UFile::map, file_ptr, (char*)ptr_log_data+sizeof(log_data), true);
@ -682,7 +684,7 @@ void ULog::log(const struct iovec* iov, const char* type, int ncount, const char
ptr = buffer1;
}
len = (UServer_Base::mod_name[0] ? u__snprintf(buffer2, sizeof(buffer2), U_CONSTANT_TO_PARAM("%s"), UServer_Base::mod_name) : 0);
len = (UServer_Base::mod_name[0][0] ? u__snprintf(buffer2, sizeof(buffer2), U_CONSTANT_TO_PARAM("%s"), UServer_Base::mod_name) : 0);
len += u__snprintf(buffer2+len, sizeof(buffer2)-len, U_CONSTANT_TO_PARAM("send %s (%u bytes) %.*s%#.*S"), type, ncount, msg_len, msg, sz, ptr);
va_list argp;
@ -720,7 +722,7 @@ void ULog::logResponse(const UString& data, const char* format, uint32_t fmt_siz
U_INTERNAL_DUMP("u_printf_string_max_length = %d", u_printf_string_max_length)
len = (UServer_Base::mod_name[0] ? u__snprintf(buffer, sizeof(buffer), U_CONSTANT_TO_PARAM("%s"), UServer_Base::mod_name) : 0);
len = (UServer_Base::mod_name[0][0] ? u__snprintf(buffer, sizeof(buffer), U_CONSTANT_TO_PARAM("%s"), UServer_Base::mod_name) : 0);
len += u__snprintf(buffer-len, sizeof(buffer)-len, U_CONSTANT_TO_PARAM("received response (%u bytes) %#.*S"), sz, sz, ptr);
va_list argp;

View File

@ -236,11 +236,15 @@ int UFCGIPlugIn::handlerInit()
UHTTP::valias->push_back(*UString::str_nostat);
environment_type = (UHTTP::fcgi_uri_mask->equal(U_CONSTANT_TO_PARAM("*.php")) ? U_PHP : U_CGI);
U_RETURN(U_PLUGIN_HANDLER_OK);
# endif
}
delete connection;
connection = U_NULLPTR;
U_RETURN(U_PLUGIN_HANDLER_ERROR);
}
U_RETURN(U_PLUGIN_HANDLER_OK);

View File

@ -1133,7 +1133,7 @@ int USSIPlugIn::handlerRequest()
UClientImage_Base::environment->setEmpty();
}
// U_RETURN(U_PLUGIN_HANDLER_PROCESSED);
U_RETURN(U_PLUGIN_HANDLER_PROCESSED);
}
U_RETURN(U_PLUGIN_HANDLER_OK);

View File

@ -2157,9 +2157,6 @@ U_NO_EXPORT void UServer_Base::loadStaticLinkedModules(const char* name)
if (vplugin_name->find(x) != U_NOT_FOUND) // NB: we load only the plugin that we want from configuration (PLUGIN var)...
{
# ifndef U_LOG_DISABLE
bool ok = false;
# endif
#if defined(U_STATIC_HANDLER_RPC) || defined(U_STATIC_HANDLER_SHIB) || defined(U_STATIC_HANDLER_ECHO) || \
defined(U_STATIC_HANDLER_STREAM) || defined(U_STATIC_HANDLER_SOCKET) || defined(U_STATIC_HANDLER_SCGI) || \
defined(U_STATIC_HANDLER_FCGI) || defined(U_STATIC_HANDLER_GEOIP) || defined(U_STATIC_HANDLER_PROXY) || \
@ -2210,23 +2207,17 @@ U_NO_EXPORT void UServer_Base::loadStaticLinkedModules(const char* name)
# endif
next: if (_plugin)
{
# ifndef U_LOG_DISABLE
ok = true;
# endif
vplugin_name_static->push_back(x);
vplugin_static->push_back(_plugin);
U_SRV_LOG("Link phase of static plugin %V success", x.rep);
}
else
{
U_SRV_LOG("WARNING: Link phase of static plugin %V failed", x.rep);
}
#endif
# ifndef U_LOG_DISABLE
if (isLog())
{
if (ok) log->log(U_CONSTANT_TO_PARAM( "Link phase of static plugin %V success"), x.rep);
else log->log(U_CONSTANT_TO_PARAM("WARNING: Link phase of static plugin %V failed"), x.rep);
}
# endif
}
}

View File

@ -962,9 +962,9 @@ bool UNotifier::modify(UEventFd* item)
U_RETURN(true);
}
void UNotifier::handlerDelete(int fd, int mask)
void UNotifier::handlerDelete(unsigned int fd, int mask)
{
U_TRACE(0, "UNotifier::handlerDelete(%d,%B)", fd, mask)
U_TRACE(0, "UNotifier::handlerDelete(%u,%B)", fd, mask)
U_INTERNAL_ASSERT_MAJOR(fd, 0)
U_INTERNAL_ASSERT_DIFFERS(U_ClientImage_parallelization, U_PARALLELIZATION_CHILD)

View File

@ -4431,7 +4431,9 @@ file_in_cache:
if (isValidation() == false) U_RETURN(U_PLUGIN_HANDLER_OK);
# endif
# ifndef U_COVERITY_FALSE_POSITIVE // FORWARD_NULL
mime_index = file_data->mime_index;
# endif
U_INTERNAL_DUMP("mime_index(%d) = %C u_is_ssi() = %b", mime_index, mime_index, u_is_ssi(mime_index))
@ -8826,8 +8828,12 @@ nocontent: UClientImage_Base::setCloseConnection();
if (U_STREQ(ptr, len, U_LIB_SUFFIX)) goto nocontent;
(void) suffix.assign(ptr, len);
U_INTERNAL_DUMP("suffix = %V", suffix.rep)
if (U_HTTP_QUERY_STREQ("_nav_") &&
U_STREQ(ptr, len, "usp"))
suffix.equal(U_CONSTANT_TO_PARAM("usp")))
{
UClientImage_Base::setRequestNeedProcessing();
}
@ -8841,8 +8847,6 @@ nocontent: UClientImage_Base::setCloseConnection();
U_ASSERT_EQUALS(basename, UStringExt::basename(file->getPath()))
if (len) (void) suffix.assign(ptr, len);
(void) pathname->replace(U_FILE_TO_PARAM(*file));
manageDataForCache(basename, suffix);