Skip to content
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

Portability issue in PowerPc #179

Closed
jsnavar1 opened this issue Apr 3, 2014 · 2 comments
Closed

Portability issue in PowerPc #179

jsnavar1 opened this issue Apr 3, 2014 · 2 comments

Comments

@jsnavar1
Copy link

jsnavar1 commented Apr 3, 2014

Hello,

I'm using the client on a PowerPc platform (Big Endian), but it doesn't start a session with the server (it disconnects immediately).
After inspecting the code, the problem appears to be that fragments of the responses are casted directly as integers (using the style : *(int *) (buffer + offset)), and also that integer arrays and variables are used as buffers (for example packet_buffer).

I tried to change these parts of the code, but I couldn't because they are almost everywhere: I only managed to send the first message (the nonce) of the protocol, but after the second the DC disconnects with a 4 bytes long response.

@doragasu
Copy link

doragasu commented Jun 5, 2014

I also have this problem on armv5te architecture. It works perfect on armv7 (tested on a OpenPandora console and on a XE303C12 ARM Chromebook), but fails with "Server error -404" on my armv5te based GuruPlug Server. This is the program output:

$ ./telegram -vvv
Telegram-client version 0.01-beta, Copyright (C) 2013 Vitaly Valtman
Telegram-client comes with ABSOLUTELY NO WARRANTY; for details type show_license'. This is free software, and you are welcome to redistribute it under certain conditions; typeshow_license' for details.
*** added 13 bytes of real entropy to secure random numbers seed
*** public key '(null)' loaded successfully
*** Requesting info about DC...
*** connect to 173.240.5.1:443 successful
*** outbound connection #3 becomes ready
*** INSERT: 1401986931.451025 0x40d9088 0x1a7b4
*** Sending query of size 4 to DC (173.240.5.1:443)
*** sending message with sha1 e670bee1
*** Msg_id is 6021487977052723200 0x40d9138
*** INSERT: 1401986927.451414 0x40d9138 0x28988
*** try write: fd = 3
*** Sent 74 bytes to 3
*** try read: fd = 3
*** REMOVE: 1401986931.451025 0x40d9088 0x1a7b4
*** INSERT: 1401986931.640017 0x40d9088 0x1a7b4
*** Received 5 bytes from 3
0000 01 6c fe ff ff
*** outbound rpc connection #3 : received rpc answer -404 with 4 content bytes
*** Response_len = 4
*** have 4 Response bytes
*** Server error -404
*** REMOVE: 1401986927.451414 0x40d9138 0x28988
*** Alarm
*** Alarm query 6021487977052723200
*** INSERT: 1401986933.646683 0x40d9138 0x28988
*** sending message with sha1 a5228aba
*** try write: fd = 3
*** Sent 89 bytes to 3
*** try read: fd = 3
*** REMOVE: 1401986931.640017 0x40d9088 0x1a7b4
*** INSERT: 1401986937.797165 0x40d9088 0x1a7b4
*** Received 5 bytes from 3
0000 01 6c fe ff ff
*** outbound rpc connection #3 : received rpc answer -404 with 4 content bytes
*** Response_len = 4
*** have 4 Response bytes
*** Server error -404

This error keeps repeating until you press Ctrl+C.

It would be great to increase portability...

@vysheng
Copy link
Owner

vysheng commented Sep 8, 2014

Probably no chances of making this code work on big-endian platform. There are too many places, that assume, that this is little-endian platform. Sorry. But if anybody wants too do it, I will merge changes.

@vysheng vysheng closed this as completed Sep 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants