Comments (5)
I've checked the process step by step:
-
I've got test_file5 for test
$ ls -l test_file5
-rw-rw-r-- 1 daniil daniil 425889 Sep 20 19:16 test_file5 -
run ck push remote-ck-node:: --filename=test_file5
-
got encoded end of the file at post data:
...gZHVtcCBjb21wbGV0ZQotLQoK%22%2C+%22action%22%3A+%22push%22%2C+%22cids%22%3A+%5B%5D%2C+%22out%22%3A+%22con%22%7D -
Same end of url decoded JSON (I've compared whole content as well it's the same):
"file_content_base64":"LS0KLS0gUG9zdGdy...gZHVtcCBjb21wbGV0ZQotLQoK", "action": "push", "cids": [], "out": "con"} -
I'v tried to decode manually value of provided file_content_base64
$ base64 -d file_content_base64 > file_content
base64: invalid input
$ ls -l file_content
-rw-rw-r-- 1 daniil daniil 30038 Sep 21 09:09 file_content
same size and content as pushed to /tmp/test_file5
so now I see I've got already cut encoded file content at post data marameter ck_json.
So looking into ck push function to find bug ...
from ck-crowdnode.
I've printed encoded file at ck/ck/kernel.py:
s=base64.urlsafe_b64encode(s).decode('utf8')
# my debug print out string:
print s
And got at out put
$ck push remote-ck-node:: --filename=test_file5 > ck.out
same cut encoded message already:
...c3RncmVTUUwgZGF0YWJhc2UgZHVtcCBjb21wbGV0ZQotLQoK
But file before encode completely loaded (I've got this from printed "s" value as well)
from ck-crowdnode.
I now print length of data in the crowdnode server and it's correct.
CK encodes fine - we use this encoding function in all our push/pull files including Android app, various services, etc, and it's compatible with Java implementation (I have checked that before).
HOWEVER, when implementing encoding function, I noticed that there are several standards, and there were recent enhancements to this standard, so old mime functions do not work (I saw it with Java).
You are using C lib from 2003 - I guess it's simply outdated. Can you please search for a newer one
(i.e. the one that will process CK's encoded string correctly) - I saw many discussions on internet about this standard, so I am sure there is something available... Or maybe search for compatible encode function specifically between Python and C ...
BTW, I also added tests directory with _push.sh script ...
Thanks!
from ck-crowdnode.
Yes correct. There are different base64 encoding algorithms and Python uses URL safe RFC 3548 version. I've used MIME (RFC 1421) version.
So I've fixed and checked push and pull works now.
Later I''ll try to reproduce my original problem with exact file witch does not come completely for some reason (any way it's out of scope and can be tracked separately)
from ck-crowdnode.
Yeap, it's working now! Thanks! I close this ticket!
from ck-crowdnode.
Related Issues (11)
- Create downloadables (e.g. the Windows installer) in CI HOT 5
- query CK crowdnode status from CK machine module HOT 3
- making ck-crowdnode-server available via Windows app store HOT 1
- Check the code with PVS Studio
- problem compiling with VS2017 - not urgent
- server crashes after push command HOT 2
- make this node compile and run on Windows HOT 8
- adding configuration file HOT 4
- Adding secret_key file ... HOT 3
- extra improvements HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ck-crowdnode.