evolution-data-server r8762 - trunk/camel/providers/imap4



Author: fejj
Date: Wed May  7 03:03:08 2008
New Revision: 8762
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8762&view=rev

Log:
2008-05-06  Jeffrey Stedfast  <fejj novell com>

	* camel-imap4-store.c (imap4_try_authenticate): Fixed a mis-use of
	full_prompt.



Modified:
   trunk/camel/providers/imap4/ChangeLog
   trunk/camel/providers/imap4/camel-imap4-command.c
   trunk/camel/providers/imap4/camel-imap4-engine.c
   trunk/camel/providers/imap4/camel-imap4-journal.c
   trunk/camel/providers/imap4/camel-imap4-search.c
   trunk/camel/providers/imap4/camel-imap4-store.c
   trunk/camel/providers/imap4/camel-imap4-stream.c
   trunk/camel/providers/imap4/camel-imap4-summary.c
   trunk/camel/providers/imap4/camel-imap4-utils.c

Modified: trunk/camel/providers/imap4/camel-imap4-command.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-command.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-command.c	Wed May  7 03:03:08 2008
@@ -158,14 +158,14 @@
 	case IMAP4_STRING_LITERAL:
 		if (engine->capa & CAMEL_IMAP4_CAPABILITY_LITERALPLUS) {
 			/* we have to send a literal, but the server supports LITERAL+ so use that */
-			g_string_append_printf (str, "{%lu+}\r\n%s", strlen (string), string);
+			g_string_append_printf (str, "{%u+}\r\n%s", strlen (string), string);
 		} else {
 			/* we have to make it a literal */
 			literal = g_new (CamelIMAP4Literal, 1);
 			literal->type = CAMEL_IMAP4_LITERAL_STRING;
 			literal->literal.string = g_strdup (string);
 			
-			g_string_append_printf (str, "{%lu}\r\n", strlen (string));
+			g_string_append_printf (str, "{%u}\r\n", strlen (string));
 			
 			(*tail)->buffer = g_strdup (str->str);
 			(*tail)->buflen = str->len;
@@ -227,7 +227,7 @@
 			case 'u':
 				/* unsigned integer */
 				u = va_arg (args, unsigned int);
-				g_string_append_printf (str, "%lu", u);
+				g_string_append_printf (str, "%u", u);
 				break;
 			case 'F':
 				/* CamelIMAP4Folder */
@@ -254,7 +254,7 @@
 				
 				/* FIXME: take advantage of LITERAL+? */
 				len = camel_imap4_literal_length (literal);
-				g_string_append_printf (str, "{%lu}\r\n", len);
+				g_string_append_printf (str, "{%u}\r\n", len);
 				
 				tail->buffer = g_strdup (str->str);
 				tail->buflen = str->len;
@@ -499,7 +499,7 @@
 	        fprintf (stderr, "\"%s\"", token->v.qstring);
 		break;
 	case CAMEL_IMAP4_TOKEN_LITERAL:
-		fprintf (stderr, "{%lu}", token->v.literal);
+		fprintf (stderr, "{%u}", token->v.literal);
 		break;
 	default:
 		fprintf (stderr, "%c", (unsigned char) (token->token & 0xff));

Modified: trunk/camel/providers/imap4/camel-imap4-engine.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-engine.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-engine.c	Wed May  7 03:03:08 2008
@@ -979,7 +979,7 @@
 		
 		if (resp != NULL) {
 			if (token.token == CAMEL_IMAP4_TOKEN_NUMBER)
-				resp->v.copyuid.srcset = g_strdup_printf ("%lu", token.v.number);
+				resp->v.copyuid.srcset = g_strdup_printf ("%u", token.v.number);
 			else
 				resp->v.copyuid.srcset = g_strdup (token.v.atom);
 		}
@@ -995,7 +995,7 @@
 		
 		if (resp != NULL) {
 			if (token.token == CAMEL_IMAP4_TOKEN_NUMBER)
-				resp->v.copyuid.destset = g_strdup_printf ("%lu", token.v.number);
+				resp->v.copyuid.destset = g_strdup_printf ("%u", token.v.number);
 			else
 				resp->v.copyuid.destset = g_strdup (token.v.atom);
 		}
@@ -1204,7 +1204,7 @@
 			if (untagged (engine, ic, v, token, ex) == -1)
 				return -1;
 		} else {
-			d(fprintf (stderr, "Unrecognized untagged response: * %lu %s\n", v, token->v.atom));
+			d(fprintf (stderr, "Unrecognized untagged response: * %u %s\n", v, token->v.atom));
 		}
 		
 		/* find the eoln token */

Modified: trunk/camel/providers/imap4/camel-imap4-journal.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-journal.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-journal.c	Wed May  7 03:03:08 2008
@@ -321,7 +321,7 @@
 	}
 	
 	nextuid = camel_folder_summary_next_uid (folder->summary);
-	uid = g_strdup_printf ("-%lu", nextuid);
+	uid = g_strdup_printf ("-%u", nextuid);
 	
 	if (!(cache = camel_data_cache_add (imap4_folder->cache, "cache", uid, ex))) {
 		folder->summary->nextuid--;

Modified: trunk/camel/providers/imap4/camel-imap4-search.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-search.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-search.c	Wed May  7 03:03:08 2008
@@ -119,7 +119,7 @@
 		if (token->token != CAMEL_IMAP4_TOKEN_NUMBER || token->v.number == 0)
 			goto unexpected;
 		
-		sprintf (uid, "%lu", token->v.number);
+		sprintf (uid, "%u", token->v.number);
 		if ((info = camel_folder_summary_uid (summary, uid))) {
 			g_ptr_array_add (matches, (char *) camel_message_info_uid (info));
 			camel_message_info_free (info);

Modified: trunk/camel/providers/imap4/camel-imap4-store.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-store.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-store.c	Wed May  7 03:03:08 2008
@@ -447,40 +447,40 @@
 	CamelSasl *sasl = NULL;
 	CamelIMAP4Command *ic;
 	int id;
-
+	
 	if (service->url->authmech)
 		mech = g_hash_table_lookup (engine->authtypes, service->url->authmech);
-
+	
 	if ((!mech || (mech && mech->need_password)) && !service->url->passwd) {
 		guint32 flags = CAMEL_SESSION_PASSWORD_SECRET;
 		char *base_prompt;
 		char *full_prompt;
-
+		
 		if (reprompt)
 			flags |= CAMEL_SESSION_PASSWORD_REPROMPT;
-
+		
 		base_prompt = camel_session_build_password_prompt (
 			"IMAP", service->url->user, service->url->host);
-
+		
 		if (errmsg != NULL)
 			full_prompt = g_strconcat (errmsg, base_prompt, NULL);
 		else
-			full_prompt = g_strdup (full_prompt);
-
+			full_prompt = g_strdup (base_prompt);
+		
 		service->url->passwd = camel_session_get_password (
 			session, service, NULL, full_prompt,
 			"password", flags, ex);
-
+		
 		g_free (base_prompt);
 		g_free (full_prompt);
-
+		
 		if (!service->url->passwd)
 			return FALSE;
 	}
-
+	
 	if (service->url->authmech) {
 		sasl = camel_sasl_new ("imap", mech->authproto, service);
-
+		
 		ic = camel_imap4_engine_prequeue (engine, NULL, "AUTHENTICATE %s\r\n", service->url->authmech);
 		ic->plus = sasl_auth;
 		ic->user_data = sasl;

Modified: trunk/camel/providers/imap4/camel-imap4-stream.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-stream.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-stream.c	Wed May  7 03:03:08 2008
@@ -467,7 +467,7 @@
 					token->token = CAMEL_IMAP4_TOKEN_LITERAL;
 					token->v.literal = literal;
 					
-					d(fprintf (stderr, "token: {%lu}\n", literal));
+					d(fprintf (stderr, "token: {%u}\n", literal));
 					
 					stream->mode = CAMEL_IMAP4_STREAM_MODE_LITERAL;
 					stream->literal = literal;
@@ -494,7 +494,7 @@
 				token->token = CAMEL_IMAP4_TOKEN_NUMBER;
 				token->v.number = nz_number;
 				
-				d(fprintf (stderr, "token: %lu\n", nz_number));
+				d(fprintf (stderr, "token: %u\n", nz_number));
 				
 				break;
 			} else if (is_atom (*inptr)) {

Modified: trunk/camel/providers/imap4/camel-imap4-summary.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-summary.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-summary.c	Wed May  7 03:03:08 2008
@@ -764,7 +764,7 @@
 	char *warning;
 	
 	warning = g_strdup_printf ("IMAP server did not respond with an untagged FETCH response "
-				   "for message #%lu. This is illegal according to rfc3501 (and "
+				   "for message #%u. This is illegal according to rfc3501 (and "
 				   "the older rfc2060). You will need to contact your\n"
 				   "Administrator(s) (or ISP) and have them resolve this issue.\n\n"
 				   "Hint: If your IMAP server is Courier-IMAP, it is likely that this "
@@ -942,7 +942,7 @@
 	}
 	
 	if (!(envelope = added->pdata[index - fetch->first])) {
-		info = camel_folder_summary_info_new (summary);
+		info = camel_message_info_new (summary);
 		iinfo = (CamelIMAP4MessageInfo *) info;
 		envelope = g_new (struct imap4_envelope_t, 1);
 		added->pdata[index - fetch->first] = envelope;
@@ -982,7 +982,7 @@
 				CamelMessageInfo *tmp;
 				int rv;
 				
-				g_warning ("Hmmm, server is sending us ENVELOPE data for a message we didn't ask for (message %lu)\n",
+				g_warning ("Hmmm, server is sending us ENVELOPE data for a message we didn't ask for (message %u)\n",
 					   index);
 				tmp = camel_message_info_new (summary);
 				rv = decode_envelope (engine, tmp, token, ex);
@@ -1029,17 +1029,19 @@
 			
 			changed |= IMAP4_FETCH_RFC822SIZE;
 		} else if (!strcmp (token->v.atom, "UID")) {
+			const char *iuid;
+			
 			if (camel_imap4_engine_next_token (engine, token, ex) == -1)
 				goto exception;
 			
 			if (token->token != CAMEL_IMAP4_TOKEN_NUMBER || token->v.number == 0)
 				goto unexpected;
 			
-			sprintf (uid, "%lu", token->v.number);
+			sprintf (uid, "%u", token->v.number);
 			iuid = camel_message_info_uid (info);
 			if (iuid != NULL && iuid[0] != '\0') {
 				if (strcmp (iuid, uid) != 0) {
-					d(fprintf (stderr, "Hmmm, UID mismatch for message %lu\n", index));
+					d(fprintf (stderr, "Hmmm, UID mismatch for message %u\n", index));
 					g_assert_not_reached ();
 				}
 			} else {
@@ -1189,10 +1191,10 @@
 static void
 imap4_fetch_all_reset (CamelIMAP4Command *ic, struct imap4_fetch_all_t *fetch)
 {
-	CamelIMAP4Summary *imap_summary = (CamelIMAP4Summary *) fetch->summary;
+	CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) fetch->summary;
 	CamelFolder *folder = fetch->summary->folder;
-	struct imap_envelope_t *envelope;
-	SpruceMessageInfo *info;
+	struct imap4_envelope_t *envelope;
+	CamelMessageInfo *info;
 	guint32 seqid, iuid;
 	const char *query;
 	char uid[32];
@@ -1226,7 +1228,7 @@
 		camel_message_info_free (info);
 		sprintf (uid, "%u", iuid + 1);
 		
-		fetch->total = imap_summary->exists - scount;
+		fetch->total = imap4_summary->exists - scount;
 		g_ptr_array_set_size (fetch->added, fetch->total);
 		fetch->first = seqid;
 		
@@ -1292,6 +1294,7 @@
 static CamelIMAP4Command *
 imap4_summary_fetch_flags (CamelFolderSummary *summary)
 {
+	CamelIMAP4Summary *imap4_summary = (CamelIMAP4Summary *) summary;
 	CamelFolder *folder = summary->folder;
 	struct imap4_fetch_all_t *fetch;
 	CamelMessageInfo *info[2];
@@ -1625,7 +1628,7 @@
 		}
 	} else {
 		/* need to fetch new envelopes */
-		first = scount + 1;
+		seqid = scount + 1;
 	}
 	
 	if (seqid != 0 && seqid <= imap4_summary->exists) {
@@ -1633,7 +1636,7 @@
 			info = camel_folder_summary_index (summary, scount - 1);
 			iuid = strtoul (camel_message_info_uid (info), NULL, 10);
 			camel_message_info_free (info);
-			sprintf (uid, "%lu", iuid + 1);
+			sprintf (uid, "%u", iuid + 1);
 		} else {
 			strcpy (uid, "1");
 		}

Modified: trunk/camel/providers/imap4/camel-imap4-utils.c
==============================================================================
--- trunk/camel/providers/imap4/camel-imap4-utils.c	(original)
+++ trunk/camel/providers/imap4/camel-imap4-utils.c	Wed May  7 03:03:08 2008
@@ -298,7 +298,7 @@
 		return -1;
 	}
 	
-	d(fprintf (stderr, "added uid %s to uidset (summary index = %lu)\n", iuid, index));
+	d(fprintf (stderr, "added uid %s to uidset (summary index = %u)\n", iuid, index));
 	
 	if (uidset->setlen < uidset->maxlen)
 		return 0;
@@ -384,10 +384,10 @@
 		g_string_append (errmsg, token->v.qstring);
 		break;
 	case CAMEL_IMAP4_TOKEN_LITERAL:
-		g_string_append_printf (errmsg, "{%lu}", token->v.literal);
+		g_string_append_printf (errmsg, "{%u}", token->v.literal);
 		break;
 	case CAMEL_IMAP4_TOKEN_NUMBER:
-		g_string_append_printf (errmsg, "%lu", token->v.number);
+		g_string_append_printf (errmsg, "%u", token->v.number);
 		break;
 	case CAMEL_IMAP4_TOKEN_NO_DATA:
 		g_string_append (errmsg, _("No data"));
@@ -615,6 +615,7 @@
 	camel_imap4_status_attr_t *attr, *tail, *list = NULL;
 	GPtrArray *array = ic->user_data;
 	camel_imap4_status_t *status;
+	unsigned char *literal;
 	char *mailbox;
 	size_t len;
 	int type;
@@ -631,8 +632,10 @@
 		mailbox = g_strdup (token->v.qstring);
 		break;
 	case CAMEL_IMAP4_TOKEN_LITERAL:
-		if (camel_imap4_engine_literal (engine, (unsigned char **) &mailbox, &len, ex) == -1)
+		if (camel_imap4_engine_literal (engine, &literal, &len, ex) == -1)
 			return -1;
+		
+		mailbox = (char *) literal;
 		break;
 	default:
 		fprintf (stderr, "Unexpected token in IMAP4 untagged STATUS response: %s%c\n",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]