diff options
| author | lishu <[email protected]> | 2019-01-11 16:30:45 +0800 |
|---|---|---|
| committer | lishu <[email protected]> | 2019-01-11 16:30:45 +0800 |
| commit | 62c57b63c66f4261410eebdd69cd2227c94379b9 (patch) | |
| tree | ea51539a51a9cf260d7aee21f94ab35fbfeea9e1 /src/HTTP_Message_Region.c | |
| parent | 211a40dad0e26edd99924e61a33a27c551c4be77 (diff) | |
绝对URI(http://)的判别方式:
1.http_infor:is_ab_uri变量
2.通过函数int is_absolute_uri(void* app_info)获取;
Diffstat (limited to 'src/HTTP_Message_Region.c')
| -rw-r--r-- | src/HTTP_Message_Region.c | 46 |
1 files changed, 30 insertions, 16 deletions
diff --git a/src/HTTP_Message_Region.c b/src/HTTP_Message_Region.c index 0fc926e..45b6f78 100644 --- a/src/HTTP_Message_Region.c +++ b/src/HTTP_Message_Region.c @@ -101,23 +101,32 @@ uchar http_doWithHost(http_parser_t* a_http, http_stream *a_http_stream, char* v FLAG_SET(a_http->flag, HTTP_FLAG_GET_URL); /*not joint URL when proxy and absolute uri*/ - if(a_http->parser.method!=HTTP_METHOD_CONNECT && (a_http->url_buf==NULL||a_http->url_buf[0]=='/')) + if(a_http->parser.method!=HTTP_METHOD_CONNECT) { - uri = (char*)dictator_malloc(thread_seq, a_http->url_buflen); - urilen = a_http->url_buflen; - memcpy(uri, a_http->url_buf, a_http->url_buflen); - if(a_http->url_buf!=NULL) dictator_free(thread_seq, a_http->url_buf); - a_http->url_buf = NULL; - a_http->url_buflen = valuelen+urilen; - a_http->url_buf = (char*)dictator_malloc(thread_seq, a_http->url_buflen); - memcpy(a_http->url_buf, value, valuelen); - memcpy(a_http->url_buf+valuelen, uri, urilen); - if(uri!=NULL) + if(a_http->url_buf==NULL||a_http->url_buf[0]=='/') { - dictator_free(thread_seq, uri); - uri = NULL; - } - } + uri = (char*)dictator_malloc(thread_seq, a_http->url_buflen); + urilen = a_http->url_buflen; + memcpy(uri, a_http->url_buf, a_http->url_buflen); + if(a_http->url_buf!=NULL) dictator_free(thread_seq, a_http->url_buf); + a_http->url_buf = NULL; + a_http->url_buflen = valuelen+urilen; + a_http->url_buf = (char*)dictator_malloc(thread_seq, a_http->url_buflen); + memcpy(a_http->url_buf, value, valuelen); + memcpy(a_http->url_buf+valuelen, uri, urilen); + if(uri!=NULL) + { + dictator_free(thread_seq, uri); + uri = NULL; + } + } + /*20190111 ����URI*/ + else if(a_http->url_buf!=NULL && a_http->url_buf[0]!='/') + { + a_http->parser.is_ab_uri = 1; + } + } + a_http->parser.p_url = a_http->url_buf; a_http->parser.url_len = a_http->url_buflen; @@ -357,7 +366,12 @@ uchar http_outPutUrl(http_parser_t *a_http, struct streaminfo *a_tcp, int thread dictator_free(thread_seq, uri); uri = NULL; } - } + } + else + { + a_http->parser.is_ab_uri = 1; + } + a_http->parser.p_url = a_http->url_buf; a_http->parser.url_len = a_http->url_buflen; if(g_http_prog_para.http_log_level<=RLOG_LV_DEBUG) |
