Comments (5)
I can reproduce this. I think I may have just fixed the client behavior, not the server behavior. This looks a bit tricky, but I'll take a look and see if I can fix it in the next week.
from emacs-websocket.
Hi @ahyatt,
I found the cause. It's actually a problem of test code. The string server received is UTF-8 byte sequence, so it has to be converted to unibyte format before we pass it to websocket-send-text function.
After I modified test code as below, the test passed successfully.
--- old.el 2016-10-22 10:44:21.210792558 +0900
+++ new.el 2016-10-22 10:43:56.826793474 +0900
@@ -5,7 +5,7 @@
:on-message (lambda (ws frame)
(message "Server received text!")
(websocket-send-text ws
- (websocket-frame-payload frame)))
+ (decode-coding-string (string-make-unibyte (websocket-frame-payload frame)) 'utf-8)))
:on-open (lambda (_websocket) "Client connection opened!")
:on-close (lambda (_websocket)
(setq wstest-closed t)))))
from emacs-websocket.
That's interesting that you solved it this way.... I looked at this yesterday and traced this down to the websocket-mask function, which incorrectly makes a string of bytes in such a way that it is interpreted as a multibyte string of what are actually unibytes. So I think working around this problem in this way may work, but shouldn't be necessary. I'll take a look tomorrow about the best way to fix it - maybe just wrapping that function in string-make-unibyte would be best.
from emacs-websocket.
Should be fixed in f7d3fb5, if you use the handy new function websocket-frame-text
, please re-open if not.
from emacs-websocket.
That's interesting that you solved it this way.... I looked at this
yesterday and traced this down to the websocket-mask function, which
incorrectly makes a string of bytes in such a way that it is interpreted as
a multibyte string of what are actually unibytes. So I think working
around this problem in this way may work, but shouldn't be necessary. I'll
take a look tomorrow about the best way to fix it.
On Fri, Oct 21, 2016 at 9:53 PM alpha22jp [email protected] wrote:
Hi @ahyatt https://github.com/ahyatt,
I found the cause. It's actually a problem of test code. The string server
received is UTF-8 byte sequence, so it has to be converted to unibyte
format before we pass it to websocket-send-text function.After I modified test code as below, the test passed successfully.
--- old.el 2016-10-22 10:44:21.210792558 +0900+++ new.el 2016-10-22 10:43:56.826793474 +0900@@ -5,7 +5,7 @@
:on-message (lambda (ws frame) (message "Server received text!") (websocket-send-text ws
(websocket-frame-payload frame)))+ (decode-coding-string (string-make-unibyte (websocket-frame-payload frame)) 'utf-8))) :on-open (lambda (_websocket) "Client connection opened!") :on-close (lambda (_websocket) (setq wstest-closed t)))))
β
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABP5LQpSYcnx1yjNLJw3lq5MWYZNRCsks5q2WyZgaJpZM4KaYFg
.
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.