diff options
| author | Ken Raeburn | 2005-07-13 21:47:54 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2005-07-13 21:47:54 +0000 |
| commit | ec641d50562aaa11a1c23edce1ebeaf8eca3072b (patch) | |
| tree | 5c8326c43cde2db4363916601d76878f16998365 | |
| parent | 2af9d87984266d08940e92158cf433a0b02beaa8 (diff) | |
| download | emacs-ec641d50562aaa11a1c23edce1ebeaf8eca3072b.tar.gz emacs-ec641d50562aaa11a1c23edce1ebeaf8eca3072b.zip | |
Don't include des.h (or variants thereof); krb.h will do it.
(sendline): Add the \r\n to the line in a temporary buffer, and write it all at
once.
| -rw-r--r-- | lib-src/ChangeLog | 7 | ||||
| -rw-r--r-- | lib-src/pop.c | 35 |
2 files changed, 25 insertions, 17 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index bd6949c799c..dd4dc62a562 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2005-07-13 Ken Raeburn <raeburn@gnu.org> | ||
| 2 | |||
| 3 | * pop.c: Don't include des.h (or variants thereof); krb.h will do | ||
| 4 | it. | ||
| 5 | (sendline): Add the \r\n to the line in a temporary buffer, and | ||
| 6 | write it all at once. | ||
| 7 | |||
| 1 | 2005-07-04 Lute Kamstra <lute@gnu.org> | 8 | 2005-07-04 Lute Kamstra <lute@gnu.org> |
| 2 | 9 | ||
| 3 | Update FSF's address in GPL notices. | 10 | Update FSF's address in GPL notices. |
diff --git a/lib-src/pop.c b/lib-src/pop.c index 9a85ba3746c..30a4233d417 100644 --- a/lib-src/pop.c +++ b/lib-src/pop.c | |||
| @@ -76,17 +76,6 @@ extern struct servent *hes_getservbyname (/* char *, char * */); | |||
| 76 | # ifdef HAVE_KRB5_H | 76 | # ifdef HAVE_KRB5_H |
| 77 | # include <krb5.h> | 77 | # include <krb5.h> |
| 78 | # endif | 78 | # endif |
| 79 | # ifdef HAVE_DES_H | ||
| 80 | # include <des.h> | ||
| 81 | # else | ||
| 82 | # ifdef HAVE_KERBEROSIV_DES_H | ||
| 83 | # include <kerberosIV/des.h> | ||
| 84 | # else | ||
| 85 | # ifdef HAVE_KERBEROS_DES_H | ||
| 86 | # include <kerberos/des.h> | ||
| 87 | # endif | ||
| 88 | # endif | ||
| 89 | # endif | ||
| 90 | # ifdef HAVE_KRB_H | 79 | # ifdef HAVE_KRB_H |
| 91 | # include <krb.h> | 80 | # include <krb.h> |
| 92 | # else | 81 | # else |
| @@ -1403,12 +1392,24 @@ sendline (server, line) | |||
| 1403 | { | 1392 | { |
| 1404 | #define SENDLINE_ERROR "Error writing to POP server: " | 1393 | #define SENDLINE_ERROR "Error writing to POP server: " |
| 1405 | int ret; | 1394 | int ret; |
| 1406 | 1395 | char *buf; | |
| 1407 | ret = fullwrite (server->file, line, strlen (line)); | 1396 | |
| 1408 | if (ret >= 0) | 1397 | /* Combine the string and the CR-LF into one buffer. Otherwise, two |
| 1409 | { /* 0 indicates that a blank line was written */ | 1398 | reasonable network stack optimizations, Nagle's algorithm and |
| 1410 | ret = fullwrite (server->file, "\r\n", 2); | 1399 | delayed acks, combine to delay us a fraction of a second on every |
| 1411 | } | 1400 | message we send. (Movemail writes line without \r\n, client |
| 1401 | kernel sends packet, server kernel delays the ack to see if it | ||
| 1402 | can combine it with data, movemail writes \r\n, client kernel | ||
| 1403 | waits because it has unacked data already in its outgoing queue, | ||
| 1404 | client kernel eventually times out and sends.) | ||
| 1405 | |||
| 1406 | This can be something like 0.2s per command, which can add up | ||
| 1407 | over a few dozen messages, and is a big chunk of the time we | ||
| 1408 | spend fetching mail from a server close by. */ | ||
| 1409 | buf = alloca (strlen (line) + 3); | ||
| 1410 | strcpy (buf, line); | ||
| 1411 | strcat (buf, "\r\n"); | ||
| 1412 | ret = fullwrite (server->file, buf, strlen (buf)); | ||
| 1412 | 1413 | ||
| 1413 | if (ret < 0) | 1414 | if (ret < 0) |
| 1414 | { | 1415 | { |