aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/http/fetch/httpheader.h
diff options
context:
space:
mode:
authorstanly <stanly@yandex-team.ru>2022-02-10 16:46:49 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:49 +0300
commitcde218e65dfef5ce03a48d641fd8f7913cf17b2d (patch)
treed3349caea4095825a55b5ba24fe758067b29ce6f /library/cpp/http/fetch/httpheader.h
parent9f813499b4ef585cb3c2bb93de93ef003daf4fc4 (diff)
downloadydb-cde218e65dfef5ce03a48d641fd8f7913cf17b2d.tar.gz
Restoring authorship annotation for <stanly@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/fetch/httpheader.h')
-rw-r--r--library/cpp/http/fetch/httpheader.h46
1 files changed, 23 insertions, 23 deletions
diff --git a/library/cpp/http/fetch/httpheader.h b/library/cpp/http/fetch/httpheader.h
index b2810bbd413..b2804c9689b 100644
--- a/library/cpp/http/fetch/httpheader.h
+++ b/library/cpp/http/fetch/httpheader.h
@@ -1,9 +1,9 @@
#pragma once
-#include "exthttpcodes.h"
-
+#include "exthttpcodes.h"
+
#include <library/cpp/mime/types/mime.h>
-
+
#include <util/system/defaults.h>
#include <util/system/compat.h>
#include <util/generic/string.h>
@@ -24,10 +24,10 @@ extern const i64 DEFAULT_IF_MODIFIED_SINCE; /// == -1
extern const i32 DEFAULT_MAX_AGE; /// == -1
extern const i8 DEFAULT_REQUEST_PRIORITY; /// == -1
extern const i32 DEFAULT_RESPONSE_TIMEOUT; /// == -1
-
+
#define HTTP_PREFIX "http://"
#define MAX_LANGREGION_LEN 4
-#define MAXWORD_LEN 55
+#define MAXWORD_LEN 55
enum HTTP_COMPRESSION {
HTTP_COMPRESSION_UNSET = 0,
@@ -75,7 +75,7 @@ public:
i8 compression_method;
i8 transfer_chunked;
i8 connection_closed;
- TString base;
+ TString base;
public:
void Init() {
@@ -93,7 +93,7 @@ public:
content_range_start = -1;
content_range_end = -1;
content_range_entity_length = -1;
- base.clear();
+ base.clear();
}
void Print() const {
@@ -108,19 +108,19 @@ public:
printf("content_range_start: %" PRIi64 "\n", content_range_start);
printf("content_range_end: %" PRIi64 "\n", content_range_end);
printf("content_range_entity_length: %" PRIi64 "\n", content_range_entity_length);
- printf("base: \"%s\"\n", base.c_str());
+ printf("base: \"%s\"\n", base.c_str());
printf("error: %" PRIi16 "\n", error);
}
int SetBase(const char* path,
const char* hostNamePtr = nullptr,
int hostNameLength = 0) {
- if (*path == '/') {
- base = "http://";
- base += TStringBuf(hostNamePtr, hostNameLength);
- base += path;
+ if (*path == '/') {
+ base = "http://";
+ base += TStringBuf(hostNamePtr, hostNameLength);
+ base += path;
} else {
- base = path;
+ base = path;
}
return error;
}
@@ -134,8 +134,8 @@ public:
i8 squid_error;
i8 x_robots_tag; // deprecated, use x_robots_state instead
i16 http_status;
- TString location;
- TString rel_canonical;
+ TString location;
+ TString rel_canonical;
char hreflangs[HREFLANG_MAX];
i64 retry_after;
TString x_robots_state; // 'xxxxx' format, see `library/html/zoneconf/parsefunc.cpp`
@@ -146,9 +146,9 @@ public:
accept_ranges = -1;
squid_error = 0;
x_robots_tag = 0;
- rel_canonical.clear();
+ rel_canonical.clear();
http_status = -1;
- location.clear();
+ location.clear();
hreflangs[0] = 0;
retry_after = DEFAULT_RETRY_AFTER;
x_robots_state = "xxxxx";
@@ -159,14 +159,14 @@ public:
printf("http_status: %" PRIi16 "\n", http_status);
printf("squid_error: %" PRIi8 "\n", squid_error);
printf("accept_ranges: %" PRIi8 "\n", accept_ranges);
- printf("location: \"%s\"\n", location.c_str());
+ printf("location: \"%s\"\n", location.c_str());
printf("retry_after: %" PRIi64 "\n", retry_after);
}
};
struct THttpRequestHeader: public THttpBaseHeader {
public:
- TString request_uri;
+ TString request_uri;
char host[HOST_MAX];
char from[MAXWORD_LEN];
char user_agent[MAXWORD_LEN];
@@ -186,7 +186,7 @@ public:
}
void Init() {
- request_uri.clear();
+ request_uri.clear();
host[0] = 0;
from[0] = 0;
user_agent[0] = 0;
@@ -204,7 +204,7 @@ public:
void Print() const {
THttpBaseHeader::Print();
- printf("request_uri: \"%s\"\n", request_uri.c_str());
+ printf("request_uri: \"%s\"\n", request_uri.c_str());
printf("host: \"%s\"\n", host);
printf("from: \"%s\"\n", from);
printf("user_agent: \"%s\"\n", user_agent);
@@ -231,9 +231,9 @@ public:
char* GetUrl(char* buffer, size_t size) {
if (host[0] == 0 || !strcmp(host, "")) {
- strlcpy(buffer, request_uri.c_str(), size);
+ strlcpy(buffer, request_uri.c_str(), size);
} else {
- snprintf(buffer, size, "http://%s%s", host, request_uri.c_str());
+ snprintf(buffer, size, "http://%s%s", host, request_uri.c_str());
}
return buffer;
}