Issue with NetConf : ArgumentOutOfRangeException
Personne n'a encore pris cette issue.
- Langage dominant
- C#
- Étoiles
- 4.4k
- Forks
- 993
- Merge moyen
- 9 j 21 h
- PR mergées (30 j)
- 1
Description
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 ?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez dans NetconfSession.OnDataReceived, en vous concentrant sur l’expression régulière qui lit le marqueur #length et sur l’opération d’ajout à _rpcReply. Comparez ce framing avec la spécification NETCONF pertinente et examinez comment les chunks reçus sont fractionnés. Le travail est terminé lorsque la source du marqueur est identifiée et que l’échec out-of-range du rpc-reply signalé est résolu.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- csharp
- Domaine
- networking
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 35/100