Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all 4845 articles
Browse latest View live

Edited Issue: http_client - boost client occasionally reports end of file instead of time-out [295]

$
0
0
Instead of getting the errc::timedout "End of file" is reported. We don't control or set this error code at all so it must have something to do with Boost underneath.

This issue is very low impact since in either case an http_exception is expected and thrown.


This happens sporadically on two of the test cases and relaxed when on Apple:

Starting test case progress_handler_tests:set_progress_handler_request_timeout...
Report ERROR:5
EC MSG:End of file
/Users/stgates/stgatesdev/Release/tests/functional/http/client/progress_handler_tests.cpp:311: error: Failure in set_progress_handler_request_timeout: CHECK_EQUAL(static_cast<int>(std::errc::timed_out), _condFound.value()) where static_cast<int>(std::errc::timed_out)=60 and _condFound.value()=53
FAILED
Test case progress_handler_tests:set_progress_handler_request_timeout FAILED

Starting test case connections_and_errors:request_timeout...
Report ERROR:5
EC MSG:End of file
/Users/stgates/stgatesdev/Release/tests/functional/http/client/connections_and_errors.cpp:138: error: Failure in request_timeout: CHECK_EQUAL(static_cast<int>(std::errc::timed_out), _condFound.value()) where static_cast<int>(std::errc::timed_out)=60 and _condFound.value()=53
FAILED
Test case connections_and_errors:request_timeout FAILED

Commented Issue: http_client - boost client occasionally reports end of file instead of time-out [295]

$
0
0
Instead of getting the errc::timedout "End of file" is reported. We don't control or set this error code at all so it must have something to do with Boost underneath.

This issue is very low impact since in either case an http_exception is expected and thrown.


This happens sporadically on two of the test cases and relaxed when on Apple:

Starting test case progress_handler_tests:set_progress_handler_request_timeout...
Report ERROR:5
EC MSG:End of file
/Users/stgates/stgatesdev/Release/tests/functional/http/client/progress_handler_tests.cpp:311: error: Failure in set_progress_handler_request_timeout: CHECK_EQUAL(static_cast<int>(std::errc::timed_out), _condFound.value()) where static_cast<int>(std::errc::timed_out)=60 and _condFound.value()=53
FAILED
Test case progress_handler_tests:set_progress_handler_request_timeout FAILED

Starting test case connections_and_errors:request_timeout...
Report ERROR:5
EC MSG:End of file
/Users/stgates/stgatesdev/Release/tests/functional/http/client/connections_and_errors.cpp:138: error: Failure in request_timeout: CHECK_EQUAL(static_cast<int>(std::errc::timed_out), _condFound.value()) where static_cast<int>(std::errc::timed_out)=60 and _condFound.value()=53
FAILED
Test case connections_and_errors:request_timeout FAILED
Comments: I've seen this happen now on our Linux machines as well. It isn't specific to OS X and must just be Boost. Still low priority.

New Post: http_listener

$
0
0
Hi Steve,

That worked. I'm using "http://*:80" and it works fine. (I always include the port number, mainly because the server will eventually not be using :80)

Thanks you helped me a lot.

TRS

Commented Feature: websocket_client - wss support on non-WinRT [255]

$
0
0
This is the largest feature we are missing in our websocket_client right now on non-WinRT platforms.
Comments: Implemented for Windows desktop in the development branch as well. Will be in 2.3.0 release.

Closed Feature: websocket_client - wss support on non-WinRT [255]

$
0
0
This is the largest feature we are missing in our websocket_client right now on non-WinRT platforms.

Updated Release: C++ Rest SDK 2.3.0

$
0
0
http_client
  • Implemented server certificate verification on Android. #242
  • Added usage of Boost ssl::context::default_workarounds for compatibility with somewhat broken servers.
  • Fixed issue with server certification verification if multiple requests are made on iOS, OS X, and Android.
  • Remove unnecessary setting of Content-Length header to zero.
  • Updated documentation for http_request default constructor and made default to HTTP GET method to avoid ambiguity. #273
  • For sending request bodies added overloads on Windows for directly working with UTF-8 strings. This saves copies and moves on all platforms.
  • Fixed several issues around timeouts and cancellation with the cross platform implementation. Also addressed several places timeouts weren't being handle properly. #280
  • Improved error messages with WinHttp based implementation to include error code and message in the what() string.
websocket_client
  • Poco is no longer used as test server for WinRT tests, Websocketpp is used in all cases. #221
  • HTTP headers for initial HTTP request can be specified now on the non-winrt implementation as well. #251
  • Added subprotocol API support. New APIs exist on websocket_client_config class. 206
  • Added an overload for set_data() which allows the user to not specify stream length. #152
  • Improved parameter passing in many locations, adding r-value references for string message data.
  • Improved error messages with websocketpp implementation.
  • Implemented 'wss' support for Android/iOS/OSX/Linux/Windows desktop. #255
http_listener
  • Initiating multiple close() calls on an http_listener no longer results in a race condition. Note: ~http_listener does invoke close(), even though the user should close it before destruction. #192
streams
  • Writing to output streams with read_to_end() will now throw an exception if it fails. #244
  • Fixed reading files larger than 4GB on Windows, if on 64bit. #161
  • Including streams.h no longer injects a specialization into std::. #125
json
  • Fixed issues around JSON library assuming the current local is "C". #118
  • Added overload when constructing json string values to indicated whether or not the string contains any characters that need to be escaped. If it is known to not, then the performance is better.
  • Fixed issue with Unicode escaping for code points over 127. #252
misc
  • run_tests.sh has been removed. The tests can be run by invoking the testrunner directly. #182
  • Reference documentation improvements.
  • Visual Studio 14 support for desktop applications. #278
  • Updated .gitignore to account for NuGet packages directory. #282
  • Added support for Windows Phone 8.1 Silverlight. #227
  • Visual Studio project files have there packages.config separated out, only pulling in the exact NuGet packages necessary for that project now. #285
  • Passwords are now stored in memory encrypted. The API web::credentials::password() has been deprecated.

New Post: update client_config on go

$
0
0
hi,
I am not sure that i use right patter, so please correct me. I am writing a library that communicates with server. In constructor i receive url and immediately create uniq_ptr<http_client> with specified URL as constructor parameter. I reuse this client for different requests by using uri_builder (is this Ok pattern?).

Later I can receive user/name and password and will want to update client_config with credentials. but _mainClient->client_config() returns const object that does not allow change.

Why? What is right way to handle this?

Thank you,
Dennis

New Post: task then() continuation among threads?

$
0
0
I wonder if a task then() call will be serialized among threads.

For example,
  auto tt = create_task([] { return xx; }
Thread A:
  tt.then([](XX xx) { xx->yy(); });
Thread B:
  tt.then([](XX xx) { xx->zz(); });
I expected zz() will be called after yy() ended (or zz then yy),

but yy() and zz() executed simultaneously.


Is task then() continuation not guaranteed among threads?

New Post: VS 2010 upload Code nested Loop issue ?

$
0
0
Hello,
i'm trying to upload some files to a Webservice. The code looks like this:

return Concurrency::streams::file_stream<unsigned char>::open_istream(L"myfile.txt").then([](pplx::task<Concurrency::streams::basic_istream<unsigned char>> previousTask) -> pplx::task<void>
{
    try
    {
        auto fileStream = previousTask.get();

        // Make HTTP request with the file stream as the body.
        web::http::client::http_client client(L"http://www.fourthcoffee.com");
        return client.request(web::http::methods::PUT, L"myfile", fileStream).then([fileStream](pplx::task<web::http::http_response> previousTask)
        {
            fileStream.close();

            std::wostringstream ss;
            try
            {
                auto response = previousTask.get();
                ss << L"Server returned returned status code " << response.status_code() << L"." << std::endl;
            }
            catch (const web::http::http_exception& e)
            {
                ss << e.what() << std::endl;
            }
            std::wcout << ss.str();
        });
    }
    catch (const std::system_error& e)
    {
        std::wostringstream ss;
        ss << e.what() << std::endl;
        std::wcout << ss.str();
    }
}).wait();
Error:
no suitable user-defined conversion from "pplx::task<pplx::details::_BadContinuationParamType>" to "pplx::task<void>" exists

It would be nice if anyone has a suggestion.

Thanks.
Oliver

New Post: Segmentation fault on compile without makefile

$
0
0
The sample in ~/casablanca/Release/build.release/Binaries works fine, but if I try compile it -> Segmentation fault.
where an error?
  1. g++ -std=c++11 -I/home/berkut/casablanca/Release/include -c bingrequest.cpp
    result: bingrequest.o
  2. g++ -o bingrequest bingrequest.o -Wl,-rpath,/home/berkut/casablanca/Release/build.release/Binaries/ /home/berkut/casablanca/Release/build.release/Binaries/libcpprest.so /home/berkut/casablanca/Release/build.release/Binaries/libcommon_utilities.so -lboost_system
  3. ./bingrequest office res.txt
    Segmentation fault.

ldd bingrequest:

    linux-gate.so.1 (0xb7765000)
    libcpprest.so.2.2 => /home/berkut/casablanca/Release/build.release/Binaries/libcpprest.so.2.2 (0xb7541000)
    libcommon_utilities.so => /home/berkut/casablanca/Release/build.release/Binaries/libcommon_utilities.so (0xb753f000)
    libboost_system.so.1.55.0 => /usr/lib/i386-linux-gnu/libboost_system.so.1.55.0 (0xb752f000)
    libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xb743d000)
    libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xb73f8000)
    libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb73db000)
    libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7269000)
    libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb724d000)
    libboost_thread.so.1.55.0 => /usr/lib/i386-linux-gnu/libboost_thread.so.1.55.0 (0xb7235000)
    libboost_chrono.so.1.55.0 => /usr/lib/i386-linux-gnu/libboost_chrono.so.1.55.0 (0xb722d000)
    libboost_locale.so.1.55.0 => /usr/lib/i386-linux-gnu/libboost_locale.so.1.55.0 (0xb7153000)
    libboost_random.so.1.55.0 => /usr/lib/i386-linux-gnu/libboost_random.so.1.55.0 (0xb714f000)
    libssl.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libssl.so.1.0.0 (0xb70f0000)
    libcrypto.so.1.0.0 => /usr/lib/i386-linux-gnu/i686/cmov/libcrypto.so.1.0.0 (0xb6f25000)
    /lib/ld-linux.so.2 (0xb7766000)
    libunittestpp.so => /home/berkut/casablanca/Release/build.release/Binaries/libunittestpp.so (0xb6f11000)
    librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb6f08000)
    libicuuc.so.52 => /usr/lib/i386-linux-gnu/libicuuc.so.52 (0xb6d85000)
    libicui18n.so.52 => /usr/lib/i386-linux-gnu/libicui18n.so.52 (0xb6b60000)
    libicudata.so.52 => /usr/lib/i386-linux-gnu/libicudata.so.52 (0xb54f3000)
    libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xb54ee000)

strace

berkut@Debian-70-wheezy-32-minimal:~/casablanca/Release/samples/BingRequest$ strace http://pastebin.com/2vgXY4jb

New Post: Instructions for Building on iOS seem to use a beta version of boost

$
0
0
Hi Leslie,

Yes if you don't provide the Boost sources as a tar, like you've done, the boostoniphone repository that we are using will update and pull the sources from Boost github, using the master branch. The master branch on Boost gets updated more often than just at releases. I have a change, that I'm going to check in shortly that patches boostoniphone to be fixed on using the Boost 1.56 release.

I'll update here once it is checked in.

Thanks,
Steve

New Post: update client_config on go

$
0
0
Hi Dennis,

Reusing http_client for different requests to different URIs - yes this is ok as long as they all share the same host name. For example you could construct the http_client with http://www.myserver.com and then make requests to different paths, hitting http://www.myserver.com/path1 and http://www.myserver.com/path2 for example.

The http_client configuration isn't mutable because the setting specified are used when connecting the client, they can't be updated after the connection is established. You have two options. One is don't create the http_client instance until you actually have the credentials. Another is use a second different http_client with your credentials.

Steve

Commented Issue: websocket_client - handle error case if getting data from messagereceivedevent fails [156]

$
0
0
In Websocket messagereceived event, sometimes fetching the datareader can throw an exception. In that instead of ignoring the error, return a message to the user and let the content_ready/extract_string API fail.

Affects winrt websocket_client.
Comments: Duplicate of http://casablanca.codeplex.com/workitem/181.

Closed Issue: websocket_client - handle error case if getting data from messagereceivedevent fails [156]

$
0
0
In Websocket messagereceived event, sometimes fetching the datareader can throw an exception. In that instead of ignoring the error, return a message to the user and let the content_ready/extract_string API fail.

Affects winrt websocket_client.

New Post: task then() continuation among threads?

$
0
0
Hi sunghun,

Yes what you have noticed is correct about zz() and yy() being executed simultaneously. We fully intended it to function that way. If you want them to be serialized you could setup the task continuations as such. With something like the following:
auto tt = create_task([] { return xx; });
auto threadA = tt.then([](XX xx) { xx->yy(); return xx; });
auto threadB = threadA.then([](XX xx) { xx->zz(); });
Another option of course is you can always implement your own synchronization, with a lock for example, to only allow one of them to execute at once.

For more about programming with tasks I also recommend you take a look here.

Steve

Reviewed: Casablanca 0.5 (Okt 31, 2014)

$
0
0
Rated 5 Stars (out of 5) - tiooto fefy<fa

New Post: OpenSSL in Windows?

$
0
0
Hi,

I got the latest from the development branch and after compiling (using the vs solution) with vs 2013 I see that OpenSSL is refereed inside cpprest120D_2_2.dll.

So are you moving to use openssl in windows?

Thanks,

G.

New Post: OpenSSL in Windows?

$
0
0
Hi G,

We're using openssl on windows desktop to implement secure websockets. Windows Store & Phone applications will still be using straight WinRT.

roschuma

New Post: task then() continuation among threads?

New Post: OpenSSL in Windows?

$
0
0
The issue is that this increased the # of DLL to be deployed by 2 or by 4 if one does 32 and 64 bit...

Is there a way to compile Casablanca to statically link the OpenSSL into the cpprest DLL? The size will increase but we do not have to deploy so many DLLs.

Thanks,

G.
Viewing all 4845 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>