Issue with NetConf : ArgumentOutOfRangeException

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
csharp
領域
networking

調査の方向性

NetconfSession.OnDataReceived から始め、#length マーカーを読み取る正規表現と _rpcReply の追加処理に注目してください。このフレーミングを関連する NETCONF 仕様と比較し、受信したチャンクがどのように分割されるかを調査してください。完了条件は、マーカーの出どころを特定し、報告された rpc-reply で発生する範囲外エラーを解決することです。

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

説明

When an rpc-reply message is received, this exception is thrown in NetconfSession.OnDataReceived event handler.
The cause is that the received data length is 1015 byte, and the decoded message string contains a magic number at the beginning as below:
#1585

....

This number is matched with a regex then is used to append this length of data to a stringbuilder, namely to _rpcreply object, like :

var match = Regex.Match(chunk.Substring(position), @"\n#(?<length>\d+)\n");
if (!match.Success)
{
  break;
}
var fractionLength = Convert.ToInt32(match.Groups["length"].Value);
_rpcReply.Append(chunk, position + match.Index + match.Length, fractionLength);

where the value of position is the number at the beginning of the message, that is, 1585 in this example.
It is obvious that the Append operation will fail as one can't append 1585 byte from an 1015 byte length string.

What I can't figure out is where this magic number is coming from, as RFC6241 apparently does not contain such - lets call it - segment length element ? So where is it coming from, can anyone tell ?

主要言語
C#
スター
4.4k
フォーク
993
平均マージ
9日 21時間
マージ済み PR(30日)
1

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

sshnet/SSH.NET のほかの issue

sshnet/SSH.NET の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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