projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2ff8e6
)
* don't call the context getter to frequent.
author
Wilfried Göesgens
<willi@citadel.org>
Sat, 13 Oct 2007 15:56:27 +0000
(15:56 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Sat, 13 Oct 2007 15:56:27 +0000
(15:56 +0000)
citadel/modules/imap/imap_misc.c
patch
|
blob
|
history
diff --git
a/citadel/modules/imap/imap_misc.c
b/citadel/modules/imap/imap_misc.c
index b8e50c2aa36d52db0200c502262a48e4f1129412..671c6ce5fdc2f1c1847b3b2b78bbec4054cea25b 100644
(file)
--- a/
citadel/modules/imap/imap_misc.c
+++ b/
citadel/modules/imap/imap_misc.c
@@
-351,6
+351,7
@@
void imap_append(int num_parms, char *parms[]) {
int msgs, new;
int i;
char new_message_flags[SIZ];
int msgs, new;
int i;
char new_message_flags[SIZ];
+ struct citimap *Imap;
if (num_parms < 4) {
cprintf("%s BAD usage error\r\n", parms[0]);
if (num_parms < 4) {
cprintf("%s BAD usage error\r\n", parms[0]);
@@
-385,20
+386,21
@@
void imap_append(int num_parms, char *parms[]) {
return;
}
return;
}
+ Imap = IMAP;
imap_free_transmitted_message(); /* just in case. */
imap_free_transmitted_message(); /* just in case. */
- I
MAP
->transmitted_message = malloc(literal_length + 1);
- if (I
MAP
->transmitted_message == NULL) {
+ I
map
->transmitted_message = malloc(literal_length + 1);
+ if (I
map
->transmitted_message == NULL) {
cprintf("%s NO Cannot allocate memory.\r\n", parms[0]);
return;
}
cprintf("%s NO Cannot allocate memory.\r\n", parms[0]);
return;
}
- I
MAP
->transmitted_length = literal_length;
+ I
map
->transmitted_length = literal_length;
cprintf("+ Transmit message now.\r\n");
bytes_transferred = 0;
cprintf("+ Transmit message now.\r\n");
bytes_transferred = 0;
- ret = client_read(I
MAP
->transmitted_message, literal_length);
- I
MAP
->transmitted_message[literal_length] = 0;
+ ret = client_read(I
map
->transmitted_message, literal_length);
+ I
map
->transmitted_message[literal_length] = 0;
if (ret != 1) {
cprintf("%s NO Read failed.\r\n", parms[0]);
if (ret != 1) {
cprintf("%s NO Read failed.\r\n", parms[0]);
@@
-415,18
+417,18
@@
void imap_append(int num_parms, char *parms[]) {
lprintf(CTDL_DEBUG, "Converting CRLF to LF\n");
stripped_length = 0;
for (i=0; i<literal_length; ++i) {
lprintf(CTDL_DEBUG, "Converting CRLF to LF\n");
stripped_length = 0;
for (i=0; i<literal_length; ++i) {
- if (strncmp(&I
MAP
->transmitted_message[i], "\r\n", 2)) {
- I
MAP
->transmitted_message[stripped_length++] =
- I
MAP
->transmitted_message[i];
+ if (strncmp(&I
map
->transmitted_message[i], "\r\n", 2)) {
+ I
map
->transmitted_message[stripped_length++] =
+ I
map
->transmitted_message[i];
}
}
literal_length = stripped_length;
}
}
literal_length = stripped_length;
- I
MAP
->transmitted_message[literal_length] = 0; /* reterminate it */
+ I
map
->transmitted_message[literal_length] = 0; /* reterminate it */
lprintf(CTDL_DEBUG, "Converting message format\n");
lprintf(CTDL_DEBUG, "Converting message format\n");
- msg = convert_internet_message(I
MAP
->transmitted_message);
- I
MAP
->transmitted_message = NULL;
- I
MAP
->transmitted_length = 0;
+ msg = convert_internet_message(I
map
->transmitted_message);
+ I
map
->transmitted_message = NULL;
+ I
map
->transmitted_length = 0;
ret = imap_grabroom(roomname, parms[2], 0);
if (ret != 0) {
ret = imap_grabroom(roomname, parms[2], 0);
if (ret != 0) {
@@
-439,7
+441,7
@@
void imap_append(int num_parms, char *parms[]) {
* usergoto() formally takes us to the desired room. (If another
* folder is selected, save its name so we can return there!!!!!)
*/
* usergoto() formally takes us to the desired room. (If another
* folder is selected, save its name so we can return there!!!!!)
*/
- if (I
MAP
->selected) {
+ if (I
map
->selected) {
strcpy(savedroom, CC->room.QRname);
}
usergoto(roomname, 0, 0, &msgs, &new);
strcpy(savedroom, CC->room.QRname);
}
usergoto(roomname, 0, 0, &msgs, &new);
@@
-493,7
+495,7
@@
void imap_append(int num_parms, char *parms[]) {
* If another folder is selected, go back to that room so we can resume
* our happy day without violent explosions.
*/
* If another folder is selected, go back to that room so we can resume
* our happy day without violent explosions.
*/
- if (I
MAP
->selected) {
+ if (I
map
->selected) {
usergoto(savedroom, 0, 0, &msgs, &new);
}
usergoto(savedroom, 0, 0, &msgs, &new);
}