Commit 942c66b0 942c66b077093d7875229b8b33ed87028deb0a29 by Sergey Poznyakoff

Minor changes.

1 parent 1080f72c
...@@ -111,7 +111,7 @@ static char * ...@@ -111,7 +111,7 @@ static char *
111 _url_path_index (const char *spooldir, const char *iuser, int index_depth) 111 _url_path_index (const char *spooldir, const char *iuser, int index_depth)
112 { 112 {
113 const unsigned char* user = (const unsigned char*) iuser; 113 const unsigned char* user = (const unsigned char*) iuser;
114 int i, ulen = strlen (user); 114 int i, ulen = strlen (iuser);
115 char *mbox, *p; 115 char *mbox, *p;
116 116
117 if (ulen == 0) 117 if (ulen == 0)
...@@ -131,7 +131,7 @@ _url_path_index (const char *spooldir, const char *iuser, int index_depth) ...@@ -131,7 +131,7 @@ _url_path_index (const char *spooldir, const char *iuser, int index_depth)
131 *p++ = transtab[ user[ulen-1] ]; 131 *p++ = transtab[ user[ulen-1] ];
132 } 132 }
133 *p++ = '/'; 133 *p++ = '/';
134 strcpy (p, user); 134 strcpy (p, iuser);
135 return mbox; 135 return mbox;
136 } 136 }
137 137
...@@ -140,7 +140,7 @@ static char * ...@@ -140,7 +140,7 @@ static char *
140 _url_path_rev_index (const char *spooldir, const char *iuser, int index_depth) 140 _url_path_rev_index (const char *spooldir, const char *iuser, int index_depth)
141 { 141 {
142 const unsigned char* user = (const unsigned char*) iuser; 142 const unsigned char* user = (const unsigned char*) iuser;
143 int i, ulen = strlen (user); 143 int i, ulen = strlen (iuser);
144 char *mbox, *p; 144 char *mbox, *p;
145 145
146 if (ulen == 0) 146 if (ulen == 0)
...@@ -160,7 +160,7 @@ _url_path_rev_index (const char *spooldir, const char *iuser, int index_depth) ...@@ -160,7 +160,7 @@ _url_path_rev_index (const char *spooldir, const char *iuser, int index_depth)
160 *p++ = transtab[ user[0] ]; 160 *p++ = transtab[ user[0] ];
161 } 161 }
162 *p++ = '/'; 162 *p++ = '/';
163 strcpy (p, user); 163 strcpy (p, iuser);
164 return mbox; 164 return mbox;
165 } 165 }
166 166
......
...@@ -626,7 +626,7 @@ message_get_uidl (message_t msg, char *buffer, size_t buflen, size_t *pwriten) ...@@ -626,7 +626,7 @@ message_get_uidl (message_t msg, char *buffer, size_t buflen, size_t *pwriten)
626 while (stream_read (stream, buf, sizeof (buf), offset, &n) == 0 626 while (stream_read (stream, buf, sizeof (buf), offset, &n) == 0
627 && n > 0) 627 && n > 0)
628 { 628 {
629 MD5Update (&md5context, buf, n); 629 MD5Update (&md5context, (unsigned char*)buf, n);
630 offset += n; 630 offset += n;
631 } 631 }
632 MD5Final (md5digest, &md5context); 632 MD5Final (md5digest, &md5context);
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
33 #include <mailutils/errno.h> 33 #include <mailutils/errno.h>
34 #include <mailutils/mailbox.h> 34 #include <mailutils/mailbox.h>
35 #include <mailutils/registrar.h> 35 #include <mailutils/registrar.h>
36 #include <mailutils/url.h>
36 37
37 #include <folder0.h> 38 #include <folder0.h>
38 #include "nntp0.h" 39 #include "nntp0.h"
...@@ -64,7 +65,6 @@ static int nntp_folder_list __P ((folder_t folder, const char *ref, const ch ...@@ -64,7 +65,6 @@ static int nntp_folder_list __P ((folder_t folder, const char *ref, const ch
64 int 65 int
65 _nntp_folder_init (folder_t folder) 66 _nntp_folder_init (folder_t folder)
66 { 67 {
67 int status;
68 f_nntp_t f_nntp; 68 f_nntp_t f_nntp;
69 69
70 f_nntp = folder->data = calloc (1, sizeof (*f_nntp)); 70 f_nntp = folder->data = calloc (1, sizeof (*f_nntp));
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
51 #include <mailutils/observer.h> 51 #include <mailutils/observer.h>
52 #include <mailutils/property.h> 52 #include <mailutils/property.h>
53 #include <mailutils/stream.h> 53 #include <mailutils/stream.h>
54 #include <mailutils/iterator.h>
54 #include <mailutils/url.h> 55 #include <mailutils/url.h>
55 #include <mailutils/nntp.h> 56 #include <mailutils/nntp.h>
56 57
...@@ -66,16 +67,20 @@ static int nntp_mailbox_close __P ((mailbox_t)); ...@@ -66,16 +67,20 @@ static int nntp_mailbox_close __P ((mailbox_t));
66 static int nntp_mailbox_get_message __P ((mailbox_t, size_t, message_t *)); 67 static int nntp_mailbox_get_message __P ((mailbox_t, size_t, message_t *));
67 static int nntp_mailbox_messages_count __P ((mailbox_t, size_t *)); 68 static int nntp_mailbox_messages_count __P ((mailbox_t, size_t *));
68 static int nntp_mailbox_scan __P ((mailbox_t, size_t, size_t *)); 69 static int nntp_mailbox_scan __P ((mailbox_t, size_t, size_t *));
69 static int nntp_mailbox_get_size __P ((mailbox_t, off_t *)); 70 /* FIXME
71 static int nntp_mailbox_get_size __P ((mailbox_t, off_t *)); */
70 72
71 static int nntp_message_get_transport2 __P ((stream_t, mu_transport_t *, mu_transport_t *)); 73 static int nntp_message_get_transport2 __P ((stream_t, mu_transport_t *, mu_transport_t *));
72 static int nntp_message_read __P ((stream_t, char *, size_t, off_t, size_t *)); 74 static int nntp_message_read __P ((stream_t, char *, size_t, off_t, size_t *));
73 static int nntp_message_size __P ((message_t, size_t *)); 75 static int nntp_message_size __P ((message_t, size_t *));
74 static int nntp_message_line __P ((message_t, size_t *)); 76 /* FIXME
77 static int nntp_message_line __P ((message_t, size_t *)); */
75 static int nntp_message_uidl __P ((message_t, char *, size_t, size_t *)); 78 static int nntp_message_uidl __P ((message_t, char *, size_t, size_t *));
76 static int nntp_message_uid __P ((message_t, size_t *)); 79 static int nntp_message_uid __P ((message_t, size_t *));
77 80
78 static int nntp_header_get_transport2 __P ((header_t, char *, size_t, off_t, size_t *)); 81 /* FIXME
82 static int nntp_header_get_transport2 __P ((header_t, char *,
83 size_t, off_t, size_t *)); */
79 static int nntp_header_fill __P ((header_t, char *, size_t, off_t, size_t *)); 84 static int nntp_header_fill __P ((header_t, char *, size_t, off_t, size_t *));
80 85
81 static int nntp_body_get_transport2 __P ((stream_t, mu_transport_t *, mu_transport_t *)); 86 static int nntp_body_get_transport2 __P ((stream_t, mu_transport_t *, mu_transport_t *));
...@@ -198,7 +203,6 @@ nntp_mailbox_open (mailbox_t mbox, int flags) ...@@ -198,7 +203,6 @@ nntp_mailbox_open (mailbox_t mbox, int flags)
198 int status = 0; 203 int status = 0;
199 m_nntp_t m_nntp = mbox->data; 204 m_nntp_t m_nntp = mbox->data;
200 f_nntp_t f_nntp = m_nntp->f_nntp; 205 f_nntp_t f_nntp = m_nntp->f_nntp;
201 folder_t folder = f_nntp->folder;
202 iterator_t iterator; 206 iterator_t iterator;
203 207
204 /* m_nntp must have been created during mailbox initialization. */ 208 /* m_nntp must have been created during mailbox initialization. */
...@@ -273,7 +277,6 @@ static int ...@@ -273,7 +277,6 @@ static int
273 nntp_mailbox_get_message (mailbox_t mbox, size_t msgno, message_t *pmsg) 277 nntp_mailbox_get_message (mailbox_t mbox, size_t msgno, message_t *pmsg)
274 { 278 {
275 m_nntp_t m_nntp = mbox->data; 279 m_nntp_t m_nntp = mbox->data;
276 f_nntp_t f_nntp = m_nntp->f_nntp;
277 msg_nntp_t msg_nntp; 280 msg_nntp_t msg_nntp;
278 message_t msg = NULL; 281 message_t msg = NULL;
279 int status; 282 int status;
...@@ -421,7 +424,7 @@ nntp_mailbox_messages_count (mailbox_t mbox, size_t *pcount) ...@@ -421,7 +424,7 @@ nntp_mailbox_messages_count (mailbox_t mbox, size_t *pcount)
421 return status; 424 return status;
422 } 425 }
423 426
424 /* Update and scanning. */ 427 /* Update and scanning. FIXME: Is not used */
425 static int 428 static int
426 nntp_is_updated (mailbox_t mbox) 429 nntp_is_updated (mailbox_t mbox)
427 { 430 {
...@@ -522,7 +525,6 @@ nntp_message_uid (message_t msg, size_t *puid) ...@@ -522,7 +525,6 @@ nntp_message_uid (message_t msg, size_t *puid)
522 { 525 {
523 msg_nntp_t msg_nntp = message_get_owner (msg); 526 msg_nntp_t msg_nntp = message_get_owner (msg);
524 m_nntp_t m_nntp = msg_nntp->m_nntp; 527 m_nntp_t m_nntp = msg_nntp->m_nntp;
525 f_nntp_t f_nntp = m_nntp->f_nntp;
526 int status; 528 int status;
527 529
528 if (puid) 530 if (puid)
...@@ -539,11 +541,11 @@ nntp_message_uid (message_t msg, size_t *puid) ...@@ -539,11 +541,11 @@ nntp_message_uid (message_t msg, size_t *puid)
539 } 541 }
540 542
541 static int 543 static int
542 nntp_message_uidl (message_t msg, char *buffer, size_t buflen, size_t *pnwriten) 544 nntp_message_uidl (message_t msg, char *buffer, size_t buflen,
545 size_t *pnwriten)
543 { 546 {
544 msg_nntp_t msg_nntp = message_get_owner (msg); 547 msg_nntp_t msg_nntp = message_get_owner (msg);
545 m_nntp_t m_nntp = msg_nntp->m_nntp; 548 m_nntp_t m_nntp = msg_nntp->m_nntp;
546 f_nntp_t f_nntp = m_nntp->f_nntp;
547 int status = 0; 549 int status = 0;
548 550
549 /* Select first. */ 551 /* Select first. */
......
...@@ -50,8 +50,6 @@ int ...@@ -50,8 +50,6 @@ int
50 mu_nntp_article_id (mu_nntp_t nntp, const char *message_id, unsigned long *pnum, char **mid, stream_t *pstream) 50 mu_nntp_article_id (mu_nntp_t nntp, const char *message_id, unsigned long *pnum, char **mid, stream_t *pstream)
51 { 51 {
52 int status; 52 int status;
53 unsigned long dummy = 0;
54 char *buf;
55 53
56 if (nntp == NULL) 54 if (nntp == NULL)
57 return EINVAL; 55 return EINVAL;
......
...@@ -64,7 +64,6 @@ mu_nntp_connect (mu_nntp_t nntp) ...@@ -64,7 +64,6 @@ mu_nntp_connect (mu_nntp_t nntp)
64 { 64 {
65 size_t len = 0; 65 size_t len = 0;
66 int code; 66 int code;
67 char *right, *left;
68 status = mu_nntp_response (nntp, NULL, 0, &len); 67 status = mu_nntp_response (nntp, NULL, 0, &len);
69 MU_NNTP_CHECK_EAGAIN (nntp, status); 68 MU_NNTP_CHECK_EAGAIN (nntp, status);
70 mu_nntp_debug_ack (nntp); 69 mu_nntp_debug_ack (nntp);
......
...@@ -32,8 +32,6 @@ mu_nntp_date (mu_nntp_t nntp, unsigned int *year, unsigned int *month, unsigned ...@@ -32,8 +32,6 @@ mu_nntp_date (mu_nntp_t nntp, unsigned int *year, unsigned int *month, unsigned
32 unsigned int *hour, unsigned int *min, unsigned int *sec) 32 unsigned int *hour, unsigned int *min, unsigned int *sec)
33 { 33 {
34 int status; 34 int status;
35 unsigned long dummy = 0;
36 char *buf;
37 35
38 if (nntp == NULL) 36 if (nntp == NULL)
39 return EINVAL; 37 return EINVAL;
...@@ -81,7 +79,6 @@ mu_nntp_parse_date (mu_nntp_t nntp, int code, unsigned int *year, unsigned int * ...@@ -81,7 +79,6 @@ mu_nntp_parse_date (mu_nntp_t nntp, int code, unsigned int *year, unsigned int *
81 unsigned int *hour, unsigned int *min, unsigned int *sec) 79 unsigned int *hour, unsigned int *min, unsigned int *sec)
82 { 80 {
83 unsigned int dummy = 0; 81 unsigned int dummy = 0;
84 char *buf;
85 char format[32]; 82 char format[32];
86 83
87 if (year == NULL) 84 if (year == NULL)
......
...@@ -50,8 +50,6 @@ int ...@@ -50,8 +50,6 @@ int
50 mu_nntp_head_id (mu_nntp_t nntp, const char *message_id, unsigned long *pnum, char **mid, stream_t *pstream) 50 mu_nntp_head_id (mu_nntp_t nntp, const char *message_id, unsigned long *pnum, char **mid, stream_t *pstream)
51 { 51 {
52 int status; 52 int status;
53 unsigned long dummy = 0;
54 char *buf;
55 53
56 if (nntp == NULL) 54 if (nntp == NULL)
57 return EINVAL; 55 return EINVAL;
......
...@@ -29,8 +29,6 @@ int ...@@ -29,8 +29,6 @@ int
29 mu_nntp_ihave (mu_nntp_t nntp, const char *mid, stream_t stream) 29 mu_nntp_ihave (mu_nntp_t nntp, const char *mid, stream_t stream)
30 { 30 {
31 int status; 31 int status;
32 unsigned long dummy = 0;
33 char *buf;
34 32
35 if (nntp == NULL) 33 if (nntp == NULL)
36 return EINVAL; 34 return EINVAL;
......
...@@ -29,8 +29,6 @@ int ...@@ -29,8 +29,6 @@ int
29 mu_nntp_post (mu_nntp_t nntp, stream_t stream) 29 mu_nntp_post (mu_nntp_t nntp, stream_t stream)
30 { 30 {
31 int status; 31 int status;
32 unsigned long dummy = 0;
33 char *buf;
34 32
35 if (nntp == NULL) 33 if (nntp == NULL)
36 return EINVAL; 34 return EINVAL;
......