mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-26 02:29:20 +03:00
Added draft code for raw passthru responses
To create a JavaScript based IMAP reponse parser
This commit is contained in:
parent
e6145249fa
commit
2db8b0b9fc
1 changed files with 22 additions and 1 deletions
|
|
@ -531,7 +531,28 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$aParameters[] = $aReturnParams;
|
||||
}
|
||||
|
||||
$aReturn = $this->SendRequestGetResponse($sCmd, $aParameters)->getFoldersResult($sCmd);
|
||||
$this->SendRequest($sCommand, $aParams);
|
||||
$bPassthru = false;
|
||||
if ($bPassthru) {
|
||||
// TODO: passthru to parse response in JavaScript
|
||||
// This will reduce CPU time on server and moves it to the client
|
||||
// And can be used with the new JavaScript AbstractFetchRemote.streamPerLine(fCallback, sGetAdd)
|
||||
if (\is_resource($this->ConnectionResource())) {
|
||||
\SnappyMail\HTTP\Stream::start();
|
||||
$sEndTag = $this->getCurrentTag();
|
||||
$sLine = \fgets($this->ConnectionResource());
|
||||
do {
|
||||
echo $sLine;
|
||||
if (0 === \strpos($sLine, $sEndTag)) {
|
||||
break;
|
||||
}
|
||||
$sLine = \fgets($this->ConnectionResource());
|
||||
} while (\strlen($sLine));
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$aReturn = $this->getResponse($sCmd, $aParameters)->getFoldersResult($sCmd);
|
||||
}
|
||||
|
||||
// RFC 5464
|
||||
if (!$bIsSubscribeList && $this->IsSupported('METADATA')) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue