Coder Social home page Coder Social logo

Comments (5)

nnicandro avatar nnicandro commented on July 18, 2024 2

I ran into this issue as well. The server I was communicating with was closing the websocket connection due to an invalid frame being sent. It looks like encode-coding-string causes issues if used in websocket-mask that are dependent on the specific byte pattern used for the masking.

Here is a test case that will always fail when encode-coding-string is used in websocket-mask

(cl-letf ((text "{\"parent_header\":{},\"header\":{\"msg_id\":\"a2940bc8-619e-4872-97bd-4c8d6fb93017\",\"msg_type\":\"history_request\",\"version\":\"5.3\",\"username\":\"n\",\"session\":\"409cf442-74ba-462f-8183-6652503005af\",\"date\":\"2019-06-20T02:17:43.925049-0500\"},\"content\":{\"output\":false,\"raw\":false,\"hist_access_type\":\"tail\",\"n\":100},\"metadata\":{},\"buffers\":[],\"channel\":\"shell\"}")
          ((symbol-function #'websocket-genbytes)
           (lambda (&rest _) "\10\206\356\224")))
  (let ((frame (websocket-read-frame
                (websocket-encode-frame
                 (make-websocket-frame :opcode 'text
                                       :payload (encode-coding-string text 'raw-text)
                                       :completep t)
                 t))))
    (should frame)
    (should (equal (websocket-frame-payload frame) text))))

from emacs-websocket.

ahyatt avatar ahyatt commented on July 18, 2024

I'll see if I can reproduce. None of the commits recently look like they should effect connections at all, although maybe the recent change in error handling behavior caused some hidden problem to surface. Anyway, if I can reproduce it, I'll fix it.

from emacs-websocket.

ahyatt avatar ahyatt commented on July 18, 2024

According to @dickmao, #59 fixes this issue, which I've merged into head.

Can you confirm this fixes the issue? If so, I'll rev. the version to 1.11.1.

from emacs-websocket.

ahyatt avatar ahyatt commented on July 18, 2024

I've also made an addition small fix beyond the basic fix @dickmao provided in 37ef222. However, I was never able to reproduce this - any clues how I can try to reproduce this sort of thing in a functional test would help me make sure I don't break you again.

from emacs-websocket.

millejoh avatar millejoh commented on July 18, 2024

@ahyatt - thanks for the quick response. Yes, I can confirm that EIN is working again. I wish I were smart enough to come up with a good test case, but hopefully the one @dzop provided will serve as check against this happening again.

from emacs-websocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.