diff options
author | leo <leo@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:40 +0300 |
commit | 980edcd3304699edf9d4e4d6a656e585028e2a72 (patch) | |
tree | 139f47f3911484ae9af0eb347b1a88bd6c4bb35f /library/cpp/http/fetch/httpfsm.h | |
parent | b036a557f285146e5e35d4213e29a094ab907bcf (diff) | |
download | ydb-980edcd3304699edf9d4e4d6a656e585028e2a72.tar.gz |
Restoring authorship annotation for <leo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/fetch/httpfsm.h')
-rw-r--r-- | library/cpp/http/fetch/httpfsm.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/library/cpp/http/fetch/httpfsm.h b/library/cpp/http/fetch/httpfsm.h index c4abdcd0d2..62a27b6561 100644 --- a/library/cpp/http/fetch/httpfsm.h +++ b/library/cpp/http/fetch/httpfsm.h @@ -1,13 +1,13 @@ #pragma once - + #include "httpheader.h" -#include <util/system/maxlen.h> +#include <util/system/maxlen.h> #include <util/datetime/parser.h> - + #include <time.h> -struct THttpHeaderParser { +struct THttpHeaderParser { static constexpr int ErrFirstlineTypeMismatch = -3; static constexpr int ErrHeader = -2; static constexpr int Err = -1; @@ -16,34 +16,34 @@ struct THttpHeaderParser { static constexpr int Accepted = 2; int Execute(const void* inBuf, size_t len) { - return execute((unsigned char*)inBuf, (int)len); - } - + return execute((unsigned char*)inBuf, (int)len); + } + int Execute(TStringBuf str) { return Execute(str.data(), str.size()); } int Init(THttpHeader* h) { int ret = Init((THttpBaseHeader*)(h)); - hd = h; - hd->Init(); + hd = h; + hd->Init(); hreflangpos = hd->hreflangs; hreflangspace = HREFLANG_MAX; return ret; - } - + } + int Init(THttpAuthHeader* h) { - int ret = Init((THttpHeader*)(h)); - auth_hd = h; - return ret; - } + int ret = Init((THttpHeader*)(h)); + auth_hd = h; + return ret; + } int Init(THttpRequestHeader* h) { int ret = Init((THttpBaseHeader*)(h)); request_hd = h; request_hd->Init(); return ret; } - + THttpHeader* hd; long I; int Dc; @@ -51,7 +51,7 @@ struct THttpHeaderParser { char buf[FETCHER_URL_MAX]; size_t buflen; char* lastchar; - + const unsigned char* langstart; size_t langlen; @@ -62,10 +62,10 @@ struct THttpHeaderParser { THttpAuthHeader* auth_hd; THttpRequestHeader* request_hd; - -private: + +private: THttpBaseHeader* base_hd; - int cs; + int cs; private: int Init(THttpBaseHeader* header) { @@ -78,27 +78,27 @@ private: } int execute(unsigned char* inBuf, int len); - void init(); -}; - -struct THttpChunkParser { + void init(); +}; + +struct THttpChunkParser { int Execute(const void* inBuf, int len) { - return execute((unsigned char*)inBuf, len); - } - - int Init() { - init(); - return 0; - } - + return execute((unsigned char*)inBuf, len); + } + + int Init() { + init(); + return 0; + } + int chunk_length; char* lastchar; long I; int Dc; i64 cnt64; - -private: - int cs; + +private: + int cs; int execute(unsigned char* inBuf, int len); - void init(); -}; + void init(); +}; |