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 2015-11-24 16:21:16 +01:00
parent 89af64a8bd
commit 7886a7954e
17 changed files with 40 additions and 28 deletions

View File

@ -55,7 +55,7 @@ static void usp_end_db()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
pworld_db->id = u_get_num_random(10000); pworld_db->id = u_get_num_random(10000);

View File

@ -36,7 +36,7 @@ static void usp_end_json()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
#ifndef AS_cpoll_cppsp_DO #ifndef AS_cpoll_cppsp_DO

View File

@ -64,7 +64,7 @@ static void usp_end_query()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
int i = 0, num_queries; int i = 0, num_queries;

View File

@ -51,7 +51,7 @@ static void usp_end_rdb()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
UStringRep* rep; UStringRep* rep;

View File

@ -54,7 +54,7 @@ static void usp_end_rquery()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
World* pworld; World* pworld;

View File

@ -54,7 +54,7 @@ static void usp_end_rupdate()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
World* pworld; World* pworld;

View File

@ -72,7 +72,7 @@ static void usp_end_update()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
int i = 0, num_queries; int i = 0, num_queries;

View File

@ -1053,6 +1053,18 @@ loop:
if (sz == UClientImage_Base::rstart) if (sz == UClientImage_Base::rstart)
{ {
U_INTERNAL_DUMP("settings_ack = %b U_http2_settings_len = %b", settings_ack, U_http2_settings_len)
if (settings_ack &&
U_http2_settings_len)
{
U_DEBUG("HTTP2 upgrade: User-Agent = %.*S", U_HTTP_USER_AGENT_TO_TRACE);
openStream();
goto end;
}
UClientImage_Base::rstart = 0; UClientImage_Base::rstart = 0;
UClientImage_Base::rbuffer->setEmpty(); UClientImage_Base::rbuffer->setEmpty();
@ -1169,19 +1181,6 @@ loop:
{ {
// TODO // TODO
U_INTERNAL_DUMP("settings_ack = %b UClientImage_Base::rbuffer->size() = %u UClientImage_Base::rstart = %u",
settings_ack, UClientImage_Base::rbuffer->size(), UClientImage_Base::rstart)
if (settings_ack &&
UClientImage_Base::rbuffer->size() == UClientImage_Base::rstart)
{
U_INTERNAL_DUMP("User-Agent: = %.*S", U_HTTP_USER_AGENT_TO_TRACE)
openStream();
goto end;
}
goto loop; goto loop;
} }

View File

@ -6018,15 +6018,22 @@ end:
if (u_is_html(mime_index)) if (u_is_html(mime_index))
{ {
# if defined(U_LOG_ENABLE) && defined(USE_LIBZ)
u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','h','t','m','l',';',' ','c')); u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','h','t','m','l',';',' ','c'));
u_put_unalignedp64(ptr1+8, U_MULTICHAR_CONSTANT64('h','a','r','s','e','t','=','U')); u_put_unalignedp64(ptr1+8, U_MULTICHAR_CONSTANT64('h','a','r','s','e','t','=','U'));
u_put_unalignedp32(ptr1+16, U_MULTICHAR_CONSTANT32('T','F','-','8')); u_put_unalignedp32(ptr1+16, U_MULTICHAR_CONSTANT32('T','F','-','8'));
u_put_unalignedp16(ptr1+20, U_MULTICHAR_CONSTANT16('\r','\n')); u_put_unalignedp16(ptr1+20, U_MULTICHAR_CONSTANT16('\r','\n'));
sz += U_CONSTANT_SIZE("Content-Type: " U_CTYPE_HTML "\r\n"); sz += U_CONSTANT_SIZE("Content-Type: " U_CTYPE_HTML "\r\n");
# else
u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','h','t','m','l','\r','\n','\0'));
sz += U_CONSTANT_SIZE("Content-Type: text/html\r\n");
# endif
} }
else else
{ {
# if defined(U_LOG_ENABLE) && defined(USE_LIBZ)
u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','p','l','a','i','n',';',' ')); u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','p','l','a','i','n',';',' '));
u_put_unalignedp64(ptr1+8, U_MULTICHAR_CONSTANT64('c','h','a','r','s','e','t','=')); u_put_unalignedp64(ptr1+8, U_MULTICHAR_CONSTANT64('c','h','a','r','s','e','t','='));
u_put_unalignedp32(ptr1+16, U_MULTICHAR_CONSTANT32('U','T','F','-')); u_put_unalignedp32(ptr1+16, U_MULTICHAR_CONSTANT32('U','T','F','-'));
@ -6034,6 +6041,11 @@ end:
u_put_unalignedp16(ptr1+21, U_MULTICHAR_CONSTANT16('\r','\n')); u_put_unalignedp16(ptr1+21, U_MULTICHAR_CONSTANT16('\r','\n'));
sz += U_CONSTANT_SIZE("Content-Type: " U_CTYPE_TEXT "\r\n"); sz += U_CONSTANT_SIZE("Content-Type: " U_CTYPE_TEXT "\r\n");
# else
u_put_unalignedp64(ptr1, U_MULTICHAR_CONSTANT64('/','p','l','a','i','n','\r','\n'));
sz += U_CONSTANT_SIZE("Content-Type: text/plain\r\n");
# endif
} }
} }
@ -9575,7 +9587,7 @@ U_NO_EXPORT void UHTTP::processGetRequest()
{ {
expire = 0L; expire = 0L;
ctype = (mime_index == U_unknow ? U_CTYPE_TEXT ctype = (mime_index == U_unknow ? "text/plain"
: file->getMimeType()); : file->getMimeType());
} }

View File

@ -313,6 +313,7 @@ check_for_netcat() {
NC=nc NC=nc
fi fi
if [ "$NC_TEST" = "Ncat 6.47 " ] || \ if [ "$NC_TEST" = "Ncat 6.47 " ] || \
[ "$NC_TEST" = "Ncat 7.00 " ] || \
[ "$NC_TEST" = "usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]" ] || \ [ "$NC_TEST" = "usage: nc [-46DdhklnrStUuvzC] [-i interval] [-p source_port]" ] || \
[ "$NC_TEST" = "This is nc from the netcat-openbsd package. An alternative nc is available in the netcat-traditional package." ]; then [ "$NC_TEST" = "This is nc from the netcat-openbsd package. An alternative nc is available in the netcat-traditional package." ]; then
NC=nc NC=nc

View File

@ -55,7 +55,7 @@ static void usp_end_db()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
pworld_db->id = u_get_num_random(10000); pworld_db->id = u_get_num_random(10000);

View File

@ -36,7 +36,7 @@ static void usp_end_json()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
#ifndef AS_cpoll_cppsp_DO #ifndef AS_cpoll_cppsp_DO

View File

@ -64,7 +64,7 @@ static void usp_end_query()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
int i = 0, num_queries; int i = 0, num_queries;

View File

@ -51,7 +51,7 @@ static void usp_end_rdb()
#endif #endif
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
UStringRep* rep; UStringRep* rep;

View File

@ -54,7 +54,7 @@ static void usp_end_rquery()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
World* pworld; World* pworld;

View File

@ -54,7 +54,7 @@ static void usp_end_rupdate()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
World* pworld; World* pworld;

View File

@ -72,7 +72,7 @@ static void usp_end_update()
queries; queries;
--> -->
<!--#header <!--#header
Content-Type: application/json; charset=UTF-8 Content-Type: application/json
--> -->
<!--#code <!--#code
int i = 0, num_queries; int i = 0, num_queries;