mirror of
https://github.com/stefanocasazza/ULib.git
synced 2025-09-28 19:05:55 +08:00
fix coverage
This commit is contained in:
parent
cb3ff25402
commit
2823f6abcc
|
@ -804,8 +804,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
{
|
{
|
||||||
unsigned n = 0;
|
unsigned n = 0;
|
||||||
char* names[1024];
|
char* names[1024];
|
||||||
int j, file_num = 0;
|
|
||||||
unsigned names_len[1024];
|
unsigned names_len[1024];
|
||||||
|
int j, file_num = 0, f_fd, handle;
|
||||||
|
|
||||||
U_INTERNAL_TRACE("zip_extract(%s,%p,%p,%p)", zipfile, files, filenames, filenames_len)
|
U_INTERNAL_TRACE("zip_extract(%s,%p,%p,%p)", zipfile, files, filenames, filenames_len)
|
||||||
|
|
||||||
|
@ -818,8 +818,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
int f_fd = 0,
|
f_fd = 0;
|
||||||
handle = 1; /* by default we'll extract/create the file */
|
handle = 1; /* by default we'll extract/create the file */
|
||||||
|
|
||||||
U_INTERNAL_ASSERT(n < 1024)
|
U_INTERNAL_ASSERT(n < 1024)
|
||||||
|
|
||||||
|
@ -843,15 +843,12 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handle)
|
if (handle == 0) f_fd = -1;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
names[n] = strdup((const char*)filename);
|
names[n] = strdup((const char*)filename);
|
||||||
names_len[n] = fnlen;
|
names_len[n] = fnlen;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
f_fd = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OK, there is some directory information in the file. Nothing to do
|
* OK, there is some directory information in the file. Nothing to do
|
||||||
|
@ -859,7 +856,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
* What a pain!
|
* What a pain!
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (strchr((const char*)filename, '/') != 0 && handle)
|
if (handle &&
|
||||||
|
strchr((const char*)filename, '/') != 0)
|
||||||
{
|
{
|
||||||
/* Loop through all the directories in the path, (everything w/ a '/') */
|
/* Loop through all the directories in the path, (everything w/ a '/') */
|
||||||
|
|
||||||
|
@ -916,14 +914,15 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (S_ISDIR(sbuf.st_mode))
|
|
||||||
{
|
|
||||||
U_INTERNAL_TRACE("Directory exists")
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (S_ISDIR(sbuf.st_mode))
|
||||||
|
{
|
||||||
|
U_INTERNAL_TRACE("Directory exists")
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
U_INTERNAL_TRACE("Hmmm.. %s exists but isn't a directory!", tmp_buff)
|
U_INTERNAL_TRACE("Hmmm.. %s exists but isn't a directory!", tmp_buff)
|
||||||
|
|
||||||
free(tmp_buff);
|
free(tmp_buff);
|
||||||
|
@ -1006,8 +1005,8 @@ unsigned zip_extract(const char* zipfile, const char** files, char*** filenames,
|
||||||
(void) write(f_fd, rd_buff, rdamt);
|
(void) write(f_fd, rd_buff, rdamt);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
in_a -= rdamt;
|
||||||
out_a += rdamt;
|
out_a += rdamt;
|
||||||
in_a -= rdamt;
|
|
||||||
|
|
||||||
U_INTERNAL_TRACE("%d bytes written", out_a)
|
U_INTERNAL_TRACE("%d bytes written", out_a)
|
||||||
}
|
}
|
||||||
|
|
|
@ -947,9 +947,10 @@ bool UHttpClient_Base::sendRequest()
|
||||||
|
|
||||||
if (server_context_flag)
|
if (server_context_flag)
|
||||||
{
|
{
|
||||||
u_clientimage_info.flag.u = flag_save;
|
u_clientimage_info.flag.u = flag_save;
|
||||||
u_clientimage_info.http_info.nResponseCode = U_http_info.nResponseCode;
|
|
||||||
u_clientimage_info.http_info = http_info_save;
|
http_info_save.nResponseCode = U_http_info.nResponseCode;
|
||||||
|
U_http_info = http_info_save;
|
||||||
}
|
}
|
||||||
|
|
||||||
U_INTERNAL_DUMP("server_context_flag = %b U_ClientImage_close = %b", server_context_flag, U_ClientImage_close)
|
U_INTERNAL_DUMP("server_context_flag = %b U_ClientImage_close = %b", server_context_flag, U_ClientImage_close)
|
||||||
|
|
|
@ -4481,6 +4481,7 @@ file_in_cache:
|
||||||
if (checkIfSourceHasChangedAndCompileUSP())
|
if (checkIfSourceHasChangedAndCompileUSP())
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
|
# ifndef U_COVERITY_FALSE_POSITIVE // FORWARD_NULL
|
||||||
UServletPage* usp = (UServletPage*)file_data->ptr;
|
UServletPage* usp = (UServletPage*)file_data->ptr;
|
||||||
|
|
||||||
U_INTERNAL_ASSERT_POINTER(usp)
|
U_INTERNAL_ASSERT_POINTER(usp)
|
||||||
|
@ -4491,6 +4492,7 @@ file_in_cache:
|
||||||
U_DUMP("U_http_info.nResponseCode = %u", U_http_info.nResponseCode)
|
U_DUMP("U_http_info.nResponseCode = %u", U_http_info.nResponseCode)
|
||||||
|
|
||||||
usp->runDynamicPage(0);
|
usp->runDynamicPage(0);
|
||||||
|
# endif
|
||||||
|
|
||||||
U_DUMP("U_http_info.nResponseCode = %u U_ClientImage_parallelization = %d UClientImage_Base::isNoHeaderForResponse() = %b",
|
U_DUMP("U_http_info.nResponseCode = %u U_ClientImage_parallelization = %d UClientImage_Base::isNoHeaderForResponse() = %b",
|
||||||
U_http_info.nResponseCode, U_ClientImage_parallelization, UClientImage_Base::isNoHeaderForResponse())
|
U_http_info.nResponseCode, U_ClientImage_parallelization, UClientImage_Base::isNoHeaderForResponse())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user