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 114 by douglas, 2003-03-31T23:08:58-08:00 vs.
Revision 124 by douglas, 2003-04-02T21:13:46-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 271 | Line 271 | string IMAPHandler::imap(const string& i
271  
272   void IMAPHandler::putline(const string line)
273   {
274 <        if (debug) cerr << line << "\n";
274 >        istringstream lines(line);
275  
276 <        sprintf(buffer, "%s\r\n", line.c_str());
277 <
278 <        if (tls)
276 >        while (lines.good())
277          {
278 <                if (int code = SSL_write(ssl, buffer, strlen(buffer)) <= 0)
279 <                {
280 <                        error(program + ": SSL Write", code);
281 <                        exit(1);
278 >                string line;
279 >
280 >                std::getline(lines, line);
281 >                if (debug) cerr << line << "\n";
282 >
283 >                sprintf(buffer, "%s\r\n", line.c_str());
284 >
285 > //              for (unsigned index = 0; index < strlen(buffer); index++)
286 > //              {
287 > //                      cout << "\"" << buffer[index] << "\" = " << int(buffer[index])
288 > //                              << "\n";
289 > //              }
290 >
291 >                if (tls)
292 >                {
293 >                        if (int code = SSL_write(ssl, buffer, strlen(buffer)) <= 0)
294 >                        {
295 >                                error(program + ": SSL Write", code);
296 >                                exit(1);
297 >                        }
298                  }
299 <        }
286 <        else
287 <        {
288 <                if (send(sock, buffer, strlen(buffer), 0) == SOCKET_ERROR)
299 >                else
300                  {
301 <                        error(program + ": Send");
302 <                        exit(1);
301 >                        if (send(sock, buffer, strlen(buffer), 0) == SOCKET_ERROR)
302 >                        {
303 >                                error(program + ": Send");
304 >                                exit(1);
305 >                        }
306                  }
307 +
308 +                lines.peek();
309          }
310   }
311  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines