Skip to content

Commit bc2fbde

Browse files
committed
Fixed bug issue 111. It seems there was a problem in the assignment operators where the parsing was not done correctly, causing undefined behaviour.
1 parent 51fe256 commit bc2fbde

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

include/network/uri/uri.hpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@ class BOOST_URI_DECL uri {
4545

4646
}
4747

48-
//uri(const value_type *uri)
49-
// : uri_(uri), is_valid_(false) {
50-
// parse();
51-
//}
52-
5348
uri(const string_type &uri)
5449
: uri_(uri), is_valid_(false) {
5550
parse();
@@ -69,13 +64,15 @@ class BOOST_URI_DECL uri {
6964
}
7065

7166
uri &operator = (const uri &other) {
72-
uri(other).swap(*this);
67+
uri_ = other.uri_;
68+
parse();
7369
return *this;
7470
}
7571

7672
uri &operator = (const string_type &uri_string) {
77-
uri(uri_string).swap(*this);
78-
return *this;
73+
uri_ = uri_string;
74+
parse();
75+
return *this;
7976
}
8077

8178
~uri() {

libs/network/example/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ target_link_libraries(hello_world_client
121121
cppnetlib-http-client
122122
cppnetlib-http-client-connections)
123123

124-
target_link_libraries(uri_builder ${OPENSSL_LIBRARIES})
125124
if (OPENSSL_FOUND)
125+
target_link_libraries(uri_builder ${OPENSSL_LIBRARIES})
126126
#target_link_libraries(http_client ${OPENSSL_LIBRARIES})
127127
target_link_libraries(simple_wget ${OPENSSL_LIBRARIES})
128128
target_link_libraries(atom_reader ${OPENSSL_LIBRARIES})

0 commit comments

Comments
 (0)