x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Http requests not working in plugin

I updated to 4.22, and my plugin's http requests are no longer working. The requests are never made, and never complete, with the thread stuck. It fails silently, until trying to close the client, the following error is logged repeatedly:

LogHttp: Display: Sleeping for 0.5s to wait for 1 outstanding Http requests.

This is using the FHttpModule inside of a plugin.

Any hints on what changed, or how I might fix this in 4.22?

 TSharedRef<IHttpRequest> HttpRequest = FHttpModule::Get().CreateRequest();
                 LoginUserRequests.Add(&HttpRequest.Get(), FPendingLoginUser(LocalUserNum, AccessToken));
 
                 FString FinalURL = MeURL.Replace(TEXT("`token"), *AccessToken, ESearchCase::IgnoreCase);
                 if (InProfileFields.Num() > 0)
                 {
                     FinalURL += FString::Printf(TEXT("&fields=%s"), *FString::Join(InProfileFields, TEXT(",")));
                 }
 
                 HttpRequest->OnProcessRequestComplete().BindRaw(this, &FOnlineIdentityUEtopia::MeUser_HttpRequestComplete, InCompletionDelegate);
                 HttpRequest->SetURL(FinalURL);
                 HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json"));
                 HttpRequest->SetVerb(TEXT("GET"));
 
                 HttpRequest->ProcessRequest();



VeryVerbose Logs:

     [2019.04.08-20.51.44:089][361]LogHttp: VeryVerbose: FHttpRequestImpl::OnProcessRequestComplete()
     [2019.04.08-20.52.07:643][361]LogHttp: Verbose: 000001C1258654C0: URL='https://ue4topia.appspot.com/me?access_token=XXXTRIMMEDXXX'
     [2019.04.08-20.52.07:644][361]LogHttp: Verbose: 000001C1258654C0: Verb='GET'
     [2019.04.08-20.52.07:644][361]LogHttp: Verbose: 000001C1258654C0: Custom headers are present
     [2019.04.08-20.52.07:644][361]LogHttp: Verbose: 000001C1258654C0: Payload size=0
     [2019.04.08-20.52.07:644][361]LogHttp: Verbose: 000001C1258654C0: Adding header 'Content-Type: application/json'
     [2019.04.08-20.52.07:644][361]LogHttp: Verbose: 000001C1258654C0: Adding header 'User-Agent: ProMMO/++UE4+Release-4.22-CL-0 Windows/10.0.17134.1.256.64bit'
     [2019.04.08-20.52.07:645][361]LogHttp: Verbose: 000001C1258654C0: Adding header 'Content-Length: 0'
     [2019.04.08-20.52.07:645][361]LogHttp: Verbose: 000001C1258654C0: Adding header 'Expect: '
     [2019.04.08-20.52.07:645][361]LogHttp: 000001C1258654C0: Starting GET request to URL='https://ue4topia.appspot.com/me?access_token=XXXTRIMMEDXXX'
     [2019.04.08-20.52.17:171][361]LogHttp: Verbose: 000001C1258654C0: request (easy handle:000001C131215560) has been added to threaded queue for processing
     [2019.04.08-20.52.17:172][361]LogTemp: [UETOPIA] [UMyUserWidget] OnDismissLoginWidget
     [2019.04.08-20.52.17:188][362]LogHttp: Verbose: 000001C1258654C0: request (easy handle:000001C131215560) has started threaded processing
     The thread 0x55a0 has exited with code 0 (0x0).
     [2019.04.08-20.52.17:200][362]LogHttp: VeryVerbose: 000001C1258654C0: '  Trying 172.217.11.244...'
     [2019.04.08-20.52.17:200][362]LogHttp: VeryVerbose: 000001C1258654C0: 'TCP_NODELAY set'
     [2019.04.08-20.52.17:234][362]LogHttp: VeryVerbose: 000001C1258654C0: 'Connected to ue4topia.appspot.com (172.217.11.244) port 443 (#0)'
     [2019.04.08-20.52.17:241][363]LogHttp: VeryVerbose: 000001C1258654C0: 'ALPN, offering http/1.1'
     [2019.04.08-20.52.17:241][363]LogHttp: VeryVerbose: 000001C1258654C0: 'Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH'
     [2019.04.08-20.52.17:243][363]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (5 bytes)
     [2019.04.08-20.52.17:245][363]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.3 (OUT), TLS handshake, Client hello (1):'
     [2019.04.08-20.52.17:245][363]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (512 bytes)
     [2019.04.08-20.52.17:301][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (5 bytes)
     [2019.04.08-20.52.17:301][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.3 (IN), TLS handshake, Server hello (2):'
     [2019.04.08-20.52.17:301][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (106 bytes)
     [2019.04.08-20.52.17:301][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (5 bytes)
     [2019.04.08-20.52.17:301][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (IN), TLS handshake, Certificate (11):'
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (2449 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (5 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (IN), TLS handshake, Server key exchange (12):'
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (300 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (5 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (IN), TLS handshake, Server finished (14):'
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Received SSL data (4 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (5 bytes)
     [2019.04.08-20.52.17:302][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (OUT), TLS handshake, Client key exchange (16):'
     [2019.04.08-20.52.17:303][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (37 bytes)
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (5 bytes)
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (OUT), TLS change cipher, Client hello (1):'
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (1 bytes)
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (5 bytes)
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: 'TLSv1.2 (OUT), TLS handshake, Finished (20):'
     [2019.04.08-20.52.17:305][364]LogHttp: VeryVerbose: 000001C1258654C0: Sent SSL data (16 bytes)
Product Version: UE 4.22
Tags:
more ▼

asked Apr 06 '19 at 10:04 PM in C++ Programming

avatar image

edcolmar
120 6 13 20

avatar image FreezerNick Apr 07 '19 at 03:29 PM

My plugins works fine in 4.22. Did you make the plugin yourself? Any messages in Visual Studio?

avatar image edcolmar Apr 07 '19 at 04:02 PM

I made the plugin, yes. It is based on the other online subsystem plugins, like OnlineSubsystemFacebook. This code is identical to the code in OnlineSubsystemFacebook plugin in 4.22 There are no errors or warnings in VS.

avatar image Shadowriver Apr 07 '19 at 07:01 PM

Can you provide logs from Saved/Logs when you try to run this code(trying HTTP conneciton)?

avatar image edcolmar Apr 07 '19 at 11:01 PM

There aren't any lines logged that are related to this. It just silently fails. The only log that appears is after closing the client: LogHttp: Display: Sleeping for 0.5s to wait for 1 outstanding Http requests. I placed breakpoints in this code and it is getting executed, but nothing is happening.

avatar image edcolmar Apr 08 '19 at 09:17 PM

I changed the LogHttp to VeryVerbose, and added the lines to the original question.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hi, we had found that on some systems, the HTTP thread had a seemingly infinite sleep. We think it was related to the version of Visual Studio 2017 that was installed, but we have not figured out the exact cause yet. I was never able to reproduce it and I was on Visual Studio 2017 15.9.8, and a coworker that was able to reproduce it was on Visual Studio 2017 15.9.1. Another coworker that reproduced it was on Visual Studio 2015. We found that inside of FHttpThread::Run, InnerLoopEnd seemed to be some bogus number sometimes. Our workaround is to wrap FHttpThread::Run with PRAGMA_DISABLE_OPTIMIZATION / PRAGMA_ENABLE_OPTIMIZATION.

more ▼

answered May 15 '19 at 06:57 PM

avatar image

RobCannaday STAFF
31 1 1 1

avatar image edcolmar May 16 '19 at 04:07 PM

Thanks for the response Rob. Will an upgrade to VS 2019 solve this issue?

avatar image FireJugglerPhx Jun 06 '19 at 06:37 PM

I found similar behaviour on VS 15.9.3 and this workaround also solved it for me. Occasionally on certain HTTP requests the thread would sleep indefinitely and stop sending requests.

avatar image edcolmar Jun 13 '19 at 02:10 PM

I upgraded to VS 2019 and it is working again. Thank you.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I suspect that Rob was just seeing garbage values due to compiler optimizations.

We had this same issue. Turned out to be an issue with Go's 1.1.1 TLS libraries. After putting a TLS terminating load balancer up the issue went away.

more ▼

answered May 15 '19 at 09:48 PM

avatar image

Pauljackso1
1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question