Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Incorrect header created for payloads longer than 125 bytes using RFC6455 patch

オープン
#52 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
php
領域
networking

調査の方向性

まず PHP の wrap 関数を見つけ、WebSocket ヘッダーの構築方法を確認します。125 バイトを超える payload で問題を再現し、その後、クライアントが RFC6455 に従って拡張された 16 ビットおよび 64 ビットの長さを正しくデコードすることを確認します。

索引モデルが issue の本文から書いたものです。

説明

auto-migrated Priority-Medium Type-Defect
What steps will reproduce the problem?
1. Apply RFC6455 patch
2. Send a message with a payload larger than 125bytes
3. Websocket clients will not be able to correctly decode the length of the 
payload

The problem is with the wrap function not correctly implementing the payload 
length section of the web sockets standard. If the payload is longer than 
125bytes then a length of 126 or 127 bytes needs to be sent in the payload 
length section of the header and an additional 16 bit (with 126 sent in the 
length section) or 64 bit (with 127 sent in the length section) unsigned, big 
endian integer length also needs to be sent as part of the header. Here is a 
fix that works for payload lengths up to 4,294,967,295 or the maximum of a 
32-bit unsigned integer. A full implementation should be able to handle payload 
lengths up to the maximum of a 64-bit unsigned integer.

function    wrap($msg=""){
    $length=strlen($msg);
    if ($length<126)
        $header=chr(0x81).chr($length); 
    elseif ($length<65536)
        $header=chr(0x81).chr(126).pack("n",$length); 
    else
        $header=chr(0x81).chr(127).pack("N",$length); 
    $msg=$header.$msg;
    return $msg;
}


Original issue reported on code.google.com by [email protected] on 10 May 2012 at 3:04

主要言語
PHP
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

et-nik/phpwebsocket のほかの issue

et-nik/phpwebsocket の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。