Skip to content

Commit

Permalink
Fix the va_args order of http header
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Dec 3, 2023
1 parent 5ce5912 commit 9bb2097
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion fs/httpfs/httpfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ class HttpFile : public fs::VirtualReadOnlyFile {
}

void add_header(va_list args) {
common_header[va_arg(args, const char*)] = va_arg(args, const char*);
auto k = va_arg(args, const char*);
auto v = va_arg(args, const char*);
common_header[k] = v;
}

void add_url_param(va_list args) { url_param = va_arg(args, const char*); }
Expand Down
4 changes: 3 additions & 1 deletion fs/httpfs/httpfs_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ class HttpFile_v2 : public fs::VirtualReadOnlyFile {

//TODO: 这里是否需要考虑m_common_header被打爆的问题?
void add_header(va_list args) {
m_common_header.insert(va_arg(args, const char*), va_arg(args, const char*));
auto k = va_arg(args, const char*);
auto v = va_arg(args, const char*);
m_common_header.insert(k, v);
}

void add_url_param(va_list args) { m_url_param = va_arg(args, const char*); }
Expand Down

0 comments on commit 9bb2097

Please sign in to comment.