mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Handle multi-line responses by ignoring all but last line.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13905 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5530b2dd9f
commit
11c1a7d67d
1 changed files with 18 additions and 1 deletions
|
@ -588,9 +588,26 @@ static NSLock *urlLock = nil;
|
|||
|
||||
if (e == nil)
|
||||
{
|
||||
NSEnumerator *enumerator;
|
||||
|
||||
text = [info objectForKey: GSTelnetTextKey];
|
||||
line = [text objectAtIndex: 0];
|
||||
// NSLog(@"Ctl: %@", text);
|
||||
/*
|
||||
* Find first reply line which is not a continuation of another.
|
||||
*/
|
||||
enumerator = [text objectEnumerator];
|
||||
while ((line = [enumerator nextObject]) != nil)
|
||||
{
|
||||
if ([line length] > 4 && [line characterAtIndex: 3] != '-')
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (line == nil)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (state == cConnect)
|
||||
{
|
||||
if ([line hasPrefix: @"2"] == YES)
|
||||
|
|
Loading…
Reference in a new issue