New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get progress in callback for HTTP requests #8604
Conversation
@@ -855,8 +857,6 @@ if (sock_res != dmSocket::RESULT_OK)\ | |||
r = RESULT_OK; | |||
break; | |||
} | |||
|
|||
++chunk_number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused
#define JC_TEST_IMPLEMENTATION | ||
#include <jc_test/jc_test.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the test_gamesys.h in the HTTP gamesys tests
dmGameSystem::FinalizeScriptLibs(scriptlibcontext); | ||
} | ||
|
||
int main(int argc, char **argv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is here for two reasons:
- I don't want to mess the current HTTP tests up that was moved into gamesys
- I don't want to put this into the main gamesys test because it relies on a http server running, and the gamesys test is getting a bit out of hand size wise
@@ -0,0 +1,18 @@ | |||
|
|||
def do_GET(req): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to reuse the script test server, so I added a simple plugin mechanism to it
target = 'test_script', | ||
source = 'test_script.cpp test_script_private.cpp') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reuse this in the gamesys http tests now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lua API wise it looks good I think. Backwards compatible and easy to use. I'll let @JCash comment on the other code changes.
Added a new parameter to the option table for the
http.request
function called 'report_progress'. Whenreport_progress
is true, the amount of bytes sent and/or received for a request will be passed into the callback function:Fixes #6486