Comments (10)
I'm not sure I understand the gist. Those are my tests, but I don't see that my tests are doing anything with testing out powers of 2. For instance, in the first broken test, websocket-encode-frame, I just test out encoding strings of length 200 and 7000. But your test seems to be doing something else. Am I missing something?
Also, the error with parsing 4294967296 seems plausible, at least when byte-compiling. I'll fix that somehow.
from emacs-websocket.
I think you can see that some integer is overflowing in the websocket-to-bytes
test. Don't you think overflow can break some test cases, because you are using a big number which cannot represented in the integer object?
In Emacs 23.1:
Test websocket-to-bytes condition:
(ert-test-failed
((should
(equal 70000
(websocket-get-bytes ... 8)))
:form
(equal 70000 -300647710720000.0)
:value nil :explanation
(different-types 70000 -300647710720000.0)))
In Emacs 24.1:
Test websocket-to-bytes condition:
(wrong-type-argument integerp 1.6298145055770874e-05)
BTW, these difference is maybe from this change in 23.2:
* Incompatible Lisp Changes in Emacs 23.2
** The Lisp reader turns integers that are too large/small into floats.
For instance, on machines where `536870911' is the largest integer,
reading `536870912' gives the floating-point object `536870912.0'.
This change only concerns the Lisp reader; it does not affect how
actual integer objects overflow.
-- http://www.gnu.org/software/emacs/NEWS.23.2 (via http://stackoverflow.com/questions/2975653)
from emacs-websocket.
That's really interesting, thanks for finding that issue. Yeah, I understand the issue, just not that gist. I'm working on replacing things with calc in appropriate places. It will slow some things down, but hopefully sending packets that are longer than ~4GB long is going to rare.
from emacs-websocket.
Thanks!
from emacs-websocket.
Should be fixed in cf885f0. Since I can't reproduce the issue, please re-open this bug if it does not fix the issue.
from emacs-websocket.
...Amazing. I literally found emacs-ipython-notebook minutes before you fixed this bug.
Your fix works for me. Arch linux 32-bit, Emacs 23.1. Before, (require 'websocket)
would fail with load-with-code-conversion: Arithmetic overflow error: "4294967296"
With latest master, it works fine.
Thanks.
from emacs-websocket.
@tkf, also if you find that this fixes your users issues (such as it seems to have done for @gcr, yay), then I'll update the version number.
from emacs-websocket.
Wow, that's super fast! Unfortunately I can't access 32-bit machine now. I will tell the result when check it.
@gcr, thanks for checking and comment! I guess then it should work on my machine.
from emacs-websocket.
websocket.el
now loads without error on my 32-bit system also. At one point, I did get an Arithmetic error
while using emacs-ipython-notebook, but I have not been able to reproduce it. I will report back if I encounter more problems.
from emacs-websocket.
I tweaked test to run it in 32-bit system. Please check #19. It seems that websocket.el itself works properly.
from emacs-websocket.
Related Issues (20)
- websocket-frame-text error HOT 1
- Add release tags HOT 3
- Custom headers in handshake HOT 4
- How to handle an error occured in `websocket-outer-filter`? HOT 6
- A single message ws.send(data); comes in as two messages HOT 5
- Speed feedback HOT 10
- Randomly losing connections under emacs-ipython-notebook with version 1.11 HOT 5
- Error (websocket): in callback `on-message': JSON readtable error HOT 4
- Setting case-fold-search to nil results "Incorrect handhake from websocket" error HOT 7
- declares GPL-3+, but provided full-text license is GPL-2+ HOT 3
- Please tag a 1.12 release HOT 1
- Please consider adapting websocket-functional-test.el to use ert-deftest HOT 12
- TLSv1.3 HOT 1
- Branch rename breaks package installation HOT 6
- websocket-test.el: βfletβ is an obsolete macro (as of [emacs] 24.3) HOT 3
- websocket-to-bytes signal type error HOT 8
- Support connecting through proxies HOT 7
- infinite failure loop - emacs locked up HOT 18
- error 403 with ein over proxy HOT 14
- Push to ELPA? HOT 3
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 emacs-websocket.