diff options
Diffstat (limited to 'codec/SMPPBodyBase.st')
-rw-r--r-- | codec/SMPPBodyBase.st | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/codec/SMPPBodyBase.st b/codec/SMPPBodyBase.st index ea68753..ca564d1 100644 --- a/codec/SMPPBodyBase.st +++ b/codec/SMPPBodyBase.st @@ -175,8 +175,15 @@ sub-classes will provide the specific bodies.'> attribute isMandatory ifTrue: [self doParse: attribute stream: aStream]. attribute isOptional - ifTrue: [^self error: 'Optional attributes not implemented!']. - ] + ifTrue: [ + | tag | + tag := aStream peek. + tag = attribute tag ifTrue: [ + aStream next. + self doParse: attribute stream: aStream]]. + ]. + + aStream atEnd ifFalse: [^self error: 'Message not consume']. ] writeOn: aMsg [ |