ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/IMAPHandler/IMAPHandler.cpp
(Generate patch)

Comparing trunk/IMAPHandler/IMAPHandler.cpp (file contents):
Revision 121 by douglas, 2003-03-31T23:08:58-08:00 vs.
Revision 122 by douglas, 2003-04-02T15:48:57-08:00

# Line 198 | Line 198 | string IMAPHandler::imap(const string& i
198                  }
199                  else
200                  {
201 <                        result += input + "\r\n";
201 >                        result += input + "\n";
202                  }
203          }
204  
# Line 229 | Line 229 | string IMAPHandler::imap(const string& i
229                  }
230                  else
231                  {
232 <                        result += input + "\r\n";
232 >                        result += input + "\n";
233                  }
234          }
235  
# Line 262 | Line 262 | string IMAPHandler::imap(const string& i
262                  }
263                  else
264                  {
265 <                        result += input + "\r\n";
265 >                        result += input + "\n";
266                  }
267          }
268  
# Line 273 | Line 273 | void IMAPHandler::putline(const string l
273   {
274          if (debug) cerr << line << "\n";
275  
276 <        sprintf(buffer, "%s\r\n", line.c_str());
276 >        istringstream lines(line);
277  
278 <        if (tls)
278 >        while (lines.good())
279          {
280 <                if (int code = SSL_write(ssl, buffer, strlen(buffer)) <= 0)
280 >                string line;
281 >
282 >                std::getline(lines, line);
283 >                sprintf(buffer, "%s\r\n", line.c_str());
284 >
285 >                if (tls)
286                  {
287 <                        error(program + ": SSL Write", code);
288 <                        exit(1);
287 >                        if (int code = SSL_write(ssl, buffer, strlen(buffer)) <= 0)
288 >                        {
289 >                                error(program + ": SSL Write", code);
290 >                                exit(1);
291 >                        }
292                  }
293 <        }
286 <        else
287 <        {
288 <                if (send(sock, buffer, strlen(buffer), 0) == SOCKET_ERROR)
293 >                else
294                  {
295 <                        error(program + ": Send");
296 <                        exit(1);
295 >                        if (send(sock, buffer, strlen(buffer), 0) == SOCKET_ERROR)
296 >                        {
297 >                                error(program + ": Send");
298 >                                exit(1);
299 >                        }
300                  }
301 +
302 +                lines.peek();
303          }
304   }
305  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines