Index: /trunk/zoo-project/zoo-kernel/request_parser.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 626)
+++ /trunk/zoo-project/zoo-kernel/request_parser.c	(revision 627)
@@ -275,4 +275,5 @@
 		      }
 		    free (tmpx2);
+		    addIntToMap (tmpmaps->content, "Order", hInternet->nb);
 		    addToMap (tmpmaps->content, "Reference", tmpv1 + 1);
 		  }
@@ -540,5 +541,4 @@
 			  if (l == 4 )
 			    {
-			      addToMap (tmpmaps->content, "Reference", (char*) val);
 			      if ((ltmp==NULL || strncmp (ltmp->value, "POST",4) != 0))
 				{
@@ -553,4 +553,5 @@
 				    }
 				}
+			      addToMap (tmpmaps->content, "Reference", (char*) val);
 			    }
 			}
@@ -668,4 +669,5 @@
 							   INTERNET_FLAG_NO_CACHE_WRITE,
 							   0);
+					  addIntToMap (tmpmaps->content, "Order", hInternet->nb);
 					}
 				      xmlFree (btmps);
@@ -737,4 +739,5 @@
 						       INTERNET_FLAG_NO_CACHE_WRITE,
 						       0);
+				    addIntToMap (tmpmaps->content, "Order", hInternet->nb);
 				  }
 				free (tmp);
Index: /trunk/zoo-project/zoo-kernel/service.h
===================================================================
--- /trunk/zoo-project/zoo-kernel/service.h	(revision 626)
+++ /trunk/zoo-project/zoo-kernel/service.h	(revision 627)
@@ -637,4 +637,29 @@
 
   /**
+   * Add a key and an integer value to an existing map.
+   *
+   * @param m the map to add the KVP
+   * @param n the key to add
+   * @param v the corresponding value to add
+   */
+  static void addIntToMap(map* m,const char* n,const int v){
+    char svalue[10];
+    sprintf(svalue,"%d",v);
+    if(hasKey(m,n)==false){
+      map* _cursor=m;
+      while(_cursor->next!=NULL){
+	_cursor=_cursor->next;
+      }
+      _cursor->next=createMap(n,svalue);
+    }
+    else{
+      map *tmp=getMap(m,n);
+      if(tmp->value!=NULL)
+	free(tmp->value);
+      tmp->value=zStrdup(svalue);
+    }
+  }
+
+  /**
    * Add a key and a binary value to an existing map.
    *
@@ -1010,9 +1035,10 @@
     }
 
-    char *tmpV[11]={
+    char *tmpV[12]={
       (char*)"size",
       (char*)"value",
       (char*)"uom",
       (char*)"Reference",
+      (char*)"Order",
       (char*)"cache_file",
       (char*)"fmimeType",
@@ -1026,5 +1052,5 @@
     addToMap(_cursor->content,"length",tmpLen);
     int i=0;
-    for(i=0;i<11;i++){
+    for(i=0;i<12;i++){
       map* tmpVI=getMap(tmp->content,tmpV[i]);
       if(tmpVI!=NULL){
Index: /trunk/zoo-project/zoo-kernel/service_internal.c
===================================================================
--- /trunk/zoo-project/zoo-kernel/service_internal.c	(revision 626)
+++ /trunk/zoo-project/zoo-kernel/service_internal.c	(revision 627)
@@ -3594,4 +3594,5 @@
     map* tmp1;
     int index=0;
+    char sindex[5];
     while(content!=NULL){
       
@@ -3613,4 +3614,5 @@
 	char icname[14];
 	char xname[16];
+	char oname[12];
 	if(index>0)
 	  sprintf(vname1,"value_%d",index);
@@ -3626,4 +3628,5 @@
 	  sprintf(icname,"isCached_%d",i);
 	  sprintf(xname,"Reference_%d",i);
+	  sprintf(oname,"Order_%d",i);
 	}else{
 	  sprintf(cname,"cache_file");
@@ -3633,8 +3636,10 @@
 	  sprintf(icname,"isCached");
 	  sprintf(xname,"Reference");
+	  sprintf(oname,"Order");
 	}
 
-	map* tmap=getMapFromMaps(*m,"orequests",vname1);
-	if((tmp1=getMap(content->content,xname))!=NULL /*&& ((tmap!=NULL && strcasecmp(tmap->value,tmp1->value)==0) )*/){
+	map* tmap=getMap(content->content,oname);
+	sprintf(sindex,"%d",index+1);
+	if((tmp1=getMap(content->content,xname))!=NULL && tmap!=NULL && strcasecmp(tmap->value,sindex)==0){
 
 	  if(getMap(content->content,icname)==NULL){
