Skip to content

Commit 17d8a52

Browse files
committed
Remove fragment overloads in websocket APIs
1 parent 2d5da8d commit 17d8a52

File tree

5 files changed

+2
-58
lines changed

5 files changed

+2
-58
lines changed

Binaries/Debug64/run_tests.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

Binaries/Release64/run_tests.sh

Lines changed: 0 additions & 4 deletions
This file was deleted.

Release/include/cpprest/ws_msg.h

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ namespace details
7070
/// </summary>
7171
enum class websocket_message_type
7272
{
73-
text_fragment,
7473
text_message,
75-
binary_fragment,
7674
binary_message,
7775
close,
7876
ping,
@@ -137,15 +135,6 @@ class websocket_outgoing_message
137135
websocket_outgoing_message()
138136
: _m_impl(std::make_shared<details::_websocket_message>()) {}
139137

140-
/// <summary>
141-
/// Sets a UTF-8 fragment as the message body.
142-
/// </summary>
143-
/// <params>UTF-8 String containing body of the fragment.</returns>
144-
void set_utf8_fragment(std::string data)
145-
{
146-
this->_set_message(std::move(data), websocket_message_type::text_fragment);
147-
}
148-
149138
/// <summary>
150139
/// Sets a UTF-8 message as the message body.
151140
/// </summary>
@@ -155,31 +144,14 @@ class websocket_outgoing_message
155144
this->_set_message(std::move(data), websocket_message_type::text_message);
156145
}
157146

158-
/// <summary>
159-
/// Sets a UTF-8 fragment as the message body.
160-
/// </summary>
161-
/// <params>casablanca input stream representing the body of the fragment.</returns>
162-
void set_utf8_fragment(concurrency::streams::istream istream, size_t len)
163-
{
164-
this->_set_message(istream, len, websocket_message_type::text_fragment);
165-
}
166-
167147
/// <summary>
168148
/// Sets a UTF-8 message as the message body.
169149
/// </summary>
170-
/// <params>casablanca input stream representing the body of the fragment.</returns>
150+
/// <params>casablanca input stream representing the body of the message.</returns>
171151
void set_utf8_message(concurrency::streams::istream istream, size_t len)
172152
{
173153
this->_set_message(istream, len, websocket_message_type::text_message);
174154
}
175-
/// <summary>
176-
/// Sets a binary fragment as the message body.
177-
/// </summary>
178-
/// <params>casablanca input stream representing the body of the fragment.</returns>
179-
void set_binary_fragment(concurrency::streams::istream istream, size_t len)
180-
{
181-
this->_set_message(istream, len, websocket_message_type::binary_fragment);
182-
}
183155

184156
/// <summary>
185157
/// Sets binary data as the message body.

Release/src/websockets/client/ws_msg.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ std::string details::_websocket_message::_extract_string()
8383

8484
pplx::task<std::string> websocket_incoming_message::extract_string() const
8585
{
86-
if (_m_impl->message_type() == websocket_message_type::binary_fragment ||
87-
_m_impl->message_type() == websocket_message_type::binary_message)
86+
if (_m_impl->message_type() == websocket_message_type::binary_message)
8887
{
8988
return pplx::task_from_exception<std::string>(websocket_exception(_XPLATSTR("Invalid message type")));
9089
}

Release/tests/Functional/websockets/client/error_tests.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -148,25 +148,6 @@ TEST_FIXTURE(uri_address, connect_fail_with_receive)
148148
VERIFY_THROWS(t.get(), websocket_exception);
149149
}
150150

151-
#ifdef __cplusplus_winrt
152-
TEST_FIXTURE(uri_address, send_fragment)
153-
{
154-
std::string body("hello");
155-
test_websocket_server server;
156-
157-
server.next_message([&](test_websocket_msg msg)
158-
{
159-
websocket_asserts::assert_message_equals(msg, body, test_websocket_message_type::WEB_SOCKET_UTF8_FRAGMENT_TYPE);
160-
});
161-
websocket_client client(m_uri);
162-
client.connect().wait();
163-
164-
websocket_outgoing_message msg;
165-
msg.set_utf8_fragment(body);
166-
VERIFY_THROWS(client.send(msg).wait(), websocket_exception);
167-
}
168-
#endif
169-
170151
} // SUITE(error_tests)
171152

172153
}}}}

0 commit comments

Comments
 (0)