Skip to content

Commit

Permalink
update time due to rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
HJLebbink committed Mar 18, 2024
1 parent 5069c55 commit 13609c1
Show file tree
Hide file tree
Showing 13 changed files with 33 additions and 29 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.sh test eol=lf
1 change: 0 additions & 1 deletion include/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#define _MINIO_S3_ARGS_H

#include <functional>
#include <iosfwd>
#include <list>
#include <map>
#include <string>
Expand Down
4 changes: 2 additions & 2 deletions include/credentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ struct Credentials {

Credentials(error::Error err, std::string&& access_key,
std::string&& secret_key, std::string&& session_token,
utils::Time expiration)
utils::UtcTime expiration)
: err(err),
access_key(std::move(access_key)),
secret_key(std::move(secret_key)),
session_token(std::move(session_token)),
expiration(expiration) {}
expiration(std::move(expiration)) {}

~Credentials() = default;

Expand Down
7 changes: 4 additions & 3 deletions include/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
#ifndef _MINIO_ERROR_H
#define _MINIO_ERROR_H

#include <iosfwd>
#include <ostream>
#include <string>
#include <type_traits>

namespace minio {
namespace error {
Expand All @@ -32,9 +33,9 @@ class Error {
Error(const Error&) = default;
Error& operator=(const Error&) = default;

Error(Error&& v) : msg_(std::move(v.msg_)) {}
Error(Error&& v) noexcept : msg_(std::move(v.msg_)) {}

Error& operator=(Error&& v) {
Error& operator=(Error&& v) noexcept {
if (this != &v) {
msg_ = std::move(v.msg_);
}
Expand Down
5 changes: 2 additions & 3 deletions include/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

#include <exception>
#include <functional>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
#include <nlohmann/json.hpp>
#include <nlohmann/json_fwd.hpp>
#include <ostream>
#include <string>
#include <type_traits>
Expand Down Expand Up @@ -318,7 +317,7 @@ struct Bucket {
utils::UtcTime creation_date;

Bucket() = default;
Bucket(std::string&& name, utils::Time&& creation_date)
Bucket(std::string&& name, utils::UtcTime&& creation_date)
: name(std::move(name)), creation_date(std::move(creation_date)) {}
~Bucket() = default;
}; // struct Bucket
Expand Down
5 changes: 2 additions & 3 deletions include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
#define _MINIO_UTILS_H

#ifdef _WIN32
#include <Winsock2.h> // NOTE: needed for struct timeval
#include <corecrt.h>
#else
#include <pwd.h>
#endif

#include <ctime>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion src/args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <curlpp/cURLpp.hpp>
#include <exception>
#include <filesystem>
#include <iosfwd>
#include <iostream>
#include <map>
#include <nlohmann/json.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/baseclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <cstring>
#include <exception>
#include <functional>
#include <iosfwd>
#include <iostream>
#include <list>
#include <map>
Expand Down
1 change: 0 additions & 1 deletion src/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <curlpp/cURLpp.hpp>
#include <filesystem>
#include <fstream>
#include <iosfwd>
#include <list>
#include <memory>
#include <string>
Expand Down
11 changes: 6 additions & 5 deletions src/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
// limitations under the License.

#include <curl/curl.h>
#include <ws2def.h> // NOTE needed for AF_INET6
#include <ws2ipdef.h> // NOTE needed for sockaddr_in6

#include <curlpp/Easy.hpp>
#include <curlpp/Exception.hpp>
Expand All @@ -36,6 +34,9 @@

#ifdef _WIN32
#include <ws2tcpip.h>
#include <ws2def.h> // NOTE needed for AF_INET6
#include <ws2ipdef.h> // NOTE needed for sockaddr_in6
#include <WinSock2.h>
#else
#include <arpa/inet.h>
#endif
Expand Down Expand Up @@ -397,9 +398,9 @@ minio::http::Response minio::http::Request::execute() {
while (!requests.perform(&left)) {
}
while (left) {
fd_set fdread;
fd_set fdwrite;
fd_set fdexcep;
fd_set fdread{};
fd_set fdwrite{};
fd_set fdexcep{};
int maxfd = 0;

FD_ZERO(&fdread);
Expand Down
9 changes: 6 additions & 3 deletions src/providers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
#endif

#include <INIReader.h>
#include <WS2tcpip.h>

#include <fstream>
#include <iosfwd>
#include <list>
#include <nlohmann/json.hpp>
#include <string>
#include <type_traits>
#include <iosfwd>

#ifndef _WIN32
#ifdef _WIN32
#include <WinSock2.h>
#include <ws2def.h>
#include <ws2tcpip.h>
#else
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/socket.h>
Expand Down
8 changes: 3 additions & 5 deletions src/utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@

#ifdef _WIN32
#define _CRT_SECURE_NO_WARNINGS
#include <corecrt.h>
#endif

#include "utils.h"

#include <corecrt.h>
#include <openssl/bio.h>
#include <openssl/buffer.h>
#include <openssl/crypto.h>
#include <openssl/evp.h>
#include <openssl/ossl_typ.h>
#include <sys/types.h>
#include <openssl/types.h>
#include <zconf.h>
#include <zlib.h>

Expand Down Expand Up @@ -55,6 +52,7 @@
#include <vector>

#include "error.h"
#include "utils.h"

const std::string WEEK_DAYS[] = {"Sun", "Mon", "Tue", "Wed",
"Thu", "Fri", "Sat"};
Expand Down
4 changes: 3 additions & 1 deletion tests/tests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ class Tests {
args.bucket = bucket_name_;
args.object = object_name;
minio::s3::PutObjectResponse resp = client_.PutObject(args);
if (!resp) std::runtime_error("PutObject(): " + resp.Error().String());
if (!resp) {
throw std::runtime_error("PutObject(): " + resp.Error().String());
}
object_names.push_back(object_name);
}
RemoveObjects(object_names);
Expand Down

0 comments on commit 13609c1

Please sign in to comment.