Diffstat (limited to 'kmicromail/libetpan/generic/imapstorage.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libetpan/generic/imapstorage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libetpan/generic/imapstorage.c b/kmicromail/libetpan/generic/imapstorage.c index e8683d8..972b6dd 100644 --- a/kmicromail/libetpan/generic/imapstorage.c +++ b/kmicromail/libetpan/generic/imapstorage.c | |||
@@ -50,49 +50,49 @@ | |||
50 | #define IMAPS_DEFAULT_PORT 993 | 50 | #define IMAPS_DEFAULT_PORT 993 |
51 | 51 | ||
52 | static int imap_mailstorage_connect(struct mailstorage * storage); | 52 | static int imap_mailstorage_connect(struct mailstorage * storage); |
53 | static int | 53 | static int |
54 | imap_mailstorage_get_folder_session(struct mailstorage * storage, | 54 | imap_mailstorage_get_folder_session(struct mailstorage * storage, |
55 | char * pathname, mailsession ** result); | 55 | char * pathname, mailsession ** result); |
56 | static void imap_mailstorage_uninitialize(struct mailstorage * storage); | 56 | static void imap_mailstorage_uninitialize(struct mailstorage * storage); |
57 | 57 | ||
58 | static mailstorage_driver imap_mailstorage_driver = { | 58 | static mailstorage_driver imap_mailstorage_driver = { |
59 | .sto_name = "imap", | 59 | .sto_name = "imap", |
60 | .sto_connect = imap_mailstorage_connect, | 60 | .sto_connect = imap_mailstorage_connect, |
61 | .sto_get_folder_session = imap_mailstorage_get_folder_session, | 61 | .sto_get_folder_session = imap_mailstorage_get_folder_session, |
62 | .sto_uninitialize = imap_mailstorage_uninitialize, | 62 | .sto_uninitialize = imap_mailstorage_uninitialize, |
63 | }; | 63 | }; |
64 | 64 | ||
65 | int imap_mailstorage_init(struct mailstorage * storage, | 65 | int imap_mailstorage_init(struct mailstorage * storage, |
66 | char * imap_servername, uint16_t imap_port, | 66 | char * imap_servername, uint16_t imap_port, |
67 | char * imap_command, | 67 | char * imap_command, |
68 | int imap_connection_type, int imap_auth_type, | 68 | int imap_connection_type, int imap_auth_type, |
69 | char * imap_login, char * imap_password, | 69 | char * imap_login, char * imap_password, |
70 | int imap_cached, char * imap_cache_directory) | 70 | int imap_cached, char * imap_cache_directory) |
71 | { | 71 | { |
72 | struct imap_mailstorage * imap_storage; | 72 | struct imap_mailstorage * imap_storage; |
73 | 73 | ||
74 | imap_storage = malloc(sizeof(struct imap_mailstorage)); | 74 | imap_storage = malloc(sizeof(* imap_storage)); |
75 | if (imap_storage == NULL) | 75 | if (imap_storage == NULL) |
76 | goto err; | 76 | goto err; |
77 | 77 | ||
78 | imap_storage->imap_servername = strdup(imap_servername); | 78 | imap_storage->imap_servername = strdup(imap_servername); |
79 | if (imap_storage->imap_servername == NULL) | 79 | if (imap_storage->imap_servername == NULL) |
80 | goto free; | 80 | goto free; |
81 | 81 | ||
82 | imap_storage->imap_connection_type = imap_connection_type; | 82 | imap_storage->imap_connection_type = imap_connection_type; |
83 | 83 | ||
84 | if (imap_port == 0) { | 84 | if (imap_port == 0) { |
85 | switch (imap_connection_type) { | 85 | switch (imap_connection_type) { |
86 | case CONNECTION_TYPE_PLAIN: | 86 | case CONNECTION_TYPE_PLAIN: |
87 | case CONNECTION_TYPE_TRY_STARTTLS: | 87 | case CONNECTION_TYPE_TRY_STARTTLS: |
88 | case CONNECTION_TYPE_STARTTLS: | 88 | case CONNECTION_TYPE_STARTTLS: |
89 | case CONNECTION_TYPE_COMMAND: | 89 | case CONNECTION_TYPE_COMMAND: |
90 | case CONNECTION_TYPE_COMMAND_TRY_STARTTLS: | 90 | case CONNECTION_TYPE_COMMAND_TRY_STARTTLS: |
91 | case CONNECTION_TYPE_COMMAND_STARTTLS: | 91 | case CONNECTION_TYPE_COMMAND_STARTTLS: |
92 | imap_port = IMAP_DEFAULT_PORT; | 92 | imap_port = IMAP_DEFAULT_PORT; |
93 | break; | 93 | break; |
94 | 94 | ||
95 | case CONNECTION_TYPE_TLS: | 95 | case CONNECTION_TYPE_TLS: |
96 | case CONNECTION_TYPE_COMMAND_TLS: | 96 | case CONNECTION_TYPE_COMMAND_TLS: |
97 | imap_port = IMAPS_DEFAULT_PORT; | 97 | imap_port = IMAPS_DEFAULT_PORT; |
98 | break; | 98 | break; |