-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
modified MIMEParser class for upload of larger files and multiple files #132
Conversation
I will take care about the remaining issues during the next days. Unfortunately I have a problem running the shell scripts for the tests in my Docker; I think this is related to fact that the shell scripts are having CRLF line endings. I will try to find a fix for this also. |
Now I changed the line endings of the shell scripts to LF and the error message of the missing interpreter "bin/bash^M" is gone and the script starts to be executed in Docker. But now I get the error message |
The CI-scripts are meant to be run outside of docker; they will start an instance of the docker-image to run the tests. |
but starting the scripts outside of Docker I can only do under Linux, right? Or is there a trick to do it under Windows also - maybe WSL? |
Yes, I'd expect WSL to work. I'd guess any bash terminal would work, such as Git-bash that comes with Git for Windows. |
unfortunately both do not work. With git bash I get the error message: |
Aww, sorry to hear that. You can ofc simply run the commands that the CI-scripts themselves run from within Docker. |
Last! :) @squonk11 :) |
@squonk11 Are you happy with the PR in its current state? I've not test run it myself, but I presume you have. |
I did quite a lot of testing with the previous version using lambda functions. This version I did not test so much. I do not expect issues with this version but before accepting the pull request maybe it would be better to do some more testing. I will try to do it over the next weekend and finally add this PR to the file CONTRIBUTORS.md. |
I didn't see any obvious issues with the code. I was thinking that we could perhaps do some automatic testing using the Linux version and curl inside docker, i.e. do actual calls to the HTTP-server. That way we get reproducability of the tests and can test a large range of cases. |
Automatic testing would be a good idea. Unfortunately I am having problems starting bash scripts from outside Docker. Is it possible to do use these scripts from inside Docker as well? How to start the HTTP-server inside Docker? Additionally I did not use curl before - but I think I could find out how to use it. |
The scripts that currently start the CI-test and builds just start a docker instance to run other scripts. The "other" scripts can all be run manually from within docker. Python might actually be a better idea than curl, as it is easier to build tests in Python than in bash. Starting the HTTP-server inside docker would require a test application built for testing the HTTP server specifically. The tests we currently have can serve the example folder with all the images, but that's not really useful in automated testing. I'm thinking that an echo server, i.e. reply back with what is received, could be a useful thing. Then we can automated sending and receiving data from a single byte up to several mega-bytes with little effort. |
So, the Python script should launch a HTTP client which sends the files to the HTTP test-server. The HTTP test-server will then echo the files back to the python script. In order to receive the echoed files the python script needs to also launch a HTTP server which will then receive the files and comapres the contents against the files sent. Is that what you have in mind? |
No, no need for a HTTP server on the Python side, that can be done over the same client socket that Python uses to send the data. So, POST some data, then receive the answer. |
Will the upload from the Python script be done via
? |
Yes, requests will most likely do the job. No there isn't. How about this:
This would allow us to test everything from 1 byte to megabytes. |
The hash will be one hash value calculated over all files to be send (in case of multiple files)? The hash value will then be returned via the HTTP response? |
Now I have the first version of the test ready. |
Yes please do that. Did you try with larger files too?
…On Fri, 12 Jun 2020, 14:21 Lothar, ***@***.***> wrote:
Now I have the first version of the test ready.
I used the StringResponse to reply with the JSON string. In Python this
string gets converted to a Python dict. The hashes of the files are then
compared to the hashes returned from the HTTP server and a success or error
message is printed.
I tested several times with the 1000 icon files and no error ocured. The
only message I see is again that the watchdog on one CPU is triggered due
to not being serviced. But the transmission still completes.
Shall I upload this as first version for discussion into this PR since it
is still open?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU2LLF4FPBN7JKSJZYWKMTRWIMUPANCNFSM4NC7UQLA>
.
|
yes, I tried also with lager files; e.g. three files: 8MB, 10MB and 1kB |
I tried to run this in as a Linux version, but that unfortunately results in a crash.
I'll have to debug this and see what goes wrong. |
Dies it crash during or after file(s) Transmission?
Am 12. Juni 2020 22:00:49 MESZ schrieb Per Malmberg <[email protected]>:
…I tried to run this in as a Linux version, but that unfortunately
results in a crash.
`[1] 31201 abort (core dumped) ./http_files_upload_test.elf`
I'll have to debug this and see what goes wrong.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#132 (comment)
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
|
As soon as transmission starts. Fist file.
…On Fri, 12 Jun 2020, 22:15 Lothar, ***@***.***> wrote:
Dies it crash during or after file(s) Transmission?
Am 12. Juni 2020 22:00:49 MESZ schrieb Per Malmberg <
***@***.***>:
>I tried to run this in as a Linux version, but that unfortunately
>results in a crash.
>
>`[1] 31201 abort (core dumped) ./http_files_upload_test.elf`
>
>I'll have to debug this and see what goes wrong.
>
>--
>You are receiving this because you were mentioned.
>Reply to this email directly or view it on GitHub:
>#132 (comment)
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU2LLAGLVOAER2XKKTOHKLRWKEFNANCNFSM4NC7UQLA>
.
|
I checked the sources again. Maybe there could be two weak points:
Are you using the secure or the insecure server for the test? |
I used the insecure server. It's most likely related to the sodium stuff, not sure why though. Adding gdb to the container right now to debug it. A static local in parse() is no good since it then is is shared between instances. |
First crash solved - sodium_init() must be called prior to using the library. Another problem that then immediately showed it self - in This clearly shows why it is beneficial to perform most of the work on a Linux system - the debugging facilities are so much better. I'll be testing this a bit and will push the changes to you branch (if I can). |
Changed free() to sodium_free(). Made static function variable into class-member to avoid collisions with multiple instances. General code review.
I'm done testing now, just waiting for the CI scripts to run locally. I see that you changed it to a local variable. I'll merge that into my local copy and push my changes to this PR. |
o.k. thanks. Then I will check again. |
Just pushed my changes, have a look. Yes, uCs are a pain to debug, which is why I made Smooth so that it would be possible to use all the cool toys available :) |
yes, great idea! |
Yes a pull should be all you need.
…On Sat, 13 Jun 2020, 18:36 Lothar, ***@***.***> wrote:
yes, great idea!
Do you know if I just have to do git pull in order to receive your
changes?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#132 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU2LLDBREEKJAD4Y62DFODRWOTKPANCNFSM4NC7UQLA>
.
|
I tested it again and it seems to work - after adjusting the url in upload.py. |
Yes, please add it to the contributions file, then I'll accept this PR. |
Merged! Thank you for your contribution @squonk11, great work. |
Thank you also to you - without your support things might have been much more difficult.
BTW: the last change to CONTRIBUTORS.md got lost somehow...
Am 13. Juni 2020 19:57:25 MESZ schrieb Per Malmberg <[email protected]>:
…Merged! Thank you for your contribution @squonk11, great work.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#132 (comment)
--
Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet.
|
Huh, how odd. I'll fix that. |
@squonk11 Dunno if the commit was advertised to you, but it was just a typo. It's fixed in master now. |
modified MIMEParser class for uploading lager files and multiple files